2020-07-30 12:09:33 +00:00
|
|
|
<script>
|
|
|
|
import { GlLink, GlSprintf } from '@gitlab/ui';
|
|
|
|
import { s__ } from '~/locale';
|
|
|
|
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
|
2020-09-04 15:08:46 +00:00
|
|
|
import HistoryItem from '~/vue_shared/components/registry/history_item.vue';
|
2020-07-30 12:09:33 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PackageHistory',
|
|
|
|
i18n: {
|
|
|
|
createdOn: s__('PackageRegistry|%{name} version %{version} was created %{datetime}'),
|
|
|
|
updatedAtText: s__('PackageRegistry|%{name} version %{version} was updated %{datetime}'),
|
|
|
|
commitText: s__('PackageRegistry|Commit %{link} on branch %{branch}'),
|
|
|
|
pipelineText: s__('PackageRegistry|Pipeline %{link} triggered %{datetime} by %{author}'),
|
|
|
|
publishText: s__('PackageRegistry|Published to the %{project} Package Registry %{datetime}'),
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
GlLink,
|
|
|
|
GlSprintf,
|
2020-09-04 15:08:46 +00:00
|
|
|
HistoryItem,
|
2020-07-30 12:09:33 +00:00
|
|
|
TimeAgoTooltip,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
packageEntity: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
projectName: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showDescription: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
packagePipeline() {
|
|
|
|
return this.packageEntity.pipeline?.id ? this.packageEntity.pipeline : null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="issuable-discussion">
|
2020-08-12 18:31:49 +00:00
|
|
|
<h3 class="gl-font-lg" data-testid="title">{{ __('History') }}</h3>
|
2020-08-05 12:09:45 +00:00
|
|
|
<ul class="timeline main-notes-list notes gl-mb-4" data-testid="timeline">
|
2020-09-04 15:08:46 +00:00
|
|
|
<history-item icon="clock" data-testid="created-on">
|
2020-07-30 12:09:33 +00:00
|
|
|
<gl-sprintf :message="$options.i18n.createdOn">
|
|
|
|
<template #name>
|
|
|
|
<strong>{{ packageEntity.name }}</strong>
|
|
|
|
</template>
|
|
|
|
<template #version>
|
|
|
|
<strong>{{ packageEntity.version }}</strong>
|
|
|
|
</template>
|
|
|
|
<template #datetime>
|
|
|
|
<time-ago-tooltip :time="packageEntity.created_at" />
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2020-09-04 15:08:46 +00:00
|
|
|
</history-item>
|
|
|
|
<history-item icon="pencil" data-testid="updated-at">
|
2020-07-30 12:09:33 +00:00
|
|
|
<gl-sprintf :message="$options.i18n.updatedAtText">
|
|
|
|
<template #name>
|
|
|
|
<strong>{{ packageEntity.name }}</strong>
|
|
|
|
</template>
|
|
|
|
<template #version>
|
|
|
|
<strong>{{ packageEntity.version }}</strong>
|
|
|
|
</template>
|
|
|
|
<template #datetime>
|
|
|
|
<time-ago-tooltip :time="packageEntity.updated_at" />
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2020-09-04 15:08:46 +00:00
|
|
|
</history-item>
|
2020-07-30 12:09:33 +00:00
|
|
|
<template v-if="packagePipeline">
|
2020-09-04 15:08:46 +00:00
|
|
|
<history-item icon="commit" data-testid="commit">
|
2020-07-30 12:09:33 +00:00
|
|
|
<gl-sprintf :message="$options.i18n.commitText">
|
|
|
|
<template #link>
|
2020-08-06 18:09:41 +00:00
|
|
|
<gl-link :href="packagePipeline.project.commit_url">{{
|
2020-07-30 12:09:33 +00:00
|
|
|
packagePipeline.sha
|
|
|
|
}}</gl-link>
|
|
|
|
</template>
|
|
|
|
<template #branch>
|
|
|
|
<strong>{{ packagePipeline.ref }}</strong>
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2020-09-04 15:08:46 +00:00
|
|
|
</history-item>
|
|
|
|
<history-item icon="pipeline" data-testid="pipeline">
|
2020-07-30 12:09:33 +00:00
|
|
|
<gl-sprintf :message="$options.i18n.pipelineText">
|
|
|
|
<template #link>
|
2020-08-06 18:09:41 +00:00
|
|
|
<gl-link :href="packagePipeline.project.pipeline_url"
|
2020-07-30 12:09:33 +00:00
|
|
|
>#{{ packagePipeline.id }}</gl-link
|
|
|
|
>
|
|
|
|
</template>
|
|
|
|
<template #datetime>
|
|
|
|
<time-ago-tooltip :time="packagePipeline.created_at" />
|
|
|
|
</template>
|
|
|
|
<template #author>{{ packagePipeline.user.name }}</template>
|
|
|
|
</gl-sprintf>
|
2020-09-04 15:08:46 +00:00
|
|
|
</history-item>
|
2020-07-30 12:09:33 +00:00
|
|
|
</template>
|
2020-09-04 15:08:46 +00:00
|
|
|
<history-item icon="package" data-testid="published">
|
2020-07-30 12:09:33 +00:00
|
|
|
<gl-sprintf :message="$options.i18n.publishText">
|
|
|
|
<template #project>
|
|
|
|
<strong>{{ projectName }}</strong>
|
|
|
|
</template>
|
|
|
|
<template #datetime>
|
|
|
|
<time-ago-tooltip :time="packageEntity.created_at" />
|
|
|
|
</template>
|
|
|
|
</gl-sprintf>
|
2020-09-04 15:08:46 +00:00
|
|
|
</history-item>
|
2020-07-30 12:09:33 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</template>
|