Commit af42fa23 authored by Phil Hughes's avatar Phil Hughes

added external link icon

parent f59b9778
<script> <script>
import Icon from '../../../vue_shared/components/icon.vue';
import CiIcon from '../../../vue_shared/components/ci_icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue';
export default { export default {
components: { components: {
Icon,
CiIcon, CiIcon,
}, },
props: { props: {
...@@ -31,8 +33,13 @@ export default { ...@@ -31,8 +33,13 @@ export default {
<a <a
:href="job.path" :href="job.path"
target="_blank" target="_blank"
v-text="jobId" class="ide-external-link"
> >
{{ jobId }}
<icon
name="external-link"
:size="12"
/>
</a> </a>
</span> </span>
</div> </div>
......
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import LoadingIcon from '../../../vue_shared/components/loading_icon.vue'; import LoadingIcon from '../../../vue_shared/components/loading_icon.vue';
import Icon from '../../../vue_shared/components/icon.vue';
import CiIcon from '../../../vue_shared/components/ci_icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue';
import Tabs from '../../../vue_shared/components/tabs/tabs'; import Tabs from '../../../vue_shared/components/tabs/tabs';
import Tab from '../../../vue_shared/components/tabs/tab.vue'; import Tab from '../../../vue_shared/components/tabs/tab.vue';
...@@ -9,13 +10,14 @@ import JobsList from '../jobs/list.vue'; ...@@ -9,13 +10,14 @@ import JobsList from '../jobs/list.vue';
export default { export default {
components: { components: {
LoadingIcon, LoadingIcon,
Icon,
CiIcon, CiIcon,
Tabs, Tabs,
Tab, Tab,
JobsList, JobsList,
}, },
computed: { computed: {
...mapGetters('pipelines', ['jobsCount', 'failedJobsCount', 'failedStages']), ...mapGetters('pipelines', ['jobsCount', 'failedJobsCount', 'failedStages', 'pipelineFailed']),
...mapState('pipelines', ['isLoadingPipeline', 'latestPipeline', 'stages', 'isLoadingJobs']), ...mapState('pipelines', ['isLoadingPipeline', 'latestPipeline', 'stages', 'isLoadingJobs']),
}, },
created() { created() {
...@@ -49,13 +51,20 @@ export default { ...@@ -49,13 +51,20 @@ export default {
<a <a
:href="latestPipeline.path" :href="latestPipeline.path"
target="_blank" target="_blank"
class="ide-external-link"
> >
#{{ latestPipeline.id }} #{{ latestPipeline.id }}
<icon
name="external-link"
:size="12"
/>
</a> </a>
</span> </span>
</header> </header>
<tabs> <tabs>
<tab active> <tab
:active="!pipelineFailed"
>
<template slot="title"> <template slot="title">
Jobs Jobs
<span <span
...@@ -70,7 +79,9 @@ export default { ...@@ -70,7 +79,9 @@ export default {
:stages="stages" :stages="stages"
/> />
</tab> </tab>
<tab> <tab
:active="pipelineFailed"
>
<template slot="title"> <template slot="title">
Failed Jobs Failed Jobs
<span <span
......
export const hasLatestPipeline = state => !state.isLoadingPipeline && !!state.latestPipeline; export const hasLatestPipeline = state => !state.isLoadingPipeline && !!state.latestPipeline;
export const pipelineFailed = state =>
state.latestPipeline && state.latestPipeline.details.status.text === 'failed';
export const failedStages = state => export const failedStages = state =>
state.stages.filter(stage => stage.status.text === 'failed').map(stage => ({ state.stages.filter(stage => stage.status.text === 'failed').map(stage => ({
...stage, ...stage,
......
...@@ -1135,3 +1135,16 @@ ...@@ -1135,3 +1135,16 @@
white-space: nowrap; white-space: nowrap;
} }
} }
.ide-external-link {
svg {
display: none;
}
&:hover,
&:focus {
svg {
display: inline-block;
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment