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
2b7a1d1f
Commit
2b7a1d1f
authored
Dec 03, 2020
by
Jeremy Elder
Committed by
Kushal Pandya
Dec 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate bs-callout to GlAlert in …/unmet_prerequisites_block.vue
parent
397f75b8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
27 deletions
+39
-27
app/assets/javascripts/jobs/components/unmet_prerequisites_block.vue
...javascripts/jobs/components/unmet_prerequisites_block.vue
+15
-12
changelogs/unreleased/242028-migrate-bs-callout-to-glalert-in-app-assets-javascripts-jobs-compo.yml
...llout-to-glalert-in-app-assets-javascripts-jobs-compo.yml
+5
-0
spec/frontend/jobs/components/unmet_prerequisites_block_spec.js
...rontend/jobs/components/unmet_prerequisites_block_spec.js
+19
-15
No files found.
app/assets/javascripts/jobs/components/unmet_prerequisites_block.vue
View file @
2b7a1d1f
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
/**
* Renders Unmet Prerequisites block for job's view.
*/
export
default
{
i18n
:
{
failMessage
:
s__
(
'
Job|This job failed because the necessary resources were not successfully created.
'
,
),
moreInformation
:
__
(
'
More information
'
),
},
components
:
{
GlLink
,
GlAlert
,
},
props
:
{
helpPath
:
{
...
...
@@ -16,15 +24,10 @@ export default {
};
</
script
>
<
template
>
<div
class=
"bs-callout bs-callout-danger"
>
<p
class=
"js-failed-unmet-prerequisites gl-mb-0"
>
{{
s__
(
`Job|This job failed because the necessary resources were not successfully created.`
)
}}
<gl-link
:href=
"helpPath"
class=
"js-help-path"
>
<strong>
{{
__
(
'
More information
'
)
}}
</strong>
<gl-alert
variant=
"danger"
class=
"gl-mt-3"
:dismissible=
"false"
>
{{
$options
.
i18n
.
failMessage
}}
<gl-link
:href=
"helpPath"
>
{{
$options
.
i18n
.
moreInformation
}}
</gl-link>
</p>
</div>
</gl-alert>
</
template
>
changelogs/unreleased/242028-migrate-bs-callout-to-glalert-in-app-assets-javascripts-jobs-compo.yml
0 → 100644
View file @
2b7a1d1f
---
title
:
Migrate bs-callout to GlAlert in …/unmet_prerequisites_block.vue
merge_request
:
48398
author
:
type
:
other
spec/frontend/jobs/components/unmet_prerequisites_block_spec.js
View file @
2b7a1d1f
import
Vue
from
'
vue
'
;
import
component
from
'
~/jobs/components/unmet_prerequisites_block.vue
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlAlert
,
GlLink
}
from
'
@gitlab/ui
'
;
import
UnmetPrerequisitesBlock
from
'
~/jobs/components/unmet_prerequisites_block.vue
'
;
describe
(
'
Unmet Prerequisites Block Job component
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
vm
;
let
wrapper
;
const
helpPath
=
'
/user/project/clusters/index.html#troubleshooting-failed-deployment-jobs
'
;
beforeEach
(
()
=>
{
vm
=
mountComponent
(
Component
,
{
hasNoRunnersForProject
:
true
,
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
UnmetPrerequisitesBlock
,
{
propsData
:
{
helpPath
,
},
});
};
beforeEach
(()
=>
{
createComponent
();
});
afterEach
(()
=>
{
vm
.
$
destroy
();
wrapper
.
destroy
();
});
it
(
'
renders an alert with the correct message
'
,
()
=>
{
const
container
=
vm
.
$el
.
querySelector
(
'
.js-failed-unmet-prerequisites
'
);
const
container
=
wrapper
.
find
(
GlAlert
);
const
alertMessage
=
'
This job failed because the necessary resources were not successfully created.
'
;
expect
(
container
).
not
.
toBeNull
();
expect
(
container
.
innerHTML
).
toContain
(
alertMessage
);
expect
(
container
.
text
()
).
toContain
(
alertMessage
);
});
it
(
'
renders link to help page
'
,
()
=>
{
const
helpLink
=
vm
.
$el
.
querySelector
(
'
.js-help-path
'
);
const
helpLink
=
wrapper
.
find
(
GlLink
);
expect
(
helpLink
).
not
.
toBeNull
();
expect
(
helpLink
.
innerHTML
).
toContain
(
'
More information
'
);
expect
(
helpLink
.
getAttribute
(
'
href
'
)
).
toEqual
(
helpPath
);
expect
(
helpLink
.
text
()
).
toContain
(
'
More information
'
);
expect
(
helpLink
.
attributes
().
href
).
toEqual
(
helpPath
);
});
});
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