Refactor into .vue files
This commit is contained in:
parent
9c59667fc4
commit
d4021122c5
|
@ -3,9 +3,9 @@ import '../../lib/utils/text_utility';
|
|||
import ActionsComponent from './environment_actions';
|
||||
import ExternalUrlComponent from './environment_external_url.vue';
|
||||
import StopComponent from './environment_stop.vue';
|
||||
import RollbackComponent from './environment_rollback';
|
||||
import RollbackComponent from './environment_rollback.vue';
|
||||
import TerminalButtonComponent from './environment_terminal_button.vue';
|
||||
import MonitoringButtonComponent from './environment_monitoring';
|
||||
import MonitoringButtonComponent from './environment_monitoring.vue';
|
||||
import CommitComponent from '../../vue_shared/components/commit';
|
||||
import eventHub from '../event_hub';
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/**
|
||||
* Renders the Monitoring (Metrics) link in environments table.
|
||||
*/
|
||||
export default {
|
||||
props: {
|
||||
monitoringUrl: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
title() {
|
||||
return 'Monitoring';
|
||||
},
|
||||
},
|
||||
|
||||
template: `
|
||||
<a
|
||||
class="btn monitoring-url has-tooltip"
|
||||
data-container="body"
|
||||
:href="monitoringUrl"
|
||||
rel="noopener noreferrer nofollow"
|
||||
:title="title"
|
||||
:aria-label="title">
|
||||
<i class="fa fa-area-chart" aria-hidden="true"></i>
|
||||
</a>
|
||||
`,
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
<script>
|
||||
/**
|
||||
* Renders the Monitoring (Metrics) link in environments table.
|
||||
*/
|
||||
export default {
|
||||
props: {
|
||||
monitoringUrl: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
title() {
|
||||
return 'Monitoring';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<a
|
||||
class="btn monitoring-url has-tooltip"
|
||||
data-container="body"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer nofollow"
|
||||
:href="monitoringUrl"
|
||||
:title="title"
|
||||
:aria-label="title">
|
||||
<i
|
||||
class="fa fa-area-chart"
|
||||
aria-hidden="true" />
|
||||
</a>
|
||||
</template>
|
|
@ -1,3 +1,4 @@
|
|||
<script>
|
||||
/* global Flash */
|
||||
/* eslint-disable no-new */
|
||||
/**
|
||||
|
@ -49,21 +50,25 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
|
||||
template: `
|
||||
<button type="button"
|
||||
class="btn"
|
||||
@click="onClick"
|
||||
:disabled="isLoading">
|
||||
|
||||
<span v-if="isLastDeployment">
|
||||
Re-deploy
|
||||
</span>
|
||||
<span v-else>
|
||||
Rollback
|
||||
</span>
|
||||
|
||||
<i v-if="isLoading" class="fa fa-spinner fa-spin" aria-hidden="true"></i>
|
||||
</button>
|
||||
`,
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<button
|
||||
type="button"
|
||||
class="btn"
|
||||
@click="onClick"
|
||||
:disabled="isLoading">
|
||||
|
||||
<span v-if="isLastDeployment">
|
||||
Re-deploy
|
||||
</span>
|
||||
<span v-else>
|
||||
Rollback
|
||||
</span>
|
||||
|
||||
<i
|
||||
v-if="isLoading"
|
||||
class="fa fa-spinner fa-spin"
|
||||
aria-hidden="true" />
|
||||
</button>
|
||||
</template>
|
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
import monitoringComp from '~/environments/components/environment_monitoring';
|
||||
import monitoringComp from '~/environments/components/environment_monitoring.vue';
|
||||
|
||||
describe('Monitoring Component', () => {
|
||||
let MonitoringComponent;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
import rollbackComp from '~/environments/components/environment_rollback';
|
||||
import rollbackComp from '~/environments/components/environment_rollback.vue';
|
||||
|
||||
describe('Rollback Component', () => {
|
||||
const retryURL = 'https://gitlab.com/retry';
|
||||
|
|
Loading…
Reference in New Issue