Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3 Migration #2178

Merged
merged 88 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
341869e
Scaffold new vuetify 3 app w/ `yarn create vuetify`
mvandenburgh Jan 15, 2025
aa42a04
Move `index.html` to vue3 app
mvandenburgh Jan 15, 2025
ee4470f
Move license file to vue3 app
mvandenburgh Jan 15, 2025
038c305
Move README to vue3 app
mvandenburgh Jan 15, 2025
2496393
Move `public/` directory to vue3 app
mvandenburgh Jan 15, 2025
448114d
Move `assets` directory to vue3 app
mvandenburgh Jan 15, 2025
a577b34
Remove sample components
mvandenburgh Jan 15, 2025
0f562d5
Install `pinia` in vue3 app
mvandenburgh Jan 15, 2025
7545bf4
Move type definitions to vue3 app
mvandenburgh Jan 15, 2025
206731a
Move constants.ts to vue3 app
mvandenburgh Jan 15, 2025
4678c27
Move store to vue3 app
mvandenburgh Jan 15, 2025
bc67e8f
Move rest.ts to vue3 app
mvandenburgh Jan 15, 2025
b76afc3
Install dependencies
mvandenburgh Jan 15, 2025
0f860bc
Move `HomeView` components to vue3
mvandenburgh Jan 15, 2025
e03cf21
Update vue-router import
mvandenburgh Jan 15, 2025
8dd37e0
Move `DandisetSearchField` component to vue3
mvandenburgh Jan 15, 2025
3cd081b
Update vue-router import
mvandenburgh Jan 15, 2025
f94ed4c
Fix vite error
mvandenburgh Jan 15, 2025
520e56b
Move .env files to vue3 app
mvandenburgh Jan 15, 2025
b07a123
Update vuetify breakpoint for vuetify 3
mvandenburgh Jan 15, 2025
0bca8d1
Move DandiFooter component to vue3
mvandenburgh Jan 15, 2025
4811919
Move AppBar components to vue3
mvandenburgh Jan 15, 2025
04960b5
Move UserStatusBanner component to vue3
mvandenburgh Jan 15, 2025
b335684
Move CopyText component to vue3
mvandenburgh Jan 15, 2025
1a35326
Update vuetify breakpoint for vuetify 3
mvandenburgh Jan 15, 2025
c6d79e3
Fix vite import error
mvandenburgh Jan 15, 2025
9c06e1f
Move App.vue to vue3
mvandenburgh Jan 15, 2025
4373a09
Update error handler to work with Vue 3
mvandenburgh Jan 15, 2025
806e3bc
Polyfill node.js stdlib
mvandenburgh Jan 15, 2025
c6976cc
Remove `vue-cookie-law`
mvandenburgh Jan 15, 2025
990918d
Switch vue3 app to port 8085
mvandenburgh Jan 15, 2025
94c0309
Bring vuetify theme into vue3 app
mvandenburgh Jan 15, 2025
6699d00
Update components that were removed in Vuetify 3
mvandenburgh Jan 15, 2025
d040c1f
Temporarily remove router links
mvandenburgh Jan 15, 2025
4926372
Move PublicDandisetView, DandisetsPage to vue3
mvandenburgh Jan 15, 2025
39c77ee
Update vue-router import
mvandenburgh Jan 15, 2025
1e45a51
Move DandisetList to vue3
mvandenburgh Jan 15, 2025
922ebb0
Update vue-router import
mvandenburgh Jan 15, 2025
026563b
Fix vite import error
mvandenburgh Jan 15, 2025
375bc8a
Add public dandisets link back to AppBar
mvandenburgh Jan 15, 2025
636a24d
Move title.ts to vue3
mvandenburgh Jan 15, 2025
d98980d
Install `eslint-plugin-vuetify`
mvandenburgh Jan 15, 2025
9416d40
Run eslint-plugin-vuetify on DandisetsPage
mvandenburgh Jan 15, 2025
308d13c
Run eslint-plugin-vuetify on DandisetList
mvandenburgh Jan 15, 2025
5cf692e
Move DandisetLandingView components to vue3
mvandenburgh Jan 15, 2025
719105f
Disable meditor temporarily
mvandenburgh Jan 15, 2025
9e2b73c
Update vue-router imports
mvandenburgh Jan 15, 2025
3a83b84
Move DandisetOwnersDialog to vue3
mvandenburgh Jan 15, 2025
d6f0372
Install dependencies
mvandenburgh Jan 15, 2025
7716325
Move rest of DLP components to vue3
mvandenburgh Jan 15, 2025
38be931
Fix vite error
mvandenburgh Jan 15, 2025
ddf0102
Fix filesize imports
mvandenburgh Jan 15, 2025
07d5c97
Remove deprecated parameter from vue-router link
mvandenburgh Jan 15, 2025
fb8eb76
Update deprecated vuetify breakpoints
mvandenburgh Jan 15, 2025
451fff0
Move FileBrowser components to vue3
mvandenburgh Jan 15, 2025
6bafa0e
Update vue-router imports
mvandenburgh Jan 15, 2025
c7ea0a2
Update filesize import
mvandenburgh Jan 15, 2025
ebc3b3a
v-subheader => v-list-subheader
mvandenburgh Jan 15, 2025
f303473
Update v-skeleton-loader props for vuetify 3
mvandenburgh Jan 15, 2025
796200e
Move CreateDandisetView into vue3
mvandenburgh Jan 15, 2025
50405af
Update vue-router import
mvandenburgh Jan 15, 2025
b18c3f2
Run `eslint` vuetify plugin on AppBar components
mvandenburgh Jan 19, 2025
a0268d3
Update DandisetOwners slots for Vuetify 3 compatability
mvandenburgh Jan 19, 2025
83218b4
Run `eslint` vuetify plugin on `DandisetOwners`
mvandenburgh Feb 6, 2025
ec010c6
Update ShareDialog slots for Vuetify 3 compatability
mvandenburgh Jan 19, 2025
27c7cb7
Run `eslint` vuetify plugin on ExternalDandisetServicesDialog
mvandenburgh Jan 19, 2025
71adaf1
Run `eslint` vuetify plugin on ContactDialog
mvandenburgh Jan 19, 2025
391d229
Run `eslint` vuetify plugin on DandisetMain
mvandenburgh Jan 19, 2025
f5e65e3
Run `eslint-plugin-vuetify` on `DandisetPublish`
mvandenburgh Feb 6, 2025
4f6b2d7
Move MyDandisetsView component to vue3
mvandenburgh Jan 19, 2025
2909543
Move SearchDandisetsView component to vue3
mvandenburgh Jan 19, 2025
a6dbc65
Move SearchView + related components to vue3
mvandenburgh Jan 19, 2025
6037b2a
Convert `router` to vue3
mvandenburgh Jan 19, 2025
cf20e81
Update router object property
mvandenburgh Jan 28, 2025
9262275
Run `eslint-plugin-vuetify` on more components
mvandenburgh Jan 28, 2025
ba65bc1
Manually fix alignment issue w/ Size column in FileBrowser
mvandenburgh Jan 28, 2025
d281dd7
RF `DownloadDialog` to work with Vuetify 3 slots
mvandenburgh Feb 4, 2025
7a48161
RF `CiteAsDialog` to work with Vuetify 3 slots
mvandenburgh Feb 4, 2025
3884ee5
Run `eslint-plugin-vuetify` on `DandisetActions`
mvandenburgh Feb 6, 2025
47d4a84
Run `eslint-plugin-vuetify` on `DandisetLandingView`
mvandenburgh Feb 6, 2025
87ca012
Update `v-list-item` slots for Vuetify 3
mvandenburgh Feb 5, 2025
09d08ce
Move Netlify config to vue3/ directory
mvandenburgh Feb 6, 2025
4ecb357
Move `StarredDandisetsView` to vue3/
mvandenburgh Feb 6, 2025
c452b84
Move custom css rule to global SCSS rule
mvandenburgh Feb 6, 2025
bce4f76
Temporarily disable ShareNetwork component
mvandenburgh Jan 19, 2025
8cf21e4
Fix vuetify styles manually
mvandenburgh Feb 6, 2025
7ba2d42
Manually fix remaining eslint errors
mvandenburgh Feb 11, 2025
9451d07
Temporarily disable copy button
mvandenburgh Feb 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vue3/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> 1%
last 2 versions
not dead
not ie 11
6 changes: 6 additions & 0 deletions vue3/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions vue3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.DS_Store
node_modules
/dist
.vite
components.d.ts
typed-router.d.ts

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions vue3/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="vite/client" />
/// <reference types="unplugin-vue-router/client" />
38 changes: 38 additions & 0 deletions vue3/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* .eslint.js
*
* ESLint configuration file.
*/

import pluginVue from 'eslint-plugin-vue'
import pluginVuetify from 'eslint-plugin-vuetify'
import vueTsEslintConfig from '@vue/eslint-config-typescript'

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
},

...pluginVue.configs['flat/recommended'],
...pluginVuetify.configs['flat/recommended'],
...vueTsEslintConfig(),

{
rules: {
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTernary: true,
},
],
'vue/multi-word-component-names': 'off',
}
}
]
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions vue3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "dandi-archive",
"private": true,
"type": "module",
"engines": {
"node": "20.x"
},
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --fix"
},
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^11.7.3",
"@mdi/font": "7.4.47",
"@resonant/oauth-client": "^0.9.2",
"axios": "^1.7.9",
"core-js": "^3.37.1",
"dompurify": "^3.2.3",
"filesize": "^10.1.6",
"marked": "^15.0.6",
"moment": "^2.30.1",
"pinia": "^2.3.0",
"roboto-fontface": "*",
"vue": "^3.4.31",
"vuetify": "^3.6.14"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"@tsconfig/node22": "^22.0.0",
"@types/node": "^22.9.0",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-typescript": "^14.1.3",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.14.0",
"eslint-plugin-vue": "^9.30.0",
"eslint-plugin-vuetify": "^2.5.1",
"npm-run-all2": "^7.0.1",
"sass": "1.77.8",
"sass-embedded": "^1.77.8",
"typescript": "~5.6.3",
"unplugin-fonts": "^1.1.1",
"unplugin-vue-components": "^0.27.2",
"unplugin-vue-router": "^0.10.0",
"vite": "^5.4.10",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-vuetify": "^2.0.3",
"vue-router": "^4.4.0",
"vue-tsc": "^2.1.10"
}
}
File renamed without changes.
File renamed without changes.
14 changes: 6 additions & 8 deletions web/src/App.vue → vue3/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@
{{ SERVER_DOWNTIME_MESSAGE }}
</v-main>
<v-snackbar
:value="showError"
:model-value="showError"
:timeout="-1"
top
right
location="top right"
color="error"
>
<span>
Sorry, something went wrong on our side (the developers have been notified).
Please try that operation again later.
</span>
<template #action="{ attrs }">
<template #actions>
<v-btn
color="white"
text
v-bind="attrs"
variant="text"
@click="showError = false"
>
Close
Expand All @@ -42,7 +40,7 @@
</template>

<script setup lang="ts">
import Vue, { onMounted, ref } from 'vue';
import { getCurrentInstance, onMounted, ref } from 'vue';

import { dandiRest } from '@/rest';
import { useDandisetStore } from '@/stores/dandiset';
Expand All @@ -59,7 +57,7 @@ const connectedToServer = ref(true);

// Catch any unhandled errors and display a snackbar prompt notifying the user.
const showError = ref(false);
Vue.config.errorHandler = (err: Error) => {
getCurrentInstance().appContext.config.errorHandler = (err: Error) => {
showError.value = true;
throw err;
};
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
<v-list-item-action class="mr-2">
<!-- ".stop" prevents closing the parent v-menu when this is clicked -->
<v-btn
icon
variant="text"
@click.stop="refreshApiKey"
>
<v-icon>mdi-reload</v-icon>
</v-btn>
</v-list-item-action>
<v-list-item-content>

<CopyText
:text="apiKey"
label="API Key"
icon-hover-text="Copy API key to clipboard"
/>
</v-list-item-content>
</v-list-item-action>
</v-list-item>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,72 +1,61 @@
<template>
<v-app-bar app>
<v-app-bar>
<v-menu
v-if="$vuetify.breakpoint.mobile"
open-on-hover
offset-y
close-delay="300"
v-if="isMobile"
:close-delay="300"
location="bottom"
>
<template #activator="{on}">
<v-app-bar-nav-icon v-on="on" />
<template #activator="{ props }">
<v-app-bar-nav-icon v-bind="props" />
</template>
<v-list>
<v-list-item-group>
<template v-for="navItem in navItems">
<v-list-item
v-if="!navItem.if || navItem.if()"
:key="navItem.text"
:to="navItem.external ? undefined : {name: navItem.to}"
:href="navItem.external ? navItem.to : undefined"
:target="navItem.external ? '_blank' : undefined"
:rel="navItem.external ? 'noopener' : undefined"
exact
text
>
<v-list-item-content
v-if="!navItem.external"
text
class="text-md"
>
<template v-for="navItem in navItems">
<v-list-item
v-if="!navItem.if || navItem.if()"
:key="navItem.text"
:to="navItem.external ? undefined : {name: navItem.to}"
:href="navItem.external ? navItem.to : undefined"
:target="navItem.external ? '_blank' : undefined"
:rel="navItem.external ? 'noopener' : undefined"
exact
text
>
<template v-if="!navItem.external">
<v-list-item-title class="text-md">
{{ navItem.text }}
</v-list-item-content>
<v-list-item-content
v-if="navItem.external"
:href="navItem.to"
target="_blank"
rel="noopener"
text
>
</v-list-item-title>
</template>
<template v-if="navItem.external">
<v-list-item-title class="text-md">
{{ navItem.text }}
</v-list-item-content>
</v-list-item-title>
<v-icon
v-if="navItem.external"
class="ml-1"
small
size="small"
>
mdi-open-in-new
</v-icon>
</v-list-item>
</template>
</v-list-item-group>
</template>
</v-list-item>
</template>
</v-list>
</v-menu>
<router-link to="/">
<v-img
alt="DANDI logo"
contain
width="100px"
:width="100"
:src="logo"
class="mr-3"
/>
</router-link>
<v-toolbar-items v-if="!$vuetify.breakpoint.mobile">
<v-toolbar-items v-if="!isMobile">
<template v-for="navItem in navItems">
<v-btn
v-if="!navItem.external && (!navItem.if || navItem.if())"
:key="navItem.text"
:to="{name: navItem.to}"
exact
text
variant="text"
>
{{ navItem.text }}
</v-btn>
Expand All @@ -76,12 +65,12 @@
:href="navItem.to"
target="_blank"
rel="noopener"
text
variant="text"
>
{{ navItem.text }}
<v-icon
class="ml-1"
small
size="small"
>
mdi-open-in-new
</v-icon>
Expand All @@ -96,27 +85,28 @@
<v-btn
:disabled="!user?.approved"
:to="{ name: 'createDandiset' }"
exact
class="mx-3"
color="primary"
rounded
variant="elevated"
rounded="pill"
>
New Dandiset
</v-btn>
<UserMenu />
</template>
<template v-else>
<v-tooltip
bottom
location="bottom"
:disabled="cookiesEnabled"
>
<template #activator="{ on }">
<div v-on="on">
<template #activator="{ props }">
<div v-bind="props">
<v-btn
id="login"
class="mx-1"
color="primary"
rounded
variant="elevated"
rounded="pill"
:disabled="!cookiesEnabled"
@click="login"
>
Expand All @@ -133,6 +123,7 @@

<script setup lang="ts">
import { computed } from 'vue';
import { useDisplay } from 'vuetify';

import {
cookiesEnabled as cookiesEnabledFunc,
Expand All @@ -154,6 +145,9 @@ interface NavigationItem {
external: boolean,
}

const display = useDisplay();
const isMobile = computed(() => display.mobile.value);

const cookiesEnabled = computed(cookiesEnabledFunc);
const loggedIn = computed(loggedInFunc);
const insideIFrame = computed(insideIFrameFunc);
Expand Down
Loading
Loading