Skip to content

Commit 7063353

Browse files
committed
Corrected display on links list. Cosmetic updates to links display on Ward leader
1 parent d1e6dbd commit 7063353

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/components/links-list.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
target="_blank"
66
rel="noopener noreferrer"
77
:title="link.title"
8-
>{{ link.platform }}</a
8+
>{{ link.title }}</a
99
>
1010
</li>
1111
</template>

src/views/ward-leader.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,26 @@ export default {
345345
if (websites === undefined) {
346346
return [];
347347
}
348-
let linkData = websites.map((obj) =>
349-
Object.fromEntries(
350-
Object.entries(obj).filter(([key]) => key === "fields"),
351-
),
352-
);
348+
console.log(websites);
349+
let linkData = websites
350+
.map((obj) =>
351+
Object.fromEntries(
352+
Object.entries(obj).filter(([key]) => key === "fields"),
353+
),
354+
)
355+
.sort((a, b) => {
356+
const platformA = a.fields.platform.toUpperCase();
357+
const platformB = b.fields.platform.toUpperCase();
358+
return platformA.localeCompare(platformB);
359+
});
353360
354361
linkData = linkData.map((item) => {
355362
return {
356-
title: `${item.fields.title} - ${item.fields.platform.charAt(0).toUpperCase() + item.fields.platform.slice(1)}`,
363+
title: `${item.fields.platform} - ${item.fields.title}`,
357364
url: item.fields.url,
358365
};
359366
});
367+
console.log(linkData);
360368
return linkData;
361369
},
362370
},

0 commit comments

Comments
 (0)