Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Improving validation results presentation
Browse files Browse the repository at this point in the history
Presenting downloads links as a column
  • Loading branch information
boggydigital committed Oct 6, 2024
1 parent 118c40f commit 9265cb7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 50 deletions.
41 changes: 31 additions & 10 deletions rest/compton_pages/downloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,40 @@ func validationResults(r compton.Registrar, id string, rdx kevlar.ReadableRedux)

if vd, err := strconv.ParseInt(valDate, 10, 64); err == nil {
valDateElement = fspan.Text(r, compton_fragments.EpochDate(vd)).
FontWeight(font_weight.Bolder).
//FontWeight(font_weight.Bolder).
ForegroundColor(color.Gray).
FontSize(size.Small)
}

valResTitle := ""
valResColor := color.Gray
switch lastResult {
case "OK":
valResTitle = "All product files have been successfully validated"
valResTitle = "Validation successful"
valResColor = color.Green
case "missing-checksum":
valResTitle = "Missing checksum"
valResColor = color.Mint
case "unresolved-manual-url":
valResTitle = "Unresolved URL"
valResColor = color.Teal
case "missing-download":
valResTitle = "Missing download"
valResColor = color.Yellow
case "failed-validation":
valResTitle = "Failed validation"
valResColor = color.Red
case "":
valResTitle = "Product files have not been validated"
valResTitle = "Not validated yet"
default:
valResTitle = "Validation problems found"
valResTitle = "Unknown result"
valResColor = color.Gray
}

valResElement := fspan.Text(r, valResTitle).FontSize(size.Small)
valResElement := fspan.Text(r, valResTitle).
FontSize(size.Small).
FontWeight(font_weight.Bolder).
ForegroundColor(valResColor)

if valDateElement != nil {
valSect.Append(valDateElement)
Expand Down Expand Up @@ -187,14 +206,16 @@ func downloadLinks(r compton.Registrar, os vangogh_local_data.OperatingSystem, d

downloads := filterDownloads(os, dls, dv)

downloadsRow := flex_items.FlexItems(r, direction.Row).
ColumnGap(size.Large).
downloadsColumn := flex_items.FlexItems(r, direction.Column).
RowGap(size.Small)
dsDownloadLinks.Append(downloadsRow)
dsDownloadLinks.Append(downloadsColumn)

for _, dl := range downloads {
for ii, dl := range downloads {
if link := downloadLink(r, dl); link != nil {
downloadsRow.Append(link)
downloadsColumn.Append(link)
}
if ii != len(downloads)-1 {
downloadsColumn.Append(els.Hr())
}
}

Expand Down
40 changes: 0 additions & 40 deletions rest/gaugin_styles/style/downloads.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,6 @@ svg {
}
}

@scope (.validation-results) {
:scope {
border-radius: var(--br-n);
color: var(--c-highlight);
background-color: var(--c-gray);
padding: var(--s-xs) var(--s-n);

& fspan {
background-color: transparent;
color: var(--s-highlight);
}

&.OK {
color: var(--c-highlight);
background-color: var(--c-green);
}

&.missing-checksum {
color: var(--c-highlight);
background-color: var(--c-mint);
}

&.unresolved-manual-url {
color: var(--c-highlight);
background-color: var(--c-teal);
}

&.missing-download {
color: black;
background-color: var(--c-yellow);
}

&.failed-validation {
color: var(--c-highlight);
background-color: var(--c-red);
}
}

}

.version {
white-space: nowrap;
overflow: hidden;
Expand Down

0 comments on commit 9265cb7

Please sign in to comment.