Skip to content

Commit

Permalink
web/satellite: upgrade vue deps
Browse files Browse the repository at this point in the history
In vue 3.4+ a new macro, defineModel, was introduced to simply declare
a two-way bound model as opposed to the verbose way we declare them now
This change upgrades our Vuejs dependency to enable us to use the new
macro. As a result Vite, Vue-vite plugin and Vuetify have been upgraded
to resolve the broken dependency chain.

Issue: #6766

Change-Id: Iea7ed9310d846244f627d5e94eb7e77b8db686ae
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Feb 13, 2024
1 parent a24fb70 commit 386d614
Show file tree
Hide file tree
Showing 39 changed files with 1,504 additions and 846 deletions.
1,883 changes: 1,421 additions & 462 deletions web/satellite/package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions web/satellite/package.json
Expand Up @@ -28,9 +28,9 @@
"pinia": "2.0.23",
"qrcode": "1.5.3",
"stream-browserify": "3.0.0",
"vue": "3.3.2",
"vue": "3.4.17",
"vue-router": "4.2.0",
"vuetify": "3.4.6"
"vuetify": "3.5.3"
},
"devDependencies": {
"@mdi/js": "7.3.67",
Expand All @@ -41,7 +41,7 @@
"@types/qrcode": "1.5.0",
"@typescript-eslint/eslint-plugin": "5.59.5",
"@typescript-eslint/parser": "5.59.5",
"@vitejs/plugin-vue": "4.2.3",
"@vitejs/plugin-vue": "5.0.4",
"@vue/eslint-config-typescript": "11.0.3",
"eslint": "8.40.0",
"eslint-import-resolver-custom-alias": "1.3.0",
Expand All @@ -58,9 +58,9 @@
"stylelint-config-standard-vue": "1.0.0",
"stylelint-scss": "6.0.0",
"typescript": "4.9.5",
"vite": "4.5.2",
"vite": "5.1.1",
"vite-plugin-compression": "0.5.1",
"vite-plugin-vuetify": "1.0.2",
"vite-plugin-vuetify": "2.0.1",
"vitest": "0.31.1",
"vitest-fetch-mock": "0.2.2",
"vue-eslint-parser": "9.3.0",
Expand Down
10 changes: 1 addition & 9 deletions web/satellite/src/components/dialogs/AddTeamMemberDialog.vue
Expand Up @@ -133,18 +133,10 @@ import { useConfigStore } from '@/store/modules/configStore';
import UpgradeAccountDialog from '@/components/dialogs/upgradeAccountFlow/UpgradeAccountDialog.vue';
const props = defineProps<{
modelValue: boolean;
projectId: string;
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean];
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const usersStore = useUsersStore();
const analyticsStore = useAnalyticsStore();
Expand Down
15 changes: 2 additions & 13 deletions web/satellite/src/components/dialogs/AddTokensDialog.vue
Expand Up @@ -44,7 +44,7 @@
</template>

<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { VBtn, VCard, VCardItem, VCardTitle, VDialog, VDivider, VWindow, VWindowItem } from 'vuetify/components';
import AddTokensStep from '@/components/dialogs/upgradeAccountFlow/AddTokensStep.vue';
Expand All @@ -59,18 +59,7 @@ const step = ref(AddTokensDialogStep.AddTokens);
const loading = ref<boolean>(false);
const content = ref<HTMLElement | null>(null);
const props = defineProps<{
modelValue: boolean,
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean];
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
/**
* Sets specific flow step.
Expand Down
13 changes: 1 addition & 12 deletions web/satellite/src/components/dialogs/ApplyCouponCodeDialog.vue
Expand Up @@ -95,18 +95,7 @@ const analyticsStore = useAnalyticsStore();
const notify = useNotify();
const { isLoading, withLoading } = useLoading();
const emit = defineEmits<{
'update:modelValue': [boolean];
}>();
const props = defineProps<{
modelValue: boolean;
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const formValid = ref<boolean>(false);
const couponCode = ref<string>('');
Expand Down
13 changes: 1 addition & 12 deletions web/satellite/src/components/dialogs/BrowserNewFolderDialog.vue
Expand Up @@ -123,18 +123,7 @@ const notify = useNotify();
const { isLoading, withLoading } = useLoading();
const props = defineProps<{
modelValue: boolean,
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean];
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const formValid = ref<boolean>(false);
const folder = ref<string>('');
Expand Down
11 changes: 3 additions & 8 deletions web/satellite/src/components/dialogs/BucketDetailsDialog.vue
Expand Up @@ -106,17 +106,12 @@ const isLoading = useLoading();
const bucketsStore = useBucketsStore();
const projectsStore = useProjectsStore();
const router = useRouter();
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
}>();
const props = defineProps<{
modelValue: boolean,
bucketName: string,
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
function redirectToBucketsPage(): void {
router.push({
Expand Down
14 changes: 2 additions & 12 deletions web/satellite/src/components/dialogs/ChangeNameDialog.vue
Expand Up @@ -110,18 +110,8 @@ const userStore = useUsersStore();
const { isLoading, withLoading } = useLoading();
const notify = useNotify();
const props = defineProps<{
modelValue: boolean,
}>();
const model = defineModel<boolean>({ required: true });
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const formValid = ref<boolean>(false);
const name = ref<string>(userStore.userName);
Expand All @@ -142,7 +132,7 @@ async function onChangeName(): Promise<void> {
return;
}
emit('update:modelValue', false);
model.value = false;
});
}
</script>
14 changes: 2 additions & 12 deletions web/satellite/src/components/dialogs/ChangePasswordDialog.vue
Expand Up @@ -148,18 +148,8 @@ const { isLoading, withLoading } = useLoading();
const router = useRouter();
const notify = useNotify();
const props = defineProps<{
modelValue: boolean,
}>();
const model = defineModel<boolean>({ required: true });
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const formValid = ref<boolean>(false);
const oldPassword = ref<string>('');
const newPassword = ref<string>('');
Expand Down Expand Up @@ -193,7 +183,7 @@ async function onChangePassword(): Promise<void> {
notify.notifyError(error, AnalyticsErrorEventSource.CHANGE_PASSWORD_MODAL);
}
emit('update:modelValue', false);
model.value = false;
});
}
</script>
13 changes: 1 addition & 12 deletions web/satellite/src/components/dialogs/CreateAccessDialog.vue
Expand Up @@ -248,20 +248,9 @@ function resettableRef<T>(value: T): Ref<T> {
return thisRef;
}

const props = defineProps<{
modelValue: boolean,
}>();

const model = computed<boolean>({
get: () => props.modelValue,
set: value => {
if (isCreating.value) return;
emit('update:modelValue', value);
},
});
const model = defineModel<boolean>({ required: true });

const emit = defineEmits<{
'update:modelValue': [value: boolean];
'accessCreated': [];
}>();

Expand Down
10 changes: 2 additions & 8 deletions web/satellite/src/components/dialogs/CreateBucketDialog.vue
Expand Up @@ -127,15 +127,14 @@ const configStore = useConfigStore();
const ipRegexp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
const props = withDefaults(defineProps<{
modelValue: boolean,
openCreated: boolean,
}>(), {
modelValue: false,
openCreated: true,
});
const model = defineModel<boolean>({ required: true });
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
(event: 'created', value: string): void,
}>();
Expand All @@ -144,11 +143,6 @@ const formValid = ref<boolean>(false);
const bucketName = ref<string>('');
const worker = ref<Worker | null>(null);
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const bucketNameRules = computed(() => {
return [
(value: string) => (!!value || 'Bucket name is required.'),
Expand Down
13 changes: 1 addition & 12 deletions web/satellite/src/components/dialogs/CreateProjectDialog.vue
Expand Up @@ -185,18 +185,7 @@ import { ROUTES } from '@/router';
import UpgradeAccountDialog from '@/components/dialogs/upgradeAccountFlow/UpgradeAccountDialog.vue';
const props = defineProps<{
modelValue: boolean,
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean],
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const analyticsStore = useAnalyticsStore();
const projectsStore = useProjectsStore();
Expand Down
7 changes: 1 addition & 6 deletions web/satellite/src/components/dialogs/DeleteAccessDialog.vue
Expand Up @@ -94,19 +94,14 @@ const notify = useNotify();
const { isLoading, withLoading } = useLoading();
const props = defineProps<{
modelValue: boolean;
accessNames: string[];
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean],
'deleted': [];
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
async function onDeleteClick(): Promise<void> {
await withLoading(async () => {
Expand Down
10 changes: 1 addition & 9 deletions web/satellite/src/components/dialogs/DeleteBucketDialog.vue
Expand Up @@ -89,18 +89,10 @@ import { useNotify } from '@/utils/hooks';
import IconTrash from '@/components/icons/IconTrash.vue';
const props = defineProps<{
modelValue: boolean,
bucketName: string;
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean],
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const analyticsStore = useAnalyticsStore();
const configStore = useConfigStore();
Expand Down
7 changes: 1 addition & 6 deletions web/satellite/src/components/dialogs/DeleteFileDialog.vue
Expand Up @@ -85,20 +85,15 @@ import { BrowserObject, useObjectBrowserStore } from '@/store/modules/objectBrow
import IconTrash from '@/components/icons/IconTrash.vue';
const props = defineProps<{
modelValue: boolean,
files: BrowserObject[],
}>();
const emit = defineEmits<{
'update:modelValue': [value: boolean],
'contentRemoved': [],
'filesDeleted': [],
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
const obStore = useObjectBrowserStore();
const bucketsStore = useBucketsStore();
Expand Down
13 changes: 1 addition & 12 deletions web/satellite/src/components/dialogs/DisableMFADialog.vue
Expand Up @@ -113,24 +113,13 @@ const notify = useNotify();
const innerContent = ref<Component | null>(null);
const props = defineProps<{
modelValue: boolean,
}>();
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
}>();
const model = defineModel<boolean>({ required: true });
const confirmCode = ref<string>('');
const isError = ref<boolean>(false);
const useRecoveryCode = ref<boolean>(false);
const formValid = ref<boolean>(false);
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
/**
* Returns validation rules based on whether recovery
* code input is being used.
Expand Down
11 changes: 1 addition & 10 deletions web/satellite/src/components/dialogs/DropzoneDialog.vue
Expand Up @@ -36,19 +36,10 @@ import { VAlert, VContainer, VDialog } from 'vuetify/components';
import { computed } from 'vue';
const props = defineProps<{
modelValue: boolean,
bucket: string,
}>();
const emit = defineEmits<{
(event: 'update:modelValue', value: boolean): void,
(event: 'fileDrop', value: Event): void,
}>();
const model = computed<boolean>({
get: () => props.modelValue,
set: value => emit('update:modelValue', value),
});
const model = defineModel<boolean>({ required: true });
</script>

<style scoped lang="scss">
Expand Down

0 comments on commit 386d614

Please sign in to comment.