2018-03-17 18:26:18 +05:30
|
|
|
<script>
|
2020-11-24 15:15:51 +05:30
|
|
|
import { GlLink, GlIcon } from '@gitlab/ui';
|
2019-09-04 21:01:54 +05:30
|
|
|
import { __, sprintf } from '~/locale';
|
|
|
|
import issuableStateMixin from '../mixins/issuable_state';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
2020-11-24 15:15:51 +05:30
|
|
|
GlIcon,
|
2019-09-04 21:01:54 +05:30
|
|
|
GlLink,
|
|
|
|
},
|
2022-01-26 12:08:38 +05:30
|
|
|
mixins: [issuableStateMixin],
|
|
|
|
props: {
|
|
|
|
issuableType: {
|
|
|
|
required: true,
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
},
|
2019-09-04 21:01:54 +05:30
|
|
|
computed: {
|
2022-01-26 12:08:38 +05:30
|
|
|
issuableDisplayName() {
|
|
|
|
return this.issuableType.replace(/_/g, ' ');
|
|
|
|
},
|
2020-01-01 13:55:28 +05:30
|
|
|
projectArchivedWarning() {
|
|
|
|
return __('This project is archived and cannot be commented on.');
|
|
|
|
},
|
2019-09-04 21:01:54 +05:30
|
|
|
lockedIssueWarning() {
|
|
|
|
return sprintf(
|
|
|
|
__('This %{issuableDisplayName} is locked. Only project members can comment.'),
|
|
|
|
{ issuableDisplayName: this.issuableDisplayName },
|
|
|
|
);
|
|
|
|
},
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
};
|
2018-03-17 18:26:18 +05:30
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-05-27 22:25:52 +05:30
|
|
|
<div class="disabled-comments gl-mt-3">
|
|
|
|
<span
|
|
|
|
class="issuable-note-warning gl-display-inline-block gl-w-full gl-px-5 gl-py-4 gl-rounded-base"
|
|
|
|
>
|
2020-11-24 15:15:51 +05:30
|
|
|
<gl-icon :size="16" name="lock" class="icon" />
|
2020-01-01 13:55:28 +05:30
|
|
|
<span v-if="isProjectArchived">
|
|
|
|
{{ projectArchivedWarning }}
|
|
|
|
<gl-link :href="archivedProjectDocsPath" target="_blank" class="learn-more">
|
|
|
|
{{ __('Learn more') }}
|
|
|
|
</gl-link>
|
|
|
|
</span>
|
2019-09-04 21:01:54 +05:30
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
<span v-else>
|
|
|
|
{{ lockedIssueWarning }}
|
2019-09-04 21:01:54 +05:30
|
|
|
<gl-link :href="lockedIssueDocsPath" target="_blank" class="learn-more">
|
|
|
|
{{ __('Learn more') }}
|
|
|
|
</gl-link>
|
2018-03-17 18:26:18 +05:30
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</template>
|