gitlab-org--gitlab-foss/app/assets/javascripts/vue_shared/components/issue/issue_warning.vue

59 lines
1.3 KiB
Vue
Raw Normal View History

2017-09-14 11:01:07 +00:00
<script>
2018-10-10 07:06:25 +00:00
import icon from '../../../vue_shared/components/icon.vue';
2018-10-10 07:06:25 +00:00
export default {
components: {
icon,
},
props: {
isLocked: {
type: Boolean,
default: false,
required: false,
2018-01-05 00:18:35 +00:00
},
2018-10-10 07:06:25 +00:00
isConfidential: {
type: Boolean,
default: false,
required: false,
2017-09-14 11:01:07 +00:00
},
2018-10-10 07:06:25 +00:00
},
computed: {
warningIcon() {
if (this.isConfidential) return 'eye-slash';
if (this.isLocked) return 'lock';
2018-10-10 07:06:25 +00:00
return '';
2017-09-14 11:01:07 +00:00
},
2018-10-10 07:06:25 +00:00
isLockedAndConfidential() {
return this.isConfidential && this.isLocked;
},
},
};
2017-09-14 11:01:07 +00:00
</script>
<template>
<div class="issuable-note-warning">
<icon
2018-06-11 09:49:47 +00:00
v-if="!isLockedAndConfidential"
2018-01-05 00:18:35 +00:00
:name="warningIcon"
:size="16"
class="icon inline"
/>
2017-09-14 11:01:07 +00:00
<span v-if="isLockedAndConfidential">
{{ __('This issue is confidential and locked.') }}
2018-01-08 20:01:49 +00:00
{{ __(`People without permission will never
get a notification and won't be able to comment.`) }}
2017-09-14 11:01:07 +00:00
</span>
<span v-else-if="isConfidential">
{{ __('This is a confidential issue.') }}
{{ __('Your comment will not be visible to the public.') }}
</span>
<span v-else-if="isLocked">
{{ __('This issue is locked.') }}
{{ __('Only project members can comment.') }}
</span>
</div>
</template>