debian-mirror-gitlab/app/assets/javascripts/issues/show/components/title.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.4 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2023-05-27 22:25:52 +05:30
import { GlTooltipDirective } from '@gitlab/ui';
2023-03-04 22:38:38 +05:30
import SafeHtml from '~/vue_shared/directives/safe_html';
2021-03-11 19:13:27 +05:30
import animateMixin from '../mixins/animate';
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
export default {
directives: {
2020-11-24 15:15:51 +05:30
GlTooltip: GlTooltipDirective,
SafeHtml,
2018-11-08 19:23:39 +05:30
},
mixins: [animateMixin],
props: {
issuableRef: {
type: [String, Number],
required: true,
2017-09-10 17:25:29 +05:30
},
2018-11-08 19:23:39 +05:30
canUpdate: {
required: false,
type: Boolean,
default: false,
2018-03-17 18:26:18 +05:30
},
2018-11-08 19:23:39 +05:30
titleHtml: {
type: String,
required: true,
2018-03-17 18:26:18 +05:30
},
2018-11-08 19:23:39 +05:30
titleText: {
type: String,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-11-08 19:23:39 +05:30
},
data() {
return {
preAnimation: false,
pulseAnimation: false,
titleEl: document.querySelector('title'),
};
},
watch: {
titleHtml() {
this.setPageTitle();
this.animateChange();
},
},
methods: {
setPageTitle() {
const currentPageTitleScope = this.titleEl.innerText.split('·');
currentPageTitleScope[0] = `${this.titleText} (${this.issuableRef}) `;
this.titleEl.textContent = currentPageTitleScope.join('·');
},
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
2018-03-17 18:26:18 +05:30
<div class="title-container">
2022-05-07 20:08:51 +05:30
<h1
2020-11-24 15:15:51 +05:30
v-safe-html="titleHtml"
2018-03-17 18:26:18 +05:30
:class="{
'issue-realtime-pre-pulse': preAnimation,
2019-02-15 15:39:39 +05:30
'issue-realtime-trigger-pulse': pulseAnimation,
2018-03-17 18:26:18 +05:30
}"
2022-08-13 15:12:31 +05:30
class="title gl-font-size-h-display"
data-qa-selector="title_content"
2023-05-27 22:25:52 +05:30
data-testid="issue-title"
2019-07-31 22:56:46 +05:30
dir="auto"
2022-05-07 20:08:51 +05:30
></h1>
2018-03-17 18:26:18 +05:30
</div>
2017-09-10 17:25:29 +05:30
</template>