Skip to content

refactor(website): Migrate /list page to go - #5794

Open
michaelkedar wants to merge 2 commits into
masterfrom
🕸️🚫🐍

Hidden character warning

The head ref may contain hidden characters: "\ud83d\udd78\ufe0f\ud83d\udeab\ud83d\udc0d"
Open

refactor(website): Migrate /list page to go#5794
michaelkedar wants to merge 2 commits into
masterfrom
🕸️🚫🐍

Conversation

@michaelkedar

Copy link
Copy Markdown
Member

Final template migration for the Go website, for the /list page.

  • Implemented a bunch of rendering functions needed (e.g. for the "just now", "x minutes ago", etc.
  • Added new ListedVulnerability model for database abstrtactions to return.
  • Did a little bit of refactoring to share some CVSS code between list and vulnerability page.
  • Buncha placeholder data

Stack created with GitHub Stacks CLIGive Feedback 💬

<span role="cell" class="vuln-table-cell mdc-data-table__cell">
<relative-time datetime="{{ vulnerability.published }}">
{{ vulnerability.published | relative_time }}
<relative-time datetime="{{ .FormattedPublished }}">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just make this a span with a title="original date". We can look at this again in the future if the web component make sense to use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it looks like we are not even installing the relative-time web component

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was removed here: 25bc7c6

Comment on lines +104 to +115
result := make([]string, limit)
for i := range limit {
pkg := v.Packages[i]
if pkg.Repo != "" {
result[i] = stripScheme(pkg.Repo)
} else if pkg.Package != nil {
if pkg.Package.GetEcosystem() == "" {
result[i] = pkg.Package.GetName()
} else {
result[i] = pkg.Package.GetEcosystem() + "/" + pkg.Package.GetName()
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just do append so there won't be empty entries if both parts of the if statement fails (That's probably pretty rare though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants