Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
76ba8ce0
Commit
76ba8ce0
authored
Jun 18, 2019
by
Martin Wortschack
Committed by
Fatih Acet
Jun 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use lastStepIndex in percentageCompleted
- Update getter and specs
parent
f66d6061
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
27 deletions
+25
-27
ee/app/assets/javascripts/onboarding/onboarding_helper/store/getters.js
...javascripts/onboarding/onboarding_helper/store/getters.js
+5
-5
ee/app/assets/javascripts/onboarding/tour_parts.js
ee/app/assets/javascripts/onboarding/tour_parts.js
+18
-18
ee/spec/javascripts/onboarding/onboarding_helper/store/getters_spec.js
...cripts/onboarding/onboarding_helper/store/getters_spec.js
+2
-4
No files found.
ee/app/assets/javascripts/onboarding/onboarding_helper/store/getters.js
View file @
76ba8ce0
...
...
@@ -41,15 +41,15 @@ export const totalTourPartSteps = state => {
return
0
;
};
export
const
percentageCompleted
=
(
state
,
getters
)
=>
{
const
{
tourData
,
tourKey
}
=
state
;
export
const
percentageCompleted
=
state
=>
{
const
{
tourData
,
tourKey
,
lastStepIndex
}
=
state
;
if
(
getters
.
stepIndex
===
null
||
!
tourData
||
!
tourData
[
tourKey
])
{
if
(
lastStepIndex
===
-
1
||
!
tourData
||
!
tourData
[
tourKey
])
{
return
0
;
}
return
tourData
[
tourKey
][
getters
.
s
tepIndex
]
?
tourData
[
tourKey
][
getters
.
s
tepIndex
].
percentageCompleted
return
tourData
[
tourKey
][
lastS
tepIndex
]
?
tourData
[
tourKey
][
lastS
tepIndex
].
percentageCompleted
:
0
;
};
...
...
ee/app/assets/javascripts/onboarding/tour_parts.js
View file @
76ba8ce0
...
...
@@ -34,7 +34,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
8
,
percentageCompleted
:
0
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/tree/master$`
,
''
),
...
...
@@ -68,7 +68,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
16
,
percentageCompleted
:
8
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/commits/master$`
,
''
),
...
...
@@ -84,7 +84,7 @@ const GUIDED_GITLAB_TOUR = [
selector
:
'
.js-onboarding-commit-item
'
,
text
:
s__
(
'
UserOnboardingTour|Click to open the latest commit to see its details.
'
),
},
percentageCompleted
:
24
,
percentageCompleted
:
16
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/commit/[a-z0-9]+$`
,
''
),
...
...
@@ -115,7 +115,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
32
,
percentageCompleted
:
24
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/-/branches$`
,
''
),
...
...
@@ -149,7 +149,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
40
,
percentageCompleted
:
32
,
},
{
forUrl
:
({
projectFullPath
})
=>
...
...
@@ -175,7 +175,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
4
8
,
percentageCompleted
:
4
0
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/issues$`
,
''
),
...
...
@@ -204,7 +204,7 @@ const GUIDED_GITLAB_TOUR = [
},
],
actionPopover
:
null
,
percentageCompleted
:
56
,
percentageCompleted
:
48
,
},
{
forUrl
:
({
projectFullPath
})
=>
...
...
@@ -226,7 +226,7 @@ const GUIDED_GITLAB_TOUR = [
selector
:
'
.js-onboarding-issue-item
'
,
text
:
s__
(
'
UserOnboardingTour|Open one of the issues by clicking on its title.
'
),
},
percentageCompleted
:
64
,
percentageCompleted
:
56
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/issues/[0-9]+$`
,
''
),
...
...
@@ -259,7 +259,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
72
,
percentageCompleted
:
64
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/merge_requests$`
,
''
),
...
...
@@ -277,7 +277,7 @@ const GUIDED_GITLAB_TOUR = [
"
UserOnboardingTour|Let's take a closer look at a merge request. Click on the title of one.
"
,
),
},
percentageCompleted
:
80
,
percentageCompleted
:
72
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/merge_requests/[0-9]+$`
,
''
),
...
...
@@ -308,7 +308,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
8
8
,
percentageCompleted
:
8
0
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/pipelines$`
,
''
),
...
...
@@ -342,7 +342,7 @@ const GUIDED_GITLAB_TOUR = [
false
,
),
},
percentageCompleted
:
96
,
percentageCompleted
:
88
,
},
{
forUrl
:
({
projectFullPath
})
=>
new
RegExp
(
`
${
projectFullPath
}
/pipelines/[0-9]+$`
,
''
),
...
...
@@ -392,7 +392,7 @@ const GUIDED_GITLAB_TOUR = [
},
],
actionPopover
:
null
,
percentageCompleted
:
100
,
percentageCompleted
:
96
,
},
];
...
...
@@ -428,7 +428,7 @@ const CREATE_PROJECT_TOUR = [
},
],
actionPopover
:
null
,
percentageCompleted
:
50
,
percentageCompleted
:
33
,
},
{
forUrl
:
({
createdProjectPath
})
=>
new
RegExp
(
`
${
createdProjectPath
}
$`
,
''
),
...
...
@@ -458,7 +458,7 @@ const CREATE_PROJECT_TOUR = [
},
],
actionPopover
:
null
,
percentageCompleted
:
100
,
percentageCompleted
:
66
,
},
];
...
...
@@ -479,7 +479,7 @@ const INVITE_COLLEAGUES_TOUR = [
false
,
),
},
percentageCompleted
:
33
,
percentageCompleted
:
0
,
},
{
forUrl
:
({
createdProjectPath
})
=>
new
RegExp
(
`
${
createdProjectPath
}
/edit$`
,
''
),
...
...
@@ -495,7 +495,7 @@ const INVITE_COLLEAGUES_TOUR = [
false
,
),
},
percentageCompleted
:
66
,
percentageCompleted
:
33
,
},
{
forUrl
:
({
createdProjectPath
})
=>
new
RegExp
(
`
${
createdProjectPath
}
/-/project_members$`
,
''
),
...
...
@@ -522,7 +522,7 @@ const INVITE_COLLEAGUES_TOUR = [
},
],
actionPopover
:
null
,
percentageCompleted
:
100
,
percentageCompleted
:
66
,
},
];
...
...
ee/spec/javascripts/onboarding/onboarding_helper/store/getters_spec.js
View file @
76ba8ce0
...
...
@@ -161,11 +161,9 @@ describe('User onboarding store getters', () => {
describe
(
'
percentageCompleted
'
,
()
=>
{
it
(
'
returns the percentage completed for the current step
'
,
()
=>
{
const
localGetters
=
{
stepIndex
:
1
,
};
localState
.
lastStepIndex
=
1
;
expect
(
getters
.
percentageCompleted
(
localState
,
localGetters
)).
toBe
(
20
);
expect
(
getters
.
percentageCompleted
(
localState
)).
toBe
(
20
);
});
it
(
'
returns the 0 if there is no step index
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment