Skip to content

Commit

Permalink
#2490: fixes to remove navigation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-may committed May 8, 2024
1 parent f079263 commit 8084747
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dashboard-prime/src/router/SkillsDisplayChildRoutes.js
Expand Up @@ -91,7 +91,7 @@ const createSkillsDisplayChildRoutes = (appendToName) => {
title: `Badge ${skillPlaceholder} Details`,
},
}, {
path: '/badges/:badgeId/crossProject/:crossProjectId/:dependentSkillId',
path: 'badges/:badgeId/crossProject/:crossProjectId/:dependentSkillId',
component: SkillPage,
name: `crossProjectSkillDetailsUnderBadge${appendToName}`,
meta: {
Expand Down
5 changes: 5 additions & 0 deletions dashboard-prime/src/router/SkillsDisplayPathAppendValues.js
@@ -0,0 +1,5 @@
export default {
Local: 'Local',
SkillsClient: 'SkillsClient',
LocalTest: 'LocalTest'
};
30 changes: 24 additions & 6 deletions dashboard-prime/src/router/index.js
Expand Up @@ -46,9 +46,9 @@ import BadgeSkills from '@/components/badges/BadgeSkills.vue'
import ErrorPage from '@/components/utils/errors/ErrorPage.vue'
import createSkillsClientRoutes from '@/router/SkillsDisplaySkillsClientRoutes.js'
import createSkillsDisplayChildRoutes from '@/router/SkillsDisplayChildRoutes.js'
import { useSkillsDisplayInfo } from '@/skills-display/UseSkillsDisplayInfo.js'
import TestSkillsClient from '@/skills-display/components/test/TestSkillsClient.vue'
import TestSkillsDisplay from '@/skills-display/components/test/TestSkillsDisplay.vue'
import PathAppendValues from '@/router/SkillsDisplayPathAppendValues.js'

const routes = [
{
Expand Down Expand Up @@ -537,11 +537,19 @@ routes.push(createAdminRoutes())
routes.push(createQuizRoutes())
// skills display routes support local components and skills-client apps

// const skillsDisplayChildRoutes = createSkillsDisplayChildRoutes()
const skillsDisplayInfo = useSkillsDisplayInfo()
routes.push(createProgressAndRankingRoutes(createSkillsDisplayChildRoutes(skillsDisplayInfo.localContextAppend)))
routes.push(createSkillsClientRoutes(createSkillsDisplayChildRoutes(skillsDisplayInfo.skillsClientContextAppend)))
routes.push(createProgressAndRankingRoutes(createSkillsDisplayChildRoutes(PathAppendValues.Local)))
routes.push(createSkillsClientRoutes(createSkillsDisplayChildRoutes(PathAppendValues.SkillsClient)))


routes.push({
path: '/test-skills-client',
component: ErrorPage,
name: 'TestSkillsClientHomeNoPage',
meta: {
requiresAuth: true,
nonAdmin: true,
},
})
routes.push({
path: '/test-skills-client/:projectId',
component: TestSkillsClient,
Expand All @@ -551,6 +559,16 @@ routes.push({
nonAdmin: true,
},
})

routes.push({
path: '/test-skills-display',
component: ErrorPage,
name: 'TestSkillsDisplayHomeNoPage',
meta: {
requiresAuth: true,
nonAdmin: true,
},
})
routes.push({
path: '/test-skills-display/:projectId',
component: TestSkillsDisplay,
Expand All @@ -559,7 +577,7 @@ routes.push({
requiresAuth: true,
nonAdmin: true,
},
children: createSkillsDisplayChildRoutes(skillsDisplayInfo.localTestContextAppend)
children: createSkillsDisplayChildRoutes(PathAppendValues.LocalTest)
})

const router = createRouter({
Expand Down
7 changes: 4 additions & 3 deletions dashboard-prime/src/skills-display/UseSkillsDisplayInfo.js
@@ -1,16 +1,17 @@
import { useRoute, useRouter } from 'vue-router'
import { computed } from 'vue'
import SkillsDisplayPathAppendValues from '@/router/SkillsDisplayPathAppendValues.js'

export const useSkillsDisplayInfo = () => {
const route = useRoute()
const router = useRouter()
const skillsClientContextAppend = 'SkillsClient'
const localContextAppend = 'Local'
const skillsClientContextAppend = SkillsDisplayPathAppendValues.SkillsClient
const localContextAppend = SkillsDisplayPathAppendValues.Local
const progressAndRankingsRegex = /\/progress-and-rankings\/projects\/[^/]*/i
const localTestRegex = /\/test-skills-display\/[^/]*/i
const clientDisplayRegex = /\/static\/clientPortal\/index\.html/i
const regexes = [progressAndRankingsRegex, localTestRegex, clientDisplayRegex]
const localTestContextAppend = 'LocalTest'
const localTestContextAppend = SkillsDisplayPathAppendValues.LocalTest

const isSkillsClientPath = () => {
return route.path.startsWith('/static/clientPortal/')
Expand Down
Expand Up @@ -10,6 +10,7 @@ import UserPrerequisitesProgress from '@/skills-display/components/skill/prerequ
import PrerequisitesTable from '@/skills-display/components/skill/prerequisites/PrerequisitesTable.vue'
import { useNavToSkillUtil } from '@/skills-display/components/skill/prerequisites/UseNavToSkillUtil.js'
const props = defineProps({
dependencies: Array
})
Expand Down Expand Up @@ -129,7 +130,6 @@ const createGraph = () => {
const data = buildData()
const container = document.getElementById('dependent-skills-network')
console.log(data)
network.value = new Network(container, data, displayOptions)
network.value.on('click', (params) => {
const skillItem = locateSelectedSkill(params)
Expand Down

0 comments on commit 8084747

Please sign in to comment.