File tree Expand file tree Collapse file tree 5 files changed +11
-44
lines changed Expand file tree Collapse file tree 5 files changed +11
-44
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { RouteName } from '@/types/routeType'
11
11
import { type RouteLocationAsRelativeGeneric } from ' vue-router'
12
12
interface Props {
13
13
links? : DsfrBreadcrumbProps [' links' ]
14
- resultHash? : string
15
14
}
16
15
const props = defineProps <Props >()
17
16
const navigationStore = useNavigationStore ()
@@ -41,7 +40,6 @@ const getBaseRouteName = () => {
41
40
42
41
const routeToBaseList: RouteLocationAsRelativeGeneric = {
43
42
name: getBaseRouteName (),
44
- hash: props .resultHash ,
45
43
query: isCatalogDetail ? undefined : navigationStore .query
46
44
}
47
45
Original file line number Diff line number Diff line change 1
1
<template >
2
- <TeeDsfrBreadcrumb
3
- :links =" links"
4
- :result-hash =" `#${programId}`"
5
- />
2
+ <TeeDsfrBreadcrumb :links =" links" />
6
3
<TeeEligibilityCriteriaBar
7
4
v-if =" !isCatalogDetail"
8
5
:bg-color =" Color.greenLightnessed"
9
6
:bg-bar-color =" Color.greenLighted"
10
- :previous-route =" getRouteToPreviousPage()"
11
7
message =" Cette aide correspond à vos critères d’éligibilité"
12
8
message-icon =" fr-icon-checkbox-circle-fill"
13
9
/>
@@ -80,16 +76,8 @@ const links = computed<DsfrBreadcrumbProps['links']>(() => {
80
76
return [... links , { text: props .program ?.titre || ' ' }]
81
77
})
82
78
83
- const getRouteToPreviousPage = () => {
84
- if (navigationStore .isByRouteName (RouteName .ProgramFromProjectDetail )) {
85
- return routeToProject
86
- }
87
-
88
- return routeToResults
89
- }
90
-
91
- const goToPrograms = async () => {
92
- await router .push (getRouteToPreviousPage ())
79
+ const goToPrograms = () => {
80
+ router .back ()
93
81
}
94
82
onBeforeMount (() => {
95
83
project .value = projectStore .currentProject
Original file line number Diff line number Diff line change 7
7
<div class =" fr-container fr-grid-row fr-grid-row--center fr-grid-row--middle fr-py-md-1w" >
8
8
<div class =" fr-col-md-2 fr-col-lg-2 fr-col-xl-2 fr-col-hidden fr-col-unhidden-md" >
9
9
<div class =" fr-col-12" >
10
- <TeeButtonLink
11
- :to = " previousRoute "
10
+ <TeeDsfrButton
11
+ :label = " `Retour` "
12
12
icon =" fr-icon-arrow-left-line"
13
+ class =" fr-btn fr-btn--tertiary-no-outline fr-btn-bg"
13
14
size =" lg"
15
+ @click =" router.back()"
14
16
>
15
- Retour
16
- </TeeButtonLink >
17
+ </TeeDsfrButton >
17
18
</div >
18
19
</div >
19
20
<div class =" fr-px-md-2v fr-my-auto fr-col-hidden fr-col-unhidden-md fr-col-md-10 fr-col-lg-10 fr-col-xl-10 fr-px-0 fr-text-left" >
@@ -44,12 +45,10 @@ import { useNavigationStore } from '@/stores/navigation'
44
45
import { Color , RouteName } from ' @/types'
45
46
import StickyWithOffset from ' @/utils/stickyWithOffset'
46
47
import TrackStructure from ' @/utils/track/trackStructure'
47
- import type { RouteLocationRaw } from ' vue-router'
48
48
49
49
interface Props {
50
50
bgColor? : Color
51
51
bgBarColor? : Color
52
- previousRoute: RouteLocationRaw
53
52
message? : string
54
53
messageIcon? : string
55
54
}
@@ -58,6 +57,7 @@ const props = defineProps<Props>()
58
57
const eligibilityCriteria = ref <HTMLElement >()
59
58
const stickyWithOffset = ref <StickyWithOffset | null >(null )
60
59
const criteria = TrackStructure .getEligibilityCriteria ()
60
+ const router = useRouter ()
61
61
62
62
function isProgramDetailPage() {
63
63
return useNavigationStore ().isByRouteName ([RouteName .CatalogProgramDetail , RouteName .QuestionnaireResultDetail ])
Original file line number Diff line number Diff line change 1
1
<template >
2
- <TeeDsfrBreadcrumb
3
- :links =" links"
4
- :result-hash =" `#${project.slug}`"
5
- />
2
+ <TeeDsfrBreadcrumb :links =" links" />
6
3
<TeeEligibilityCriteriaBar
7
4
:bg-color =" Color.blueLightnessed"
8
5
:bg-bar-color =" Color.blueLighted"
9
- :previous-route =" routeToProjects"
10
6
/>
11
7
<div class =" fr-mb-4v background-project-title" >
12
8
<img
29
25
</template >
30
26
<script setup lang="ts">
31
27
import { Color , Project } from ' @/types'
32
- import { RouteName } from ' @/types/routeType'
33
- import { useNavigationStore } from ' @/stores/navigation'
34
28
import type { DsfrBreadcrumbProps } from ' @gouvminint/vue-dsfr'
35
29
36
30
interface Props {
37
31
project: Project
38
32
themeColor? : Color
39
33
}
40
34
const props = defineProps <Props >()
41
- const navigationStore = useNavigationStore ()
42
35
43
- const routeToProjects = {
44
- name: RouteName .QuestionnaireResult ,
45
- hash: ' #' + props .project .slug ,
46
- query: navigationStore .query
47
- }
48
36
const links = ref <DsfrBreadcrumbProps [' links' ]>([{ text: props .project .title }])
49
37
</script >
50
38
Original file line number Diff line number Diff line change @@ -8,14 +8,7 @@ export const router = createRouter({
8
8
history : createWebHistory ( process . env . BASE_URL ) ,
9
9
scrollBehavior ( to : RouteLocationNormalized , from : RouteLocationNormalizedLoaded , savedPosition ) {
10
10
if ( savedPosition ) {
11
- return savedPosition
12
- }
13
- if ( to . hash ) {
14
- return new Promise ( ( resolve ) => {
15
- setTimeout ( ( ) => {
16
- resolve ( { el : to . hash , behavior : 'instant' } )
17
- } , 0 )
18
- } )
11
+ return Promise . resolve ( savedPosition )
19
12
}
20
13
return { top : 0 }
21
14
} ,
You can’t perform that action at this time.
0 commit comments