diff options
Diffstat (limited to 'app/assets/javascripts/releases')
6 files changed, 25 insertions, 102 deletions
diff --git a/app/assets/javascripts/releases/components/app_edit_new.vue b/app/assets/javascripts/releases/components/app_edit_new.vue index 022c3224bb4..dd3f4ed636f 100644 --- a/app/assets/javascripts/releases/components/app_edit_new.vue +++ b/app/assets/javascripts/releases/components/app_edit_new.vue @@ -128,8 +128,13 @@ export default { async mounted() { await this.initializeRelease(); - // Focus the first non-disabled input or button element - this.$el.querySelector('input:enabled, button:enabled').focus(); + if (this.release?.tagName) { + // Focus the release title input if a tag was preselected + this.$refs.releaseTitleInput.$el.focus(); + } else { + // Focus the first non-disabled input or button element otherwise + this.$el.querySelector('input:enabled, button:enabled').focus(); + } }, methods: { ...mapActions('editNew', [ diff --git a/app/assets/javascripts/releases/components/asset_links_form.vue b/app/assets/javascripts/releases/components/asset_links_form.vue index b81da399a7b..7c6d44456d9 100644 --- a/app/assets/javascripts/releases/components/asset_links_form.vue +++ b/app/assets/javascripts/releases/components/asset_links_form.vue @@ -209,7 +209,7 @@ export default { :id="`asset-type-${index}`" ref="typeSelect" :value="link.linkType || $options.defaultTypeOptionValue" - class="form-control pr-4" + class="pr-4" name="asset-type" :options="$options.typeOptions" @change="updateAssetLinkType({ linkIdToUpdate: link.id, newType: $event })" diff --git a/app/assets/javascripts/releases/components/release_block_header.vue b/app/assets/javascripts/releases/components/release_block_header.vue index def38780545..070865cf84b 100644 --- a/app/assets/javascripts/releases/components/release_block_header.vue +++ b/app/assets/javascripts/releases/components/release_block_header.vue @@ -7,6 +7,10 @@ import { BACK_URL_PARAM } from '~/releases/constants'; export default { i18n: { editButton: __('Edit this release'), + historical: __('Historical release'), + historicalTooltip: __( + 'This release was created with a date in the past. Evidence collection at the moment of the release is unavailable.', + ), }, name: 'ReleaseBlockHeader', components: { @@ -65,6 +69,14 @@ export default { <gl-badge v-if="release.upcomingRelease" variant="warning" class="align-middle">{{ __('Upcoming Release') }}</gl-badge> + <gl-badge + v-else-if="release.historicalRelease" + v-gl-tooltip + :title="$options.i18n.historicalTooltip" + class="gl-vertical-align-middle" + > + {{ $options.i18n.historical }} + </gl-badge> </h2> <gl-button v-if="editLink" diff --git a/app/assets/javascripts/releases/graphql/fragments/release.fragment.graphql b/app/assets/javascripts/releases/graphql/fragments/release.fragment.graphql index e0de6d12b13..e22726f27a7 100644 --- a/app/assets/javascripts/releases/graphql/fragments/release.fragment.graphql +++ b/app/assets/javascripts/releases/graphql/fragments/release.fragment.graphql @@ -1,5 +1,4 @@ fragment Release on Release { - __typename id name tagName @@ -8,21 +7,17 @@ fragment Release on Release { releasedAt createdAt upcomingRelease + historicalRelease assets { - __typename count sources { - __typename nodes { - __typename format url } } links { - __typename nodes { - __typename id name url @@ -33,9 +28,7 @@ fragment Release on Release { } } evidences { - __typename nodes { - __typename id filepath collectedAt @@ -43,7 +36,6 @@ fragment Release on Release { } } links { - __typename editUrl selfUrl openedIssuesUrl @@ -53,29 +45,24 @@ fragment Release on Release { closedMergeRequestsUrl } commit { - __typename id sha webUrl title } author { - __typename id webUrl avatarUrl username } milestones { - __typename nodes { - __typename id title description webPath stats { - __typename totalIssuesCount closedIssuesCount } diff --git a/app/assets/javascripts/releases/graphql/queries/all_releases.query.graphql b/app/assets/javascripts/releases/graphql/queries/all_releases.query.graphql index 61a06f268bd..1e3d31c86bf 100644 --- a/app/assets/javascripts/releases/graphql/queries/all_releases.query.graphql +++ b/app/assets/javascripts/releases/graphql/queries/all_releases.query.graphql @@ -1,3 +1,5 @@ +#import "../fragments/release.fragment.graphql" + query allReleases( $fullPath: ID! $first: Int @@ -7,96 +9,12 @@ query allReleases( $sort: ReleaseSort ) { project(fullPath: $fullPath) { - __typename id releases(first: $first, last: $last, before: $before, after: $after, sort: $sort) { - __typename nodes { - __typename - id - name - tagName - tagPath - descriptionHtml - releasedAt - createdAt - upcomingRelease - assets { - __typename - count - sources { - __typename - nodes { - __typename - format - url - } - } - links { - __typename - nodes { - __typename - id - name - url - directAssetUrl - linkType - external - } - } - } - evidences { - __typename - nodes { - __typename - id - filepath - collectedAt - sha - } - } - links { - __typename - editUrl - selfUrl - openedIssuesUrl - closedIssuesUrl - openedMergeRequestsUrl - mergedMergeRequestsUrl - closedMergeRequestsUrl - } - commit { - __typename - id - sha - webUrl - title - } - author { - __typename - id - webUrl - avatarUrl - username - } - milestones { - __typename - nodes { - __typename - id - title - description - webPath - stats { - __typename - totalIssuesCount - closedIssuesCount - } - } - } + ...Release } pageInfo { - __typename startCursor hasPreviousPage hasNextPage diff --git a/app/assets/javascripts/releases/util.js b/app/assets/javascripts/releases/util.js index f1f5f4bca4c..a1027ef08d7 100644 --- a/app/assets/javascripts/releases/util.js +++ b/app/assets/javascripts/releases/util.js @@ -12,6 +12,7 @@ const convertScalarProperties = (graphQLRelease) => 'description', 'descriptionHtml', 'upcomingRelease', + 'historicalRelease', ]); const convertDateProperties = ({ releasedAt }) => ({ |