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
3d22b044
Commit
3d22b044
authored
May 06, 2021
by
Alper Akgun
Committed by
Gabriel Mazetto
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix continuous onboarding A SVG paths
parent
187b2665
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
69 additions
and
19 deletions
+69
-19
app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_a.vue
...pages/projects/learn_gitlab/components/learn_gitlab_a.vue
+14
-3
app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_card.vue
...cts/learn_gitlab/components/learn_gitlab_section_card.vue
+5
-7
app/assets/javascripts/pages/projects/learn_gitlab/index/index.js
...ts/javascripts/pages/projects/learn_gitlab/index/index.js
+4
-1
app/helpers/learn_gitlab_helper.rb
app/helpers/learn_gitlab_helper.rb
+14
-0
app/views/projects/learn_gitlab/index.html.haml
app/views/projects/learn_gitlab/index.html.haml
+1
-1
spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
...tlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
+3
-3
spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_section_card_spec.js.snap
...ents/__snapshots__/learn_gitlab_section_card_spec.js.snap
+1
-1
spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_a_spec.js
...s/projects/learn_gitlab/components/learn_gitlab_a_spec.js
+2
-2
spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_card_spec.js
...learn_gitlab/components/learn_gitlab_section_card_spec.js
+2
-1
spec/frontend/pages/projects/learn_gitlab/components/mock_data.js
...ntend/pages/projects/learn_gitlab/components/mock_data.js
+12
-0
spec/helpers/learn_gitlab_helper_spec.rb
spec/helpers/learn_gitlab_helper_spec.rb
+11
-0
No files found.
app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_a.vue
View file @
3d22b044
...
...
@@ -18,9 +18,13 @@ export default {
required
:
true
,
type
:
Object
,
},
sections
:
{
required
:
true
,
type
:
Object
,
},
},
maxValue
:
Object
.
keys
(
ACTION_LABELS
).
length
,
s
ections
:
Object
.
keys
(
ACTION_SECTIONS
),
actionS
ections
:
Object
.
keys
(
ACTION_SECTIONS
),
computed
:
{
progressValue
()
{
return
Object
.
values
(
this
.
actions
).
filter
((
a
)
=>
a
.
completed
).
length
;
...
...
@@ -38,6 +42,9 @@ export default {
);
return
actions
;
},
svgFor
(
section
)
{
return
this
.
sections
[
section
].
svg
;
},
},
};
</
script
>
...
...
@@ -59,8 +66,12 @@ export default {
<gl-progress-bar
:value=
"progressValue"
:max=
"$options.maxValue"
/>
</div>
<div
class=
"row row-cols-1 row-cols-md-3 gl-mt-5"
>
<div
v-for=
"section in $options.sections"
:key=
"section"
class=
"col gl-mb-6"
>
<learn-gitlab-section-card
:section=
"section"
:actions=
"actionsFor(section)"
/>
<div
v-for=
"section in $options.actionSections"
:key=
"section"
class=
"col gl-mb-6"
>
<learn-gitlab-section-card
:section=
"section"
:svg=
"svgFor(section)"
:actions=
"actionsFor(section)"
/>
</div>
</div>
</div>
...
...
app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_card.vue
View file @
3d22b044
<
script
>
import
{
GlCard
}
from
'
@gitlab/ui
'
;
import
{
imagePath
}
from
'
~/lib/utils/common_utils
'
;
import
{
ACTION_LABELS
,
ACTION_SECTIONS
}
from
'
../constants
'
;
import
LearnGitlabSectionLink
from
'
./learn_gitlab_section_link.vue
'
;
...
...
@@ -16,6 +15,10 @@ export default {
required
:
true
,
type
:
String
,
},
svg
:
{
required
:
true
,
type
:
String
,
},
actions
:
{
required
:
true
,
type
:
Object
,
...
...
@@ -28,17 +31,12 @@ export default {
);
},
},
methods
:
{
svg
(
section
)
{
return
imagePath
(
`learn_gitlab/section_
${
section
}
.svg`
);
},
},
};
</
script
>
<
template
>
<gl-card
class=
"gl-pt-0 learn-gitlab-section-card"
>
<div
class=
"learn-gitlab-section-card-header"
>
<img
:src=
"svg
(section)
"
/>
<img
:src=
"svg"
/>
<h2
class=
"gl-font-lg gl-mb-3"
>
{{
$options
.
i18n
[
section
].
title
}}
</h2>
<p
class=
"gl-text-gray-700 gl-mb-6"
>
{{
$options
.
i18n
[
section
].
description
}}
</p>
</div>
...
...
app/assets/javascripts/pages/projects/learn_gitlab/index/index.js
View file @
3d22b044
...
...
@@ -12,6 +12,7 @@ function initLearnGitlab() {
}
const
actions
=
convertObjectPropsToCamelCase
(
JSON
.
parse
(
el
.
dataset
.
actions
));
const
sections
=
convertObjectPropsToCamelCase
(
JSON
.
parse
(
el
.
dataset
.
sections
));
const
{
learnGitlabA
}
=
gon
.
experiments
;
...
...
@@ -20,7 +21,9 @@ function initLearnGitlab() {
return
new
Vue
({
el
,
render
(
createElement
)
{
return
createElement
(
learnGitlabA
?
LearnGitlabA
:
LearnGitlabB
,
{
props
:
{
actions
}
});
return
createElement
(
learnGitlabA
?
LearnGitlabA
:
LearnGitlabB
,
{
props
:
{
actions
,
sections
},
});
},
});
}
...
...
app/helpers/learn_gitlab_helper.rb
View file @
3d22b044
...
...
@@ -36,6 +36,20 @@ module LearnGitlabHelper
Gitlab
::
Experimentation
.
in_experiment_group?
(
:learn_gitlab_b
,
subject:
current_user
)
end
def
onboarding_sections_data
{
workspace:
{
svg:
image_path
(
"learn_gitlab/section_workspace.svg"
)
},
plan:
{
svg:
image_path
(
"learn_gitlab/section_plan.svg"
)
},
deploy:
{
svg:
image_path
(
"learn_gitlab/section_deploy.svg"
)
}
}
end
private
def
action_urls
...
...
app/views/projects/learn_gitlab/index.html.haml
View file @
3d22b044
...
...
@@ -2,4 +2,4 @@
-
page_title
_
(
"Learn GitLab"
)
-
add_page_specific_style
'page_bundles/learn_gitlab'
#js-learn-gitlab-app
{
data:
{
actions:
onboarding_actions_data
(
@project
).
to_json
}
}
#js-learn-gitlab-app
{
data:
{
actions:
onboarding_actions_data
(
@project
).
to_json
,
sections:
onboarding_sections_data
.
to_json
}
}
spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_a_spec.js.snap
View file @
3d22b044
...
...
@@ -68,7 +68,7 @@ exports[`Learn GitLab Design A renders correctly 1`] = `
class="learn-gitlab-section-card-header"
>
<img
src="
/assets/learn_gitlab/section_
workspace.svg"
src="workspace.svg"
/>
<h2
...
...
@@ -246,7 +246,7 @@ exports[`Learn GitLab Design A renders correctly 1`] = `
class="learn-gitlab-section-card-header"
>
<img
src="
/assets/learn_gitlab/section_
plan.svg"
src="plan.svg"
/>
<h2
...
...
@@ -324,7 +324,7 @@ exports[`Learn GitLab Design A renders correctly 1`] = `
class="learn-gitlab-section-card-header"
>
<img
src="
/assets/learn_gitlab/section_
deploy.svg"
src="deploy.svg"
/>
<h2
...
...
spec/frontend/pages/projects/learn_gitlab/components/__snapshots__/learn_gitlab_section_card_spec.js.snap
View file @
3d22b044
...
...
@@ -11,7 +11,7 @@ exports[`Learn GitLab Section Card renders correctly 1`] = `
class="learn-gitlab-section-card-header"
>
<img
src="
/assets/learn_gitlab/section_
workspace.svg"
src="workspace.svg"
/>
<h2
...
...
spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_a_spec.js
View file @
3d22b044
import
{
GlProgressBar
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
LearnGitlabA
from
'
~/pages/projects/learn_gitlab/components/learn_gitlab_a.vue
'
;
import
{
testActions
}
from
'
./mock_data
'
;
import
{
testActions
,
testSections
}
from
'
./mock_data
'
;
describe
(
'
Learn GitLab Design A
'
,
()
=>
{
let
wrapper
;
const
createWrapper
=
()
=>
{
wrapper
=
mount
(
LearnGitlabA
,
{
propsData
:
{
actions
:
testActions
}
});
wrapper
=
mount
(
LearnGitlabA
,
{
propsData
:
{
actions
:
testActions
,
sections
:
testSections
}
});
};
beforeEach
(()
=>
{
...
...
spec/frontend/pages/projects/learn_gitlab/components/learn_gitlab_section_card_spec.js
View file @
3d22b044
...
...
@@ -3,6 +3,7 @@ import LearnGitlabSectionCard from '~/pages/projects/learn_gitlab/components/lea
import
{
testActions
}
from
'
./mock_data
'
;
const
defaultSection
=
'
workspace
'
;
const
testImage
=
'
workspace.svg
'
;
describe
(
'
Learn GitLab Section Card
'
,
()
=>
{
let
wrapper
;
...
...
@@ -14,7 +15,7 @@ describe('Learn GitLab Section Card', () => {
const
createWrapper
=
()
=>
{
wrapper
=
shallowMount
(
LearnGitlabSectionCard
,
{
propsData
:
{
section
:
defaultSection
,
actions
:
testActions
},
propsData
:
{
section
:
defaultSection
,
actions
:
testActions
,
svg
:
testImage
},
});
};
...
...
spec/frontend/pages/projects/learn_gitlab/components/mock_data.js
View file @
3d22b044
...
...
@@ -45,3 +45,15 @@ export const testActions = {
svg
:
'
http://example.com/images/illustration.svg
'
,
},
};
export
const
testSections
=
{
workspace
:
{
svg
:
'
workspace.svg
'
,
},
deploy
:
{
svg
:
'
deploy.svg
'
,
},
plan
:
{
svg
:
'
plan.svg
'
,
},
};
spec/helpers/learn_gitlab_helper_spec.rb
View file @
3d22b044
...
...
@@ -96,6 +96,17 @@ RSpec.describe LearnGitlabHelper do
end
end
describe
'.onboarding_sections_data'
do
subject
(
:sections
)
{
helper
.
onboarding_sections_data
}
it
'has the right keys'
do
expect
(
sections
.
keys
).
to
contain_exactly
(
:deploy
,
:plan
,
:workspace
)
end
it
'has the svg'
do
expect
(
sections
.
values
.
map
{
|
section
|
section
.
keys
}).
to
eq
([[
:svg
]]
*
3
)
end
end
describe
'.learn_gitlab_experiment_tracking_category'
do
using
RSpec
::
Parameterized
::
TableSyntax
...
...
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