#104 coreos: add pretty label for 4k native raw image
Merged 8 months ago by dustymabe. Opened 8 months ago by jlebon.
fedora-web/ jlebon/websites pr/metal-4k-pretty  into  master

@@ -20,6 +20,7 @@ 

    "aliyun": "Alibaba Cloud",

    "metal": {

      "raw.xz": "Raw",

+     "4k.raw.xz": "Raw (4k Native)",

      "iso": "ISO",

      "pxe": "PXE",

      "installer.iso": "Installer (ISO)",
@@ -279,8 +280,18 @@ 

          const release = getMember(artifacts[platform], "release");

          const formats = getMember(artifacts[platform], "formats");

          if (formats) {

+           prettyFormats = [];

+           // in the case where each individual format has a separate pretty

+           // name, we want the artifacts listed in alphabetical order

            for (var format in formats) {

-             const prettyPlatform = getPrettyPlatform(platform, format);

+               pretty = getPrettyPlatform(getPrettyPlatform(platform, format));

+               prettyFormats.push({format: format, pretty: pretty});

+           }

+           prettyFormats.sort(function(a, b) { return a.pretty.localeCompare(b.pretty); });

+           for (i = 0; i < prettyFormats.length; i++) {

+             const format = prettyFormats[i].format;

+             const prettyPlatform = prettyFormats[i].pretty;

+ 

              // XXX: the conditions to display the extension here are quickly

              // hacked in; if adding any further conditions this should be

              // handled elsewhere in a better organized structure.

And also sort the entries by pretty name so that it shows up near the raw image instead of at the top.

Code LGTM and tested locally without issue!

Pull-Request has been merged by dustymabe

8 months ago
Metadata