Skip to content

Commit

Permalink
fix(deps): update Directus SDK to v15
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsandoz committed Mar 23, 2024
1 parent 59a713d commit e192942
Show file tree
Hide file tree
Showing 16 changed files with 1,141 additions and 1,155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<img
v-if="update.image"
class="c-national-team-competition-update__image"
:alt="update.image.description"
:alt="update.image.description || undefined"
:src="imageFallbackSrc"
:srcset="imageSrcSet"
sizes="(min-width: 800px}) 800px, 96vw"
Expand Down
10 changes: 5 additions & 5 deletions components/national-teams/st-national-teams.prop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ItemInput } from '@directus/sdk';
import { type DirectusFile } from '@directus/sdk';
import { Gender, Role } from '~/plugins/cms-service';
import { DirectusImage, DirectusPerson } from '~/plugins/directus';
import { DirectusPerson, DirectusSchema } from '~/plugins/directus';

export interface Player {
id: number;
Expand Down Expand Up @@ -41,7 +41,7 @@ export interface NationalTeamCompetition {
export interface NationalTeamCompetitionUpdate {
id: number;
body: string;
image?: DirectusImage;
image?: DirectusFile<DirectusSchema>;
is_key: boolean;
teams: { id: number; name: string }[];
date_created: string;
Expand All @@ -57,7 +57,7 @@ export interface NationalTeam {
name: string;
slug: string;
gender: string;
team_photo?: DirectusImage;
team_photo?: DirectusFile<DirectusSchema>;
team_photo_vertical_shift?: number;
players: Player[];
/**
Expand All @@ -75,7 +75,7 @@ export interface NationalTeamForCompetition {
competition: NationalTeamCompetition;
team: Pick<NationalTeam, 'name' | 'slug'>;
players: Player[];
coaches: ItemInput<DirectusPerson>[];
coaches: DirectusPerson[];
}

// Just to clear a Nuxt warning.
Expand Down
1 change: 1 addition & 0 deletions components/resources/st-resource.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default defineComponent({
if (!this.resource?.file) {
return;
}
// @ts-ignore TODO: Check the actual type
return humanFileSize(this.resource.file.filesize, 2, this.$i18n.locale);
},
fileName(): string {
Expand Down
3 changes: 1 addition & 2 deletions components/st-club-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
</template>

<script lang="ts">
import { ItemInput } from '@directus/sdk';
import { defineComponent, PropType } from 'vue';
import { DirectusClub, getAssetURL } from '~/plugins/directus';
export default defineComponent({
props: {
clubs: {
type: Array as PropType<ItemInput<DirectusClub>[]>,
type: Array as PropType<DirectusClub[]>,
required: true,
},
},
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const config: NuxtConfig = {

// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: ['vue-tooltip'],
transpile: ['vue-tooltip', '@directus/sdk', '@directus/system-data'],
postcss: {
postcssOptions: {
plugins: {
Expand Down
76 changes: 26 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"engines": {
"node": "20"
},
"type": "commonjs",
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
Expand All @@ -20,7 +21,7 @@
"*.{css,vue}": "stylelint"
},
"dependencies": {
"@directus/sdk": "^10.3.5",
"@directus/sdk": "^15.0.3",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@hcaptcha/vue-hcaptcha": "^1.3.0",
Expand Down
3 changes: 1 addition & 2 deletions pages/clubs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</template>

<script lang="ts">
import { ItemInput } from '@directus/sdk';
import { defineComponent } from 'vue';
import stClubList from '~/components/st-club-list.vue';
import { DirectusClub } from '~/plugins/directus';
Expand All @@ -20,7 +19,7 @@ export default defineComponent({
components: { stClubList },
data() {
return {
clubs: [] as ItemInput<DirectusClub>[],
clubs: [] as DirectusClub[],
};
},
nuxtI18n: {
Expand Down
2 changes: 1 addition & 1 deletion pages/national-teams/_team.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
v-if="team.team_photo"
class="c-team__photo"
:style="`object-position: 0 ${teamPhotoVerticalShiftInPercentage}%;`"
:alt="team.team_photo.description"
:alt="team.team_photo.description || undefined"
:src="mainImageFallbackSrc"
:srcset="mainImageSrcSet"
:sizes="imgTagSizes"
Expand Down
5 changes: 4 additions & 1 deletion pages/news/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import stLoader from '~/components/st-loader.vue';
import stNewsList from '~/components/news/st-news-list.vue';
import { NewsEntry } from '~/components/news/st-news';
import StPagination from '~/components/st-pagination.vue';
import { DirectusDomain } from '~/plugins/directus';
export default defineComponent({
components: { stLoader, stNewsList, StPagination },
Expand Down Expand Up @@ -83,7 +84,9 @@ export default defineComponent({
if (!this.filteredDomainId) {
return;
}
return this.$store.getters.getDomainById(this.filteredDomainId);
const domain: DirectusDomain = this.$store.getters.getDomainById(this.filteredDomainId);
return domain.name;
},
},
watch: {
Expand Down
3 changes: 1 addition & 2 deletions pages/regional-associations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
</template>

<script lang="ts">
import { ItemInput } from '@directus/sdk';
import { defineComponent } from 'vue';
import stClubList from '~/components/st-club-list.vue';
import { DirectusClub } from '~/plugins/directus';
Expand All @@ -18,7 +17,7 @@ export default defineComponent({
components: { stClubList },
data() {
return {
associations: [] as ItemInput<DirectusClub>[],
associations: [] as DirectusClub[],
};
},
nuxtI18n: {
Expand Down

0 comments on commit e192942

Please sign in to comment.