Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_closed.vue')
-rw-r--r--app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_closed.vue43
1 files changed, 43 insertions, 0 deletions
diff --git a/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_closed.vue b/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_closed.vue
new file mode 100644
index 00000000000..85c42ca5485
--- /dev/null
+++ b/app/assets/javascripts/contribution_events/components/contribution_event/contribution_event_closed.vue
@@ -0,0 +1,43 @@
+<script>
+import {
+ EVENT_CLOSED_I18N,
+ TARGET_TYPE_MERGE_REQUEST,
+ EVENT_CLOSED_ICONS,
+} from 'ee_else_ce/contribution_events/constants';
+import { getValueByEventTarget } from '../../utils';
+import ContributionEventBase from './contribution_event_base.vue';
+
+export default {
+ name: 'ContributionEventClosed',
+ components: { ContributionEventBase },
+ props: {
+ event: {
+ type: Object,
+ required: true,
+ },
+ },
+ computed: {
+ targetType() {
+ return this.event.target.type;
+ },
+ message() {
+ return getValueByEventTarget(EVENT_CLOSED_I18N, this.event);
+ },
+ iconName() {
+ return getValueByEventTarget(EVENT_CLOSED_ICONS, this.event);
+ },
+ iconClass() {
+ return this.targetType === TARGET_TYPE_MERGE_REQUEST ? 'gl-text-red-500' : 'gl-text-blue-500';
+ },
+ },
+};
+</script>
+
+<template>
+ <contribution-event-base
+ :event="event"
+ :message="message"
+ :icon-name="iconName"
+ :icon-class="iconClass"
+ />
+</template>