Commit ff29d467 authored by Nick Kipling's avatar Nick Kipling

Added information type constant

Created confirmation type constant
Added to utils
Added to component
parent 62c7c990
......@@ -2,6 +2,7 @@
import { s__ } from '~/locale';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { GlLink } from '@gitlab/ui';
import { InformationType } from '../constants';
export default {
name: 'PackageInformation',
......@@ -26,6 +27,7 @@ export default {
default: false,
},
},
informationType: InformationType,
};
</script>
......@@ -39,7 +41,11 @@ export default {
<li v-for="(item, index) in information" :key="index">
<span class="text-secondary">{{ item.label }}</span>
<div class="pull-right w-75 gl-text-right">
<gl-link v-if="item.type === 'link'" :href="item.value" target="_blank">
<gl-link
v-if="item.type === $options.informationType.LINK"
:href="item.value"
target="_blank"
>
{{ item.value }}
</gl-link>
......
......@@ -41,3 +41,7 @@ export const NpmManager = {
export const FETCH_PACKAGE_VERSIONS_ERROR = s__(
'PackageRegistry|Unable to fetch package version information.',
);
export const InformationType = {
LINK: 'link',
};
import { __ } from '~/locale';
import { formatDate } from '~/lib/utils/datetime_utility';
import { TrackingActions } from './constants';
import { TrackingActions, InformationType } from './constants';
import { PackageType } from '../shared/constants';
import { orderBy } from 'lodash';
......@@ -53,7 +53,7 @@ export function generatePackageInfo(packageEntity = {}) {
order: 3,
label: __('Project URL'),
value: projectUrl,
type: 'link',
type: InformationType.LINK,
});
}
......@@ -62,7 +62,7 @@ export function generatePackageInfo(packageEntity = {}) {
order: 4,
label: __('License URL'),
value: licenseUrl,
type: 'link',
type: InformationType.LINK,
});
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment