diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-07 21:16:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-07 21:16:03 +0300 |
commit | 6a7fcb14aaff70d8438167b652b365406b37613c (patch) | |
tree | fd1b65c5e60e32c02a102158ef0bd9bad412e5d1 /app/assets/javascripts/environments | |
parent | 468bcfb9c6d04b0244c349eda62cd7ed1496cca3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/environments')
-rw-r--r-- | app/assets/javascripts/environments/components/deployment.vue | 30 | ||||
-rw-r--r-- | app/assets/javascripts/environments/components/new_environment_item.vue | 4 |
2 files changed, 30 insertions, 4 deletions
diff --git a/app/assets/javascripts/environments/components/deployment.vue b/app/assets/javascripts/environments/components/deployment.vue index b3a27628272..5352805ed6a 100644 --- a/app/assets/javascripts/environments/components/deployment.vue +++ b/app/assets/javascripts/environments/components/deployment.vue @@ -1,7 +1,15 @@ <script> -import { GlBadge, GlButton, GlCollapse, GlIcon, GlTooltipDirective as GlTooltip } from '@gitlab/ui'; +import { + GlBadge, + GlButton, + GlCollapse, + GlIcon, + GlLink, + GlTooltipDirective as GlTooltip, +} from '@gitlab/ui'; import { GlBreakpointInstance } from '@gitlab/ui/dist/utils'; import { __, s__ } from '~/locale'; +import { truncate } from '~/lib/utils/text_utility'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import DeploymentStatusBadge from './deployment_status_badge.vue'; @@ -16,6 +24,7 @@ export default { GlButton, GlCollapse, GlIcon, + GlLink, TimeAgoTooltip, }, directives: { @@ -62,6 +71,15 @@ export default { commit() { return this.deployment?.commit; }, + user() { + return this.deployment?.user; + }, + username() { + return truncate(this.user?.username, 25); + }, + userPath() { + return this.user?.path; + }, }, methods: { toggleCollapse() { @@ -75,6 +93,7 @@ export default { commitSha: __('Commit SHA'), showDetails: __('Show details'), hideDetails: __('Hide details'), + triggerer: s__('Deployment|Triggerer'), }, headerClasses: [ 'gl-display-flex', @@ -149,6 +168,13 @@ export default { </gl-button> </div> <commit v-if="commit" :commit="commit" class="gl-mt-3" /> - <gl-collapse :visible="visible" /> + <gl-collapse :visible="visible"> + <div class="gl-display-flex gl-align-items-center gl-mt-5"> + <div v-if="user" class="gl-display-flex gl-flex-direction-column"> + <span class="gl-text-gray-500 gl-font-weight-bold">{{ $options.i18n.triggerer }}</span> + <gl-link :href="userPath" class="gl-font-monospace gl-mt-3"> @{{ username }} </gl-link> + </div> + </div> + </gl-collapse> </div> </template> diff --git a/app/assets/javascripts/environments/components/new_environment_item.vue b/app/assets/javascripts/environments/components/new_environment_item.vue index e23a02b3dfd..48a77c021bf 100644 --- a/app/assets/javascripts/environments/components/new_environment_item.vue +++ b/app/assets/javascripts/environments/components/new_environment_item.vue @@ -99,8 +99,8 @@ export default { if (!this.lastDeployment) { return []; } - const { manualActions = [], scheduledActions = [] } = this.lastDeployment; - const combinedActions = [...manualActions, ...scheduledActions]; + const { manualActions, scheduledActions } = this.lastDeployment; + const combinedActions = [...(manualActions ?? []), ...(scheduledActions ?? [])]; return combinedActions.map((action) => ({ ...action, })); |