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
766b9b8e
Commit
766b9b8e
authored
May 12, 2021
by
Vitaly Slobodin
Committed by
Nicolò Maria Mezzopera
May 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CC validation on the pipeline details page [RUN ALL RSPEC] [RUN AS-IF-FOSS]
parent
40348e8f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
1 deletion
+62
-1
app/views/projects/pipelines/show.html.haml
app/views/projects/pipelines/show.html.haml
+4
-0
ee/app/assets/javascripts/billings/components/cc_validation_required_alert.vue
...ipts/billings/components/cc_validation_required_alert.vue
+1
-0
ee/app/assets/javascripts/credit_card_validation_required_alert.js
...sets/javascripts/credit_card_validation_required_alert.js
+17
-0
ee/app/assets/javascripts/pages/projects/pipelines/show/index.js
...assets/javascripts/pages/projects/pipelines/show/index.js
+2
-0
ee/spec/features/projects/pipelines/pipeline_spec.rb
ee/spec/features/projects/pipelines/pipeline_spec.rb
+38
-1
No files found.
app/views/projects/pipelines/show.html.haml
View file @
766b9b8e
...
@@ -11,6 +11,10 @@
...
@@ -11,6 +11,10 @@
.js-pipeline-container
{
data:
{
controller_action:
"#{controller.action_name}"
}
}
.js-pipeline-container
{
data:
{
controller_action:
"#{controller.action_name}"
}
}
#js-pipeline-header-vue
.pipeline-header-container
{
data:
{
full_path:
@project
.
full_path
,
pipeline_iid:
@pipeline
.
iid
,
pipeline_id:
@pipeline
.
id
,
pipelines_path:
project_pipelines_path
(
@project
)
}
}
#js-pipeline-header-vue
.pipeline-header-container
{
data:
{
full_path:
@project
.
full_path
,
pipeline_iid:
@pipeline
.
iid
,
pipeline_id:
@pipeline
.
id
,
pipelines_path:
project_pipelines_path
(
@project
)
}
}
-
if
@pipeline
.
failed?
&&
@pipeline
.
user_not_verified?
#js-cc-validation-required-alert
-
if
@pipeline
.
commit
.
present?
-
if
@pipeline
.
commit
.
present?
=
render
"projects/pipelines/info"
,
commit:
@pipeline
.
commit
=
render
"projects/pipelines/info"
,
commit:
@pipeline
.
commit
...
...
ee/app/assets/javascripts/billings/components/cc_validation_required_alert.vue
View file @
766b9b8e
...
@@ -44,6 +44,7 @@ export default {
...
@@ -44,6 +44,7 @@ export default {
:dismissible=
"false"
:dismissible=
"false"
:title=
"$options.i18n.alertTitle"
:title=
"$options.i18n.alertTitle"
:primary-button-text=
"$options.i18n.primaryButtonText"
:primary-button-text=
"$options.i18n.primaryButtonText"
data-testid=
"creditCardValidationRequiredAlert"
@
primaryAction=
"showModal"
@
primaryAction=
"showModal"
>
>
<gl-sprintf
:message=
"$options.i18n.alertText"
>
<gl-sprintf
:message=
"$options.i18n.alertText"
>
...
...
ee/app/assets/javascripts/credit_card_validation_required_alert.js
0 → 100644
View file @
766b9b8e
import
Vue
from
'
vue
'
;
import
CreditCardValidationRequiredAlert
from
'
ee/billings/components/cc_validation_required_alert.vue
'
;
export
default
(
containerId
=
'
js-cc-validation-required-alert
'
)
=>
{
const
el
=
document
.
getElementById
(
containerId
);
if
(
!
el
)
{
return
false
;
}
return
new
Vue
({
el
,
render
(
createElement
)
{
return
createElement
(
CreditCardValidationRequiredAlert
);
},
});
};
ee/app/assets/javascripts/pages/projects/pipelines/show/index.js
View file @
766b9b8e
import
initCCValidationRequiredAlert
from
'
ee/credit_card_validation_required_alert
'
;
import
initPipelineSecurityDashboard
from
'
ee/security_dashboard/pipeline_init
'
;
import
initPipelineSecurityDashboard
from
'
ee/security_dashboard/pipeline_init
'
;
import
initPipelines
from
'
~/pages/projects/pipelines/init_pipelines
'
;
import
initPipelines
from
'
~/pages/projects/pipelines/init_pipelines
'
;
import
initPipelineDetails
from
'
~/pipelines/pipeline_details_bundle
'
;
import
initPipelineDetails
from
'
~/pipelines/pipeline_details_bundle
'
;
...
@@ -9,3 +10,4 @@ initPipelineDetails();
...
@@ -9,3 +10,4 @@ initPipelineDetails();
initPipelineSecurityDashboard
();
initPipelineSecurityDashboard
();
initLicenseReport
();
initLicenseReport
();
initCodequalityReport
();
initCodequalityReport
();
initCCValidationRequiredAlert
();
ee/spec/features/projects/pipelines/pipeline_spec.rb
View file @
766b9b8e
...
@@ -4,7 +4,8 @@ require 'spec_helper'
...
@@ -4,7 +4,8 @@ require 'spec_helper'
RSpec
.
describe
'Pipeline'
,
:js
do
RSpec
.
describe
'Pipeline'
,
:js
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
,
namespace:
namespace
)
}
before
do
before
do
stub_feature_flags
(
graphql_pipeline_details_users:
false
)
stub_feature_flags
(
graphql_pipeline_details_users:
false
)
...
@@ -146,6 +147,42 @@ RSpec.describe 'Pipeline', :js do
...
@@ -146,6 +147,42 @@ RSpec.describe 'Pipeline', :js do
end
end
end
end
end
end
context
'when :ci_require_credit_card_on_free_plan flag is on'
do
before
do
allow
(
::
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
create
(
:gitlab_subscription
,
namespace:
namespace
,
hosted_plan:
create
(
:free_plan
))
stub_feature_flags
(
ci_require_credit_card_on_free_plan:
true
)
end
context
'on free plan'
do
it
'does not show an alert to verify an account with a credit card'
do
subject
expect
(
page
).
not_to
have_selector
(
'[data-testid="creditCardValidationRequiredAlert"]'
)
end
context
'when failed'
do
let!
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
'master'
,
status:
'failed'
,
failure_reason:
'user_not_verified'
,
sha:
project
.
commit
.
id
)
end
it
'shows an alert to verify an account with a credit card'
do
subject
expect
(
page
).
to
have_selector
(
'[data-testid="creditCardValidationRequiredAlert"]'
)
end
end
end
end
end
end
describe
'GET /:project/-/pipelines/:id/security'
do
describe
'GET /:project/-/pipelines/:id/security'
do
...
...
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