#87 coreos: change ordering of AWS regions
Merged 10 months ago by dustymabe. Opened 10 months ago by jlebon.
fedora-web/ jlebon/websites pr/region-order  into  master

@@ -240,6 +240,22 @@ 

                const image = getMember(regions[region], "image");

                displayEntries.push({platform: prettyPlatform, region: region, release: release, image: image});

              }

+             // put 'us', 'eu', and 'ap' first since those are the cheapest and

+             // most popular; then everything else

+             const continentOrdering = ["us", "eu", "ap"];

+             displayEntries = displayEntries.sort(function(a, b) {

+                 const aIdx = continentOrdering.indexOf(a.region.slice(0, 2));

+                 const bIdx = continentOrdering.indexOf(b.region.slice(0, 2));

+                 if (aIdx == bIdx) {

+                     return a.region.localeCompare(b.region);

+                 } else if (aIdx == -1) {

+                     return 1;

+                 } else if (bIdx == -1){

+                     return -1;

+                 } else {

+                     return aIdx - bIdx;

+                 }

+             });

            }

            Vue.set(this.streamDisplay.cloudLaunchable, platform, {list: displayEntries});

          }

Put US, EU, and AP regions first since those are the most popular and
cheapest. Then put everything else. Within those buckets, sort them in
alphabetical order, so e.g. us-east-1 is before us-east-2. This
roughly matches the way Fedora Cloud also lists its AMIs.

Tested locally, LGTM!

Pull-Request has been merged by dustymabe

10 months ago
Metadata