2017-08-17 22:00:37 +05:30
|
|
|
<script>
|
2017-09-10 17:25:29 +05:30
|
|
|
import tooltip from '../../../vue_shared/directives/tooltip';
|
2018-03-17 18:26:18 +05:30
|
|
|
import icon from '../../../vue_shared/components/icon.vue';
|
|
|
|
import { dasherize } from '../../../lib/utils/text_utility';
|
2017-08-17 22:00:37 +05:30
|
|
|
/**
|
|
|
|
* Renders either a cancel, retry or play icon pointing to the given path.
|
|
|
|
* TODO: Remove UJS from here and use an async request instead.
|
|
|
|
*/
|
|
|
|
export default {
|
2018-03-17 18:26:18 +05:30
|
|
|
components: {
|
|
|
|
icon,
|
|
|
|
},
|
|
|
|
|
|
|
|
directives: {
|
|
|
|
tooltip,
|
|
|
|
},
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
props: {
|
|
|
|
tooltipText: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
link: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
actionMethod: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
actionIcon: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
cssClass() {
|
2018-03-17 18:26:18 +05:30
|
|
|
const actionIconDash = dasherize(this.actionIcon);
|
|
|
|
return `${actionIconDash} js-icon-${actionIconDash}`;
|
2017-08-17 22:00:37 +05:30
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<a
|
2017-09-10 17:25:29 +05:30
|
|
|
v-tooltip
|
2017-08-17 22:00:37 +05:30
|
|
|
:data-method="actionMethod"
|
|
|
|
:title="tooltipText"
|
|
|
|
:href="link"
|
2018-03-17 18:26:18 +05:30
|
|
|
class="ci-action-icon-container ci-action-icon-wrapper"
|
|
|
|
:class="cssClass"
|
|
|
|
data-container="body"
|
|
|
|
>
|
|
|
|
<icon :name="actionIcon" />
|
2017-08-17 22:00:37 +05:30
|
|
|
</a>
|
|
|
|
</template>
|