From 488d4d75530fc74b9b1dec8c8b4d51a165b4275b Mon Sep 17 00:00:00 2001 From: David Sandoz Date: Fri, 16 Feb 2024 12:17:59 +0100 Subject: [PATCH] refactor: use defineComponent instead of Vue.extend And fix revealed TypeScript errors --- .../competitions/st-match-event-small.vue | 12 ++-- .../competitions/st-match-result-list.vue | 4 +- components/competitions/st-match-result.vue | 4 +- .../competitions/st-upcoming-matches.vue | 4 +- components/events/st-calendar-nav.vue | 4 +- components/events/st-event-date.vue | 4 +- components/events/st-event-list.vue | 4 +- components/events/st-event-small.vue | 4 +- components/events/st-event.vue | 10 ++-- components/events/st-month-calendar.vue | 4 +- components/icon/st-custom-icon.vue | 4 +- ...st-national-team-competition-team-list.vue | 4 +- ...-national-team-competition-update-list.vue | 6 +- .../st-national-team-competition-update.vue | 4 +- .../national-teams/st-national-teams.prop.ts | 28 +++++---- components/national-teams/st-player.vue | 8 +-- components/news/st-news-list.vue | 4 +- components/news/st-news.vue | 4 +- components/people/st-person.vue | 6 +- components/people/st-role.vue | 14 ++--- components/people/st-staff-person.vue | 4 +- components/resources/st-resource-list.vue | 4 +- components/resources/st-resource.vue | 4 +- components/st-breadcrumb.vue | 4 +- components/st-burger-button.vue | 4 +- components/st-button.vue | 4 +- components/st-category-distribution-table.vue | 4 +- components/st-club-list.vue | 10 ++-- components/st-domain-labels.vue | 4 +- components/st-flickr-album-gallery.vue | 4 +- components/st-flickr-album-link.vue | 4 +- components/st-flickr-photo.vue | 4 +- components/st-footer.vue | 8 +-- components/st-home-carousel.vue | 4 +- components/st-language-switcher.vue | 7 ++- components/st-link-action.vue | 4 +- components/st-link-list.vue | 6 +- components/st-live-stream-banner.vue | 4 +- components/st-medal.vue | 8 ++- components/st-navigation.vue | 15 +++-- components/st-pagination.vue | 4 +- components/st-select-navigation.vue | 8 ++- components/st-simple-page.vue | 6 +- components/tchoukup/st-tchoukup-list.vue | 8 +-- layouts/default.vue | 4 +- mixins/month-params.mixin.ts | 4 +- mixins/newsletter.mixin.ts | 4 +- models/match.model.ts | 2 +- pages/_.vue | 12 +++- pages/calendar/_year/_month/index.vue | 4 +- pages/calendar/_year/index.vue | 4 +- pages/calendar/index.vue | 4 +- pages/clubs.vue | 4 +- pages/competitions/_competition/_season.vue | 6 +- .../_competition/_season/_phase.vue | 4 +- .../_competition/_season/_phase/index.vue | 4 +- .../_competition/_season/_phase/planning.vue | 29 ++++++---- .../_competition/_season/_phase/results.vue | 23 ++++---- .../_competition/_season/_phase/standings.vue | 33 +++++++---- .../_competition/_season/match/_matchId.vue | 18 +++--- pages/competitions/_competition/index.vue | 4 +- pages/contact.vue | 4 +- pages/etc2022.vue | 4 +- pages/event/_slug.vue | 4 +- pages/events/_slug.vue | 4 +- pages/impressum.vue | 4 +- pages/index.vue | 11 +++- pages/juniors.vue | 4 +- pages/medias.vue | 4 +- pages/national-teams/_team.vue | 6 +- pages/national-teams/_team/index.vue | 4 +- pages/national-teams/_team/players.vue | 10 ++-- pages/national-teams/_team/results.vue | 17 ++++-- pages/national-teams/_team/staff.vue | 8 ++- .../competitions/_competition.vue | 4 +- .../competitions/_competition/about.vue | 4 +- .../competitions/_competition/index.vue | 4 +- .../competitions/_competition/live.vue | 4 +- .../competitions/_competition/medias.vue | 4 +- .../competitions/_competition/schedule.vue | 4 +- .../competitions/_competition/teams.vue | 6 +- pages/news/_slug.vue | 6 +- pages/news/index.vue | 4 +- pages/newsletter/confirm.vue | 4 +- pages/newsletter/valid.vue | 4 +- pages/press-releases/_slug.vue | 6 +- pages/press-releases/index.vue | 4 +- pages/referees.vue | 4 +- pages/regional-associations.vue | 4 +- pages/resources.vue | 4 +- pages/seasons/_season.vue | 6 +- pages/seasons/index.vue | 4 +- pages/structure/_group.vue | 4 +- pages/structure/index.vue | 4 +- pages/tchoukup.vue | 4 +- plugins/cms-service.ts | 8 ++- plugins/cms-service/national-teams.ts | 58 ++++++++++++++----- plugins/directus.ts | 8 ++- plugins/leverade.ts | 20 +++++-- tsconfig.json | 4 ++ utils/utils.ts | 4 +- 101 files changed, 410 insertions(+), 303 deletions(-) diff --git a/components/competitions/st-match-event-small.vue b/components/competitions/st-match-event-small.vue index ef7994e7..d31e10f9 100644 --- a/components/competitions/st-match-event-small.vue +++ b/components/competitions/st-match-event-small.vue @@ -1,19 +1,20 @@ diff --git a/components/competitions/st-match-result-list.vue b/components/competitions/st-match-result-list.vue index 4d1eb9ce..d8795f03 100644 --- a/components/competitions/st-match-result-list.vue +++ b/components/competitions/st-match-result-list.vue @@ -13,11 +13,11 @@ diff --git a/pages/competitions/_competition/_season/_phase/results.vue b/pages/competitions/_competition/_season/_phase/results.vue index 02b0059e..08d8cf14 100644 --- a/pages/competitions/_competition/_season/_phase/results.vue +++ b/pages/competitions/_competition/_season/_phase/results.vue @@ -3,9 +3,9 @@ diff --git a/pages/competitions/_competition/_season/_phase/standings.vue b/pages/competitions/_competition/_season/_phase/standings.vue index 89196a32..2da612b9 100644 --- a/pages/competitions/_competition/_season/_phase/standings.vue +++ b/pages/competitions/_competition/_season/_phase/standings.vue @@ -16,9 +16,9 @@ - + {{ standing.position }} - +
- {{ standing.stats.find((stat) => stat.type === statKey).value }} + {{ getStatValueForKey(standing, statKey) }} @@ -40,15 +40,21 @@ diff --git a/pages/competitions/_competition/_season/match/_matchId.vue b/pages/competitions/_competition/_season/match/_matchId.vue index 1c41345e..6de3ac23 100644 --- a/pages/competitions/_competition/_season/match/_matchId.vue +++ b/pages/competitions/_competition/_season/match/_matchId.vue @@ -1,10 +1,10 @@ diff --git a/pages/index.vue b/pages/index.vue index a6fa633a..de410b4f 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -41,7 +41,7 @@ @@ -65,7 +65,7 @@ diff --git a/pages/juniors.vue b/pages/juniors.vue index 5edac39f..0ccf10a7 100644 --- a/pages/juniors.vue +++ b/pages/juniors.vue @@ -8,12 +8,12 @@