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

Override version of @babel/traverse #740

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/workflows/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ jobs:
working-directory: ./dashboard
- run: npm run lint
working-directory: ./dashboard
continue-on-error: true
- run: npm run coverage
working-directory: ./dashboard
1 change: 1 addition & 0 deletions dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
typed-router.d.ts
coverage/**
dist/**
node_modules/**
Expand Down
428 changes: 299 additions & 129 deletions dashboard/package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@
"vite": "^4.4.11",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.19"
},
"//": "prettier-plugin-sort-imports wants 7.17.3 (vulnerable).",
"overrides": {
"@babel/traverse": "7.23.2"
}
}
9 changes: 3 additions & 6 deletions dashboard/src/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ const layoutStore = useLayoutStore();
:class="!item.route ? 'active' : ''"
:aria-current="!item.route ? 'page' : undefined"
>
<router-link
:to="item.route"
v-if="item.route"
class="text-primary"
>{{ item.text }}</router-link
>
<router-link :to="item.route" v-if="item.route" class="text-primary">{{
item.text
}}</router-link>
<template v-else>{{ item.text }}</template>
</li>
</ol>
Expand Down
12 changes: 10 additions & 2 deletions dashboard/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ import RawIconUserSolid from "~icons/clarity/user-solid?raw&width=2em&height=2em
const router = useRouter();

const menuItems = [
{ route: router.resolve("/packages/"), icon: RawIconBundleLine, text: "Packages" },
{ route: router.resolve("/locations/"), icon: RawIconRackServerLine, text: "Locations" },
{
route: router.resolve("/packages/"),
icon: RawIconBundleLine,
text: "Packages",
},
{
route: router.resolve("/locations/"),
icon: RawIconRackServerLine,
text: "Locations",
},
];

const layoutStore = useLayoutStore();
Expand Down
2 changes: 0 additions & 2 deletions dashboard/src/components/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const { tabs } = defineProps<{
route: RouteLocationResolved;
}[];
}>();


</script>

<template>
Expand Down
10 changes: 8 additions & 2 deletions dashboard/src/pages/locations/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ const tabs = [
{
icon: RawIconDetailsLine,
text: "Summary",
route: router.resolve({ name: "/locations/[id]/", params: { id: route.params.id } }),
route: router.resolve({
name: "/locations/[id]/",
params: { id: route.params.id },
}),
},
{
icon: RawIconBundleLine,
text: "Packages",
route: router.resolve({ name: "/locations/[id]/packages", params: { id: route.params.id } }),
route: router.resolve({
name: "/locations/[id]/packages",
params: { id: route.params.id },
}),
},
];
</script>
Expand Down
5 changes: 4 additions & 1 deletion dashboard/src/pages/packages/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const tabs = [
{
icon: RawIconDetailsLine,
text: "Summary",
route: router.resolve({ name: "/packages/[id]/", params: { id: route.params.id } }),
route: router.resolve({
name: "/packages/[id]/",
params: { id: route.params.id },
}),
},
];
</script>
Expand Down
7 changes: 2 additions & 5 deletions dashboard/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ const router = createRouter({

router.beforeEach((to, _, next) => {
const layoutStore = useLayoutStore();
const publicRoutes: Array<string> = [
"/user/signin",
"/user/signin-callback",
];
const routeName = to.name?.toString() || '';
const publicRoutes: Array<string> = ["/user/signin", "/user/signin-callback"];
const routeName = to.name?.toString() || "";
if (!layoutStore.isUserValid && !publicRoutes.includes(routeName)) {
next({ name: "/user/signin" });
} else {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/stores/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const usePackageStore = defineStore("package", {
const layoutStore = useLayoutStore();

layoutStore.updateBreadcrumb([
{ route: router.resolve('/packages/'), text: "Packages" },
{ route: router.resolve("/packages/"), text: "Packages" },
{ text: this.current.name },
]);

Expand Down
4 changes: 1 addition & 3 deletions dashboard/test/components/Header.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
history: createWebHistory(),
routes: [
{ name: "/", path: "/", component: {} },
],
routes: [{ name: "/", path: "/", component: {} }],
});

describe("Header.vue", () => {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [
VueRouter({
routesFolder: "src/pages"
routesFolder: "src/pages",
}),
vue({}),
ReactivityTransform(),
Expand Down