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
7fbe0910
Commit
7fbe0910
authored
Dec 11, 2019
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add vue components for checkout and progress bar
This is part of the paid signup flow MR
parent
2b3844aa
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
180 additions
and
0 deletions
+180
-0
ee/app/assets/javascripts/pages/subscriptions/new/index.js
ee/app/assets/javascripts/pages/subscriptions/new/index.js
+3
-0
ee/app/assets/javascripts/subscriptions/new/components/checkout.vue
...ets/javascripts/subscriptions/new/components/checkout.vue
+20
-0
ee/app/assets/javascripts/subscriptions/new/components/checkout/progress_bar.vue
...ts/subscriptions/new/components/checkout/progress_bar.vue
+35
-0
ee/app/assets/javascripts/subscriptions/new/index.js
ee/app/assets/javascripts/subscriptions/new/index.js
+14
-0
ee/app/assets/stylesheets/pages/subscriptions.scss
ee/app/assets/stylesheets/pages/subscriptions.scss
+50
-0
ee/spec/frontend/subscriptions/new/components/checkout/progress_bar_spec.js
...ubscriptions/new/components/checkout/progress_bar_spec.js
+46
-0
locale/gitlab.pot
locale/gitlab.pot
+12
-0
No files found.
ee/app/assets/javascripts/pages/subscriptions/new/index.js
0 → 100644
View file @
7fbe0910
import
mountSubscriptionsApplication
from
'
ee/subscriptions/new
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
mountSubscriptionsApplication
());
ee/app/assets/javascripts/subscriptions/new/components/checkout.vue
0 → 100644
View file @
7fbe0910
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
ProgressBar
from
'
./checkout/progress_bar.vue
'
;
export
default
{
components
:
{
ProgressBar
},
i18n
:
{
checkout
:
s__
(
'
Checkout|Checkout
'
),
},
};
</
script
>
<
template
>
<div
class=
"checkout d-flex flex-column justify-content-between w-100"
>
<div
class=
"full-width"
>
<progress-bar
:step=
"2"
/>
<div
class=
"flash-container"
></div>
<h2
class=
"header-title"
>
{{
$options
.
i18n
.
checkout
}}
</h2>
</div>
</div>
</
template
>
ee/app/assets/javascripts/subscriptions/new/components/checkout/progress_bar.vue
0 → 100644
View file @
7fbe0910
<
script
>
import
{
s__
}
from
'
~/locale
'
;
export
default
{
props
:
{
step
:
{
type
:
Number
,
required
:
true
,
},
},
methods
:
{
classObject
(
stepNumber
)
{
return
{
phase
:
true
,
bold
:
true
,
center
:
true
,
finished
:
this
.
step
>
stepNumber
,
current
:
this
.
step
===
stepNumber
,
};
},
},
i18n
:
{
yourProfile
:
s__
(
'
Checkout|1. Your profile
'
),
checkout
:
s__
(
'
Checkout|2. Checkout
'
),
yourGroup
:
s__
(
'
Checkout|3. Your GitLab group
'
),
},
};
</
script
>
<
template
>
<div
class=
"bar d-flex"
>
<div
v-for=
"(value, name, index) in $options.i18n"
:key=
"name"
:class=
"classObject(index + 1)"
>
{{
value
}}
</div>
</div>
</
template
>
ee/app/assets/javascripts/subscriptions/new/index.js
0 → 100644
View file @
7fbe0910
import
Vue
from
'
vue
'
;
import
Checkout
from
'
./components/checkout.vue
'
;
export
default
()
=>
{
const
checkoutEl
=
document
.
getElementById
(
'
checkout
'
);
return
new
Vue
({
el
:
checkoutEl
,
components
:
{
Checkout
},
render
(
createElement
)
{
return
createElement
(
'
checkout
'
,
{});
},
});
};
ee/app/assets/stylesheets/pages/subscriptions.scss
View file @
7fbe0910
...
@@ -29,4 +29,54 @@
...
@@ -29,4 +29,54 @@
padding-right
:
$gl-padding
*
3
;
padding-right
:
$gl-padding
*
3
;
}
}
}
}
.checkout
{
align-items
:
center
;
flex-grow
:
1
;
margin-top
:
$gl-padding
;
max-width
:
454px
;
@media
(
min-width
:
map-get
(
$grid-breakpoints
,
lg
))
{
justify-content
:
inherit
!
important
;
margin-top
:
36px
;
max-width
:
none
;
}
.full-width
{
max-width
:
541px
;
width
:
100%
;
}
}
.bar
{
@media
(
min-width
:
map-get
(
$grid-breakpoints
,
lg
))
{
width
:
400px
;
}
.phase
{
border-bottom
:
5px
solid
$gray-200
;
color
:
$gray-700
;
flex-basis
:
100%
;
font-size
:
$gl-font-size-12
;
line-height
:
$gl-line-height
;
padding-bottom
:
$gl-padding-8
;
&
.current
,
&
.finished
{
border-bottom-color
:
$blue-400
;
}
&
.current
{
color
:
$gray-900
;
}
}
}
.header-title
{
margin
:
24px
0
16px
;
@media
(
min-width
:
map-get
(
$grid-breakpoints
,
lg
))
{
margin-bottom
:
32px
;
}
}
}
}
ee/spec/frontend/subscriptions/new/components/checkout/progress_bar_spec.js
0 → 100644
View file @
7fbe0910
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
component
from
'
ee/subscriptions/new/components/checkout/progress_bar.vue
'
;
describe
(
'
Progress Bar
'
,
()
=>
{
const
localVue
=
createLocalVue
();
let
wrapper
;
const
factory
=
propsData
=>
{
wrapper
=
shallowMount
(
localVue
.
extend
(
component
),
{
propsData
,
localVue
,
sync
:
false
,
});
};
const
firstStep
=
()
=>
wrapper
.
find
(
'
.bar div:nth-child(1)
'
);
const
secondStep
=
()
=>
wrapper
.
find
(
'
.bar div:nth-child(2)
'
);
beforeEach
(()
=>
{
factory
({
step
:
2
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
describe
(
'
current
'
,
()
=>
{
it
(
'
step 1 is not current
'
,
()
=>
{
expect
(
firstStep
().
classes
()).
not
.
toContain
(
'
current
'
);
});
it
(
'
step 2 is current
'
,
()
=>
{
expect
(
secondStep
().
classes
()).
toContain
(
'
current
'
);
});
});
describe
(
'
finished
'
,
()
=>
{
it
(
'
step 1 is finished
'
,
()
=>
{
expect
(
firstStep
().
classes
()).
toContain
(
'
finished
'
);
});
it
(
'
step 2 is not finished
'
,
()
=>
{
expect
(
secondStep
().
classes
()).
not
.
toContain
(
'
finished
'
);
});
});
});
locale/gitlab.pot
View file @
7fbe0910
...
@@ -3226,6 +3226,18 @@ msgstr ""
...
@@ -3226,6 +3226,18 @@ msgstr ""
msgid "Checkout"
msgid "Checkout"
msgstr ""
msgstr ""
msgid "Checkout|1. Your profile"
msgstr ""
msgid "Checkout|2. Checkout"
msgstr ""
msgid "Checkout|3. Your GitLab group"
msgstr ""
msgid "Checkout|Checkout"
msgstr ""
msgid "Cherry-pick this commit"
msgid "Cherry-pick this commit"
msgstr ""
msgstr ""
...
...
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