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
>
<
script
>
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
/**
/**
* Renders Unmet Prerequisites block for job's view.
* Renders Unmet Prerequisites block for job's view.
*/
*/
export
default
{
export
default
{
i18n
:
{
failMessage
:
s__
(
'
Job|This job failed because the necessary resources were not successfully created.
'
,
),
moreInformation
:
__
(
'
More information
'
),
},
components
:
{
components
:
{
GlLink
,
GlLink
,
GlAlert
,
},
},
props
:
{
props
:
{
helpPath
:
{
helpPath
:
{
...
@@ -16,15 +24,10 @@ export default {
...
@@ -16,15 +24,10 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"bs-callout bs-callout-danger"
>
<gl-alert
variant=
"danger"
class=
"gl-mt-3"
:dismissible=
"false"
>
<p
class=
"js-failed-unmet-prerequisites gl-mb-0"
>
{{
$options
.
i18n
.
failMessage
}}
{{
<gl-link
:href=
"helpPath"
>
s__
(
`Job|This job failed because the necessary resources were not successfully created.`
)
{{
$options
.
i18n
.
moreInformation
}}
}}
<gl-link
:href=
"helpPath"
class=
"js-help-path"
>
<strong>
{{
__
(
'
More information
'
)
}}
</strong>
</gl-link>
</gl-link>
</p>
</gl-alert>
</div>
</
template
>
</
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
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
component
from
'
~/jobs/components/unmet_prerequisites_block.vue
'
;
import
{
GlAlert
,
GlLink
}
from
'
@gitlab/ui
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
import
UnmetPrerequisitesBlock
from
'
~/jobs/components/unmet_prerequisites_block.vue
'
;
describe
(
'
Unmet Prerequisites Block Job component
'
,
()
=>
{
describe
(
'
Unmet Prerequisites Block Job component
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
component
);
let
wrapper
;
let
vm
;
const
helpPath
=
'
/user/project/clusters/index.html#troubleshooting-failed-deployment-jobs
'
;
const
helpPath
=
'
/user/project/clusters/index.html#troubleshooting-failed-deployment-jobs
'
;
beforeEach
(
()
=>
{
const
createComponent
=
()
=>
{
vm
=
mountComponent
(
Component
,
{
wrapper
=
shallowMount
(
UnmetPrerequisitesBlock
,
{
hasNoRunnersForProject
:
true
,
propsData
:
{
helpPath
,
helpPath
,
},
});
});
};
beforeEach
(()
=>
{
createComponent
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
vm
.
$
destroy
();
wrapper
.
destroy
();
});
});
it
(
'
renders an alert with the correct message
'
,
()
=>
{
it
(
'
renders an alert with the correct message
'
,
()
=>
{
const
container
=
vm
.
$el
.
querySelector
(
'
.js-failed-unmet-prerequisites
'
);
const
container
=
wrapper
.
find
(
GlAlert
);
const
alertMessage
=
const
alertMessage
=
'
This job failed because the necessary resources were not successfully created.
'
;
'
This job failed because the necessary resources were not successfully created.
'
;
expect
(
container
).
not
.
toBeNull
();
expect
(
container
).
not
.
toBeNull
();
expect
(
container
.
innerHTML
).
toContain
(
alertMessage
);
expect
(
container
.
text
()
).
toContain
(
alertMessage
);
});
});
it
(
'
renders link to help page
'
,
()
=>
{
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
).
not
.
toBeNull
();
expect
(
helpLink
.
innerHTML
).
toContain
(
'
More information
'
);
expect
(
helpLink
.
text
()
).
toContain
(
'
More information
'
);
expect
(
helpLink
.
getAttribute
(
'
href
'
)
).
toEqual
(
helpPath
);
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