diff options
Diffstat (limited to 'app/assets')
27 files changed, 139 insertions, 149 deletions
diff --git a/app/assets/images/vulnerability/secureflag-logo.svg b/app/assets/images/vulnerability/secureflag-logo.svg new file mode 100644 index 00000000000..621c56b9043 --- /dev/null +++ b/app/assets/images/vulnerability/secureflag-logo.svg @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com"> + <defs> + <linearGradient id="paint1_linear_117_388" x1="8.32922" y1="0.701083" x2="25.6103" y2="8.8381" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(5.965987, 0, 0, 5.965987, -1.949537, -0.014549)"> + <stop stop-color="#005AEC" /> + <stop offset="1" stop-color="#12DFE7" /> + </linearGradient> + <linearGradient id="paint2_linear_117_388" x1="3.30485" y1="11.2131" x2="20.4972" y2="19.4227" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(5.965987, 0, 0, 5.965987, -1.949537, -0.014549)"> + <stop stop-color="#005AEC" /> + <stop offset="1" stop-color="#12DFE7" /> + </linearGradient> + </defs> + <g style="" transform="matrix(3.098345, 0, 0, 3.098345, 46.765705, 8.335629)" + bx:origin="0.503455 0.502894"> + <path d="M 65.436 0.003 L 65.436 26.662 L 87.144 12.772 L 65.436 0.003 Z" + fill="url(#paint1_linear_117_388)" style="" /> + <path + d="M 108.686 77.337 L 87.143 65.001 L 87.143 38.543 L 65.434 51.815 L 43.562 38.543 L 43.809 64.746 L 22.512 77.592 L 0.393 64.321 L 0.393 116.301 L 65.352 155.095 L 129.901 116.301 L 129.901 64.406 L 108.686 77.337 Z M 65.434 103.2 L 43.562 90.609 L 43.562 114.344 L 22.923 102.945 L 43.562 90.609 L 65.434 77.848 C 65.434 77.848 85.663 90.694 86.156 90.609 C 86.65 90.523 65.434 103.2 65.434 103.2 Z M 86.156 114.344 L 86.156 90.609 L 106.795 102.945 L 86.156 114.344 Z" + fill="url(#paint2_linear_117_388)" style="" /> + </g> +</svg>
\ No newline at end of file diff --git a/app/assets/javascripts/behaviors/markdown/render_gfm.js b/app/assets/javascripts/behaviors/markdown/render_gfm.js index 04b3599ea8c..39a7a76e91f 100644 --- a/app/assets/javascripts/behaviors/markdown/render_gfm.js +++ b/app/assets/javascripts/behaviors/markdown/render_gfm.js @@ -39,7 +39,7 @@ export function renderGFM(element) { '.js-render-mermaid', '[lang="json"][data-lang-params="table"]', '.gfm-project_member', - '.gfm-issue, .gfm-merge_request', + '.gfm-issue, .gfm-work_item, .gfm-merge_request', '.js-render-metrics', '.js-render-observability', ].map((selector) => Array.from(element.querySelectorAll(selector))); @@ -50,7 +50,9 @@ export function renderGFM(element) { renderSandboxedMermaid(mermaidEls); renderJSONTable(tableEls.map((e) => e.parentNode)); highlightCurrentUser(userEls); - renderMetrics(metricsEls); + if (!window.gon?.features?.removeMonitorMetrics) { + renderMetrics(metricsEls); + } renderObservability(observabilityEls); initPopovers(popoverEls); } diff --git a/app/assets/javascripts/ci/runner/components/runner_list_empty_state.vue b/app/assets/javascripts/ci/runner/components/runner_list_empty_state.vue index 2cff11c1aa1..087ddafb137 100644 --- a/app/assets/javascripts/ci/runner/components/runner_list_empty_state.vue +++ b/app/assets/javascripts/ci/runner/components/runner_list_empty_state.vue @@ -43,8 +43,12 @@ export default { }, computed: { shouldShowCreateRunnerWorkflow() { - // create_runner_workflow_for_admin feature flag - return this.newRunnerPath && this.glFeatures?.createRunnerWorkflowForAdmin; + // create_runner_workflow_for_admin or create_runner_workflow_for_namespace + return ( + this.newRunnerPath && + (this.glFeatures?.createRunnerWorkflowForAdmin || + this.glFeatures?.createRunnerWorkflowForNamespace) + ); }, }, modalId: 'runners-empty-state-instructions-modal', diff --git a/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue b/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue index 9f3e6f247d7..a4ca44b8e5a 100644 --- a/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue +++ b/app/assets/javascripts/ci/runner/group_runners/group_runners_app.vue @@ -270,6 +270,7 @@ export default { v-if="noRunnersFound" :registration-token="registrationToken" :is-search-filtered="isSearchFiltered" + :new-runner-path="newRunnerPath" :svg-path="emptyStateSvgPath" :filtered-svg-path="emptyStateFilteredSvgPath" /> diff --git a/app/assets/javascripts/issuable/popover/index.js b/app/assets/javascripts/issuable/popover/index.js index de3c8160b7a..9430419685b 100644 --- a/app/assets/javascripts/issuable/popover/index.js +++ b/app/assets/javascripts/issuable/popover/index.js @@ -6,6 +6,7 @@ import MRPopover from './components/mr_popover.vue'; const componentsByReferenceType = { issue: IssuePopover, + work_item: IssuePopover, merge_request: MRPopover, }; diff --git a/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/ml_experiments_show.vue b/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/ml_experiments_show.vue index 0d40a727029..25c06aa2f7f 100644 --- a/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/ml_experiments_show.vue +++ b/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/ml_experiments_show.vue @@ -86,6 +86,7 @@ export default { { key: 'user', label: this.$options.i18n.USER_LABEL }, ...this.paramNames, ...this.metricNames, + { key: 'ci_job', label: this.$options.i18n.CI_JOB_LABEL }, { key: 'artifact', label: this.$options.i18n.ARTIFACTS_LABEL }, ]; }, @@ -226,6 +227,15 @@ export default { <gl-link v-if="data.value" :href="data.value.path">@{{ data.value.username }}</gl-link> <div v-else>{{ $options.i18n.NO_DATA_CONTENT }}</div> </template> + + <template #cell(ci_job)="data"> + <gl-link v-if="data.value" :href="data.value.path" target="_blank">{{ + data.value.name + }}</gl-link> + <div v-else class="gl-font-style-italic gl-text-gray-500"> + {{ $options.i18n.NO_JOB }} + </div> + </template> </gl-table-lite> </div> diff --git a/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/translations.js b/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/translations.js index 604658ded3d..3af33f53fbd 100644 --- a/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/translations.js +++ b/app/assets/javascripts/ml/experiment_tracking/routes/experiments/show/translations.js @@ -3,12 +3,14 @@ import { s__ } from '~/locale'; export const ARTIFACTS_LABEL = s__('MlExperimentTracking|Artifacts'); export const DETAILS_LABEL = s__('MlExperimentTracking|Details'); export const USER_LABEL = s__('MlExperimentTracking|Author'); +export const CI_JOB_LABEL = s__('MlExperimentTracking|CI Job'); export const CREATED_AT_LABEL = s__('MlExperimentTracking|Created at'); export const NAME_LABEL = s__('MlExperimentTracking|Name'); export const NO_DATA_CONTENT = s__('MlExperimentTracking|-'); export const FILTER_CANDIDATES_LABEL = s__('MlExperimentTracking|Filter candidates'); export const NO_CANDIDATE_NAME = s__('MlExperimentTracking|No name'); export const NO_ARTIFACT = s__('MlExperimentTracking|No artifacts'); +export const NO_JOB = s__('MlExperimentTracking|-'); export const CREATE_NEW_LABEL = s__('MlExperimentTracking|Create new candidates'); export const EMPTY_STATE_DESCRIPTION_LABEL = s__( 'MlExperimentTracking|No candidates logged for the query. Create new candidates using the MLflow client.', diff --git a/app/assets/javascripts/security_configuration/components/constants.js b/app/assets/javascripts/security_configuration/components/constants.js index 3bf0401ef5e..1b86d7d0a2b 100644 --- a/app/assets/javascripts/security_configuration/components/constants.js +++ b/app/assets/javascripts/security_configuration/components/constants.js @@ -17,6 +17,7 @@ import { import kontraLogo from 'images/vulnerability/kontra-logo.svg'; import scwLogo from 'images/vulnerability/scw-logo.svg'; +import secureflagLogo from 'images/vulnerability/secureflag-logo.svg'; import configureSastMutation from '../graphql/configure_sast.mutation.graphql'; import configureSastIacMutation from '../graphql/configure_iac.mutation.graphql'; import configureSecretDetectionMutation from '../graphql/configure_secret_detection.mutation.graphql'; @@ -313,6 +314,9 @@ export const TEMP_PROVIDER_LOGOS = { [__('Secure Code Warrior')]: { svg: scwLogo, }, + SecureFlag: { + svg: secureflagLogo, + }, }; // Use the `url` field from the GraphQL query once this issue is resolved @@ -320,4 +324,5 @@ export const TEMP_PROVIDER_LOGOS = { export const TEMP_PROVIDER_URLS = { Kontra: 'https://application.security/', [__('Secure Code Warrior')]: 'https://www.securecodewarrior.com/', + SecureFlag: 'https://www.secureflag.com/', }; diff --git a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue index 32ac5daf5de..f9f4bf260a1 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_add_note.vue @@ -21,19 +21,16 @@ export default { WorkItemCommentForm, }, mixins: [Tracking.mixin()], + inject: ['fullPath'], props: { workItemId: { type: String, required: true, }, - fullPath: { + workItemIid: { type: String, required: true, }, - queryVariables: { - type: Object, - required: true, - }, discussionId: { type: String, required: false, @@ -85,13 +82,16 @@ export default { workItem: { query: workItemByIidQuery, variables() { - return this.queryVariables; + return { + fullPath: this.fullPath, + iid: this.workItemIid, + }; }, update(data) { return data.workspace.workItems.nodes[0]; }, skip() { - return !this.queryVariables.iid; + return !this.workItemIid; }, error() { this.$emit('error', i18n.fetchError); diff --git a/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue b/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue index e40c6296229..e98e03f76fd 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue @@ -18,16 +18,13 @@ export default { DiscussionNotesRepliesWrapper, WorkItemNoteReplying, }, + inject: ['fullPath'], props: { workItemId: { type: String, required: true, }, - queryVariables: { - type: Object, - required: true, - }, - fullPath: { + workItemIid: { type: String, required: true, }, @@ -161,8 +158,7 @@ export default { :assignees="assignees" :can-set-work-item-metadata="canSetWorkItemMetadata" :work-item-id="workItemId" - :query-variables="queryVariables" - :full-path="fullPath" + :work-item-iid="workItemIid" @startReplying="showReplyForm" @deleteNote="$emit('deleteNote', note)" @reportAbuse="$emit('reportAbuse', note)" @@ -192,9 +188,8 @@ export default { :markdown-preview-path="markdownPreviewPath" :assignees="assignees" :work-item-id="workItemId" + :work-item-iid="workItemIid" :can-set-work-item-metadata="canSetWorkItemMetadata" - :query-variables="queryVariables" - :full-path="fullPath" @startReplying="showReplyForm" @deleteNote="$emit('deleteNote', note)" @reportAbuse="$emit('reportAbuse', note)" @@ -219,9 +214,8 @@ export default { :markdown-preview-path="markdownPreviewPath" :assignees="assignees" :work-item-id="workItemId" + :work-item-iid="workItemIid" :can-set-work-item-metadata="canSetWorkItemMetadata" - :query-variables="queryVariables" - :full-path="fullPath" @startReplying="showReplyForm" @deleteNote="$emit('deleteNote', reply)" @reportAbuse="$emit('reportAbuse', reply)" @@ -233,9 +227,8 @@ export default { v-if="shouldShowReplyForm" :notes-form="false" :autofocus="autofocus" - :query-variables="queryVariables" - :full-path="fullPath" :work-item-id="workItemId" + :work-item-iid="workItemIid" :discussion-id="discussionId" :work-item-type="workItemType" :sort-order="sortOrder" diff --git a/app/assets/javascripts/work_items/components/notes/work_item_note.vue b/app/assets/javascripts/work_items/components/notes/work_item_note.vue index a6ab8a371de..75b0970a89e 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_note.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_note.vue @@ -32,16 +32,13 @@ export default { EditedAt, }, mixins: [Tracking.mixin()], + inject: ['fullPath'], props: { - fullPath: { + workItemId: { type: String, required: true, }, - queryVariables: { - type: Object, - required: true, - }, - workItemId: { + workItemIid: { type: String, required: true, }, @@ -158,13 +155,16 @@ export default { workItem: { query: workItemByIidQuery, variables() { - return this.queryVariables; + return { + fullPath: this.fullPath, + iid: this.workItemIid, + }; }, update(data) { return data.workspace?.workItems?.nodes[0]; }, skip() { - return !this.queryVariables.iid; + return !this.workItemIid; }, error() { this.$emit('error', i18n.fetchError); diff --git a/app/assets/javascripts/work_items/components/work_item_assignees.vue b/app/assets/javascripts/work_items/components/work_item_assignees.vue index 95527dda1d4..4e6583b65f8 100644 --- a/app/assets/javascripts/work_items/components/work_item_assignees.vue +++ b/app/assets/javascripts/work_items/components/work_item_assignees.vue @@ -54,6 +54,7 @@ export default { GlIntersectionObserver, }, mixins: [Tracking.mixin()], + inject: ['fullPath'], props: { workItemId: { type: String, @@ -81,10 +82,6 @@ export default { required: false, default: false, }, - fullPath: { - type: String, - required: true, - }, }, data() { return { diff --git a/app/assets/javascripts/work_items/components/work_item_created_updated.vue b/app/assets/javascripts/work_items/components/work_item_created_updated.vue index 5c30e984f13..78a86aa49a4 100644 --- a/app/assets/javascripts/work_items/components/work_item_created_updated.vue +++ b/app/assets/javascripts/work_items/components/work_item_created_updated.vue @@ -10,17 +10,13 @@ export default { GlSprintf, TimeAgoTooltip, }, + inject: ['fullPath'], props: { workItemIid: { type: String, required: false, default: null, }, - fullPath: { - type: String, - required: false, - default: null, - }, }, computed: { createdAt() { diff --git a/app/assets/javascripts/work_items/components/work_item_description.vue b/app/assets/javascripts/work_items/components/work_item_description.vue index 942f5d4a9f0..f3c94732aae 100644 --- a/app/assets/javascripts/work_items/components/work_item_description.vue +++ b/app/assets/javascripts/work_items/components/work_item_description.vue @@ -28,19 +28,16 @@ export default { WorkItemDescriptionRendered, }, mixins: [glFeatureFlagMixin(), Tracking.mixin()], + inject: ['fullPath'], props: { workItemId: { type: String, required: true, }, - fullPath: { + workItemIid: { type: String, required: true, }, - queryVariables: { - type: Object, - required: true, - }, }, markdownDocsPath: helpPagePath('user/project/quick_actions'), quickActionsDocsPath: helpPagePath('user/project/quick_actions'), @@ -64,13 +61,16 @@ export default { workItem: { query: workItemByIidQuery, variables() { - return this.queryVariables; + return { + fullPath: this.fullPath, + iid: this.workItemIid, + }; }, update(data) { return data.workspace.workItems.nodes[0]; }, skip() { - return !this.queryVariables.iid; + return !this.workItemIid; }, result() { if (this.isEditing) { diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index ef99001c0e8..56802f76bba 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -140,7 +140,10 @@ export default { workItem: { query: workItemByIidQuery, variables() { - return this.queryVariables; + return { + fullPath: this.fullPath, + iid: this.workItemIid, + }; }, skip() { return !this.workItemIid; @@ -314,12 +317,6 @@ export default { workItemNotes() { return this.isWidgetPresent(WIDGET_TYPE_NOTES); }, - queryVariables() { - return { - fullPath: this.fullPath, - iid: this.workItemIid, - }; - }, children() { return this.workItem ? findHierarchyWidgetChildren(this.workItem) : []; }, @@ -398,10 +395,12 @@ export default { this.toggleChildFromCache(child, child.id, client); }, toggleChildFromCache(workItem, childId, store) { - const sourceData = store.readQuery({ + const query = { query: workItemByIidQuery, - variables: this.queryVariables, - }); + variables: { fullPath: this.fullPath, iid: this.workItemIid }, + }; + + const sourceData = store.readQuery(query); const newData = produce(sourceData, (draftState) => { const { widgets } = draftState.workspace.workItems.nodes[0]; @@ -416,11 +415,7 @@ export default { } }); - store.writeQuery({ - query: workItemByIidQuery, - variables: this.queryVariables, - data: newData, - }); + store.writeQuery({ ...query, data: newData }); }, async updateWorkItem(workItem, childId, parentId) { return this.$apollo.mutate({ @@ -603,7 +598,7 @@ export default { :can-update="canUpdate" @error="updateError = $event" /> - <work-item-created-updated :work-item-iid="workItemIid" :full-path="fullPath" /> + <work-item-created-updated :work-item-iid="workItemIid" /> <work-item-state :work-item="workItem" :work-item-parent-id="workItemParentId" @@ -618,15 +613,13 @@ export default { :allows-multiple-assignees="workItemAssignees.allowsMultipleAssignees" :work-item-type="workItemType" :can-invite-members="workItemAssignees.canInviteMembers" - :full-path="fullPath" @error="updateError = $event" /> <work-item-labels v-if="workItemLabels" - :work-item-id="workItem.id" :can-update="canUpdate" - :full-path="fullPath" - :query-variables="queryVariables" + :work-item-id="workItem.id" + :work-item-iid="workItem.iid" @error="updateError = $event" /> <work-item-due-date @@ -644,7 +637,6 @@ export default { :work-item-milestone="workItemMilestone.milestone" :work-item-type="workItemType" :can-update="canUpdate" - :full-path="fullPath" @error="updateError = $event" /> <work-item-weight @@ -653,8 +645,8 @@ export default { :can-update="canUpdate" :weight="workItemWeight.weight" :work-item-id="workItem.id" + :work-item-iid="workItem.iid" :work-item-type="workItemType" - :query-variables="queryVariables" @error="updateError = $event" /> <work-item-progress @@ -664,7 +656,6 @@ export default { :progress="workItemProgress.progress" :work-item-id="workItem.id" :work-item-type="workItemType" - :query-variables="queryVariables" @error="updateError = $event" /> <work-item-iteration @@ -673,9 +664,8 @@ export default { :iteration="workItemIteration.iteration" :can-update="canUpdate" :work-item-id="workItem.id" + :work-item-iid="workItem.iid" :work-item-type="workItemType" - :query-variables="queryVariables" - :full-path="fullPath" @error="updateError = $event" /> <work-item-health-status @@ -684,16 +674,14 @@ export default { :health-status="workItemHealthStatus.healthStatus" :can-update="canUpdate" :work-item-id="workItem.id" + :work-item-iid="workItem.iid" :work-item-type="workItemType" - :query-variables="queryVariables" - :full-path="fullPath" @error="updateError = $event" /> <work-item-description v-if="hasDescriptionWidget" :work-item-id="workItem.id" - :full-path="fullPath" - :query-variables="queryVariables" + :work-item-iid="workItem.iid" class="gl-pt-5" @error="updateError = $event" /> @@ -705,7 +693,6 @@ export default { :work-item-iid="workItemIid" :children="children" :can-update="canUpdate" - :project-path="fullPath" :confidential="workItem.confidential" @addWorkItemChild="addChild" @removeChild="removeChild" @@ -715,8 +702,6 @@ export default { v-if="workItemNotes" :work-item-id="workItem.id" :work-item-iid="workItem.iid" - :query-variables="queryVariables" - :full-path="fullPath" :work-item-type="workItemType" :is-modal="isModal" :assignees="workItemAssignees && workItemAssignees.assignees.nodes" diff --git a/app/assets/javascripts/work_items/components/work_item_labels.vue b/app/assets/javascripts/work_items/components/work_item_labels.vue index 574ac5f0f5d..015c86ba043 100644 --- a/app/assets/javascripts/work_items/components/work_item_labels.vue +++ b/app/assets/javascripts/work_items/components/work_item_labels.vue @@ -43,21 +43,18 @@ export default { LabelItem, }, mixins: [Tracking.mixin()], + inject: ['fullPath'], props: { workItemId: { type: String, required: true, }, - canUpdate: { - type: Boolean, - required: true, - }, - fullPath: { + workItemIid: { type: String, required: true, }, - queryVariables: { - type: Object, + canUpdate: { + type: Boolean, required: true, }, }, @@ -76,13 +73,16 @@ export default { workItem: { query: workItemByIidQuery, variables() { - return this.queryVariables; + return { + fullPath: this.fullPath, + iid: this.workItemIid, + }; }, update(data) { return data.workspace.workItems.nodes[0]; }, skip() { - return !this.queryVariables.iid; + return !this.workItemIid; }, error() { this.$emit('error', i18n.fetchError); diff --git a/app/assets/javascripts/work_items/components/work_item_links/index.js b/app/assets/javascripts/work_items/components/work_item_links/index.js index 45dd4c00683..636c9357170 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/index.js +++ b/app/assets/javascripts/work_items/components/work_item_links/index.js @@ -9,11 +9,11 @@ export default function initWorkItemLinks() { const workItemLinksRoot = document.querySelector('.js-work-item-links-root'); if (!workItemLinksRoot) { - return; + return null; } const { - projectPath, + fullPath, wiHasIssueWeightsFeature, wiHasIterationsFeature, wiHasIssuableHealthStatusFeature, @@ -22,8 +22,7 @@ export default function initWorkItemLinks() { wiReportAbusePath, } = workItemLinksRoot.dataset; - // eslint-disable-next-line no-new - new Vue({ + return new Vue({ el: workItemLinksRoot, name: 'WorkItemLinksRoot', apolloProvider, @@ -31,8 +30,7 @@ export default function initWorkItemLinks() { WorkItemLinks, }, provide: { - projectPath, - fullPath: projectPath, + fullPath, hasIssueWeightsFeature: wiHasIssueWeightsFeature, hasIterationsFeature: wiHasIterationsFeature, hasIssuableHealthStatusFeature: wiHasIssuableHealthStatusFeature, diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_children_wrapper.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_children_wrapper.vue index 2811ebc4bb0..098917f2b56 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_children_wrapper.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_children_wrapper.vue @@ -19,6 +19,7 @@ export default { WorkItemLinkChild, }, mixins: [glFeatureFlagsMixin()], + inject: ['fullPath'], props: { workItemType: { type: String, @@ -43,10 +44,6 @@ export default { required: false, default: false, }, - projectPath: { - type: String, - required: true, - }, fetchByIid: { type: Boolean, required: false, @@ -86,7 +83,7 @@ export default { queryVariables() { return this.fetchByIid ? { - fullPath: this.projectPath, + fullPath: this.fullPath, iid: this.workItemIid, } : { @@ -98,7 +95,7 @@ export default { addWorkItemQuery({ id, iid }) { const variables = this.fetchByIid ? { - fullPath: this.projectPath, + fullPath: this.fullPath, iid, } : { @@ -232,7 +229,6 @@ export default { <work-item-link-child v-for="child in children" :key="child.id" - :project-path="projectPath" :can-update="canUpdate" :issuable-gid="workItemId" :child-item="child" diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_link_child.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_link_child.vue index 35430261e29..8152412a5c1 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_link_child.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_link_child.vue @@ -38,11 +38,8 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, + inject: ['fullPath'], props: { - projectPath: { - type: String, - required: true, - }, canUpdate: { type: Boolean, required: true, @@ -121,9 +118,7 @@ export default { return this.isItemOpen ? __('Created') : __('Closed'); }, childPath() { - return `${gon?.relative_url_root || ''}/${this.projectPath}/-/work_items/${ - this.childItem.iid - }`; + return `${gon?.relative_url_root || ''}/${this.fullPath}/-/work_items/${this.childItem.iid}`; }, chevronType() { return this.isExpanded ? 'chevron-down' : 'chevron-right'; @@ -353,7 +348,6 @@ export default { </div> <work-item-tree-children v-if="isExpanded" - :project-path="projectPath" :can-update="canUpdate" :work-item-id="issuableGid" :work-item-type="workItemType" diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue index 7feef26f211..46c109f2d57 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links.vue @@ -36,7 +36,7 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - inject: ['projectPath', 'reportAbusePath'], + inject: ['fullPath', 'reportAbusePath'], props: { issuableId: { type: Number, @@ -226,7 +226,7 @@ export default { this.$apollo.addSmartQuery('prefetchedWorkItem', { query: workItemByIidQuery, variables: { - fullPath: this.projectPath, + fullPath: this.fullPath, iid, }, update(data) { @@ -335,7 +335,6 @@ export default { /> <work-item-children-wrapper :children="children" - :project-path="projectPath" :can-update="canUpdate" :work-item-id="issuableGid" @removeChild="removeChild" diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue index af475496075..51c83784d06 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue @@ -41,7 +41,7 @@ export default { GlFormCheckbox, GlTooltip, }, - inject: ['projectPath', 'hasIterationsFeature'], + inject: ['fullPath', 'hasIterationsFeature'], props: { issuableGid: { type: String, @@ -88,7 +88,7 @@ export default { query: projectWorkItemTypesQuery, variables() { return { - fullPath: this.projectPath, + fullPath: this.fullPath, }; }, update(data) { @@ -99,7 +99,7 @@ export default { query: projectWorkItemsQuery, variables() { return { - projectPath: this.projectPath, + fullPath: this.fullPath, searchTerm: this.search?.title || this.search, types: [this.childrenType], in: this.search ? 'TITLE' : undefined, @@ -131,7 +131,7 @@ export default { workItemInput() { let workItemInput = { title: this.search?.title || this.search, - projectPath: this.projectPath, + projectPath: this.fullPath, workItemTypeId: this.childWorkItemType, hierarchyWidget: { parentId: this.issuableGid, diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_tree.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_tree.vue index 4dcc4d51957..cbca78e4b14 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_tree.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_tree.vue @@ -23,6 +23,7 @@ export default { WorkItemLinksForm, WorkItemChildrenWrapper, }, + inject: ['fullPath'], props: { workItemType: { type: String, @@ -57,10 +58,6 @@ export default { required: false, default: false, }, - projectPath: { - type: String, - required: true, - }, }, data() { return { @@ -106,7 +103,7 @@ export default { this.$apollo.addSmartQuery('prefetchedWorkItem', { query: workItemByIidQuery, variables: { - fullPath: this.projectPath, + fullPath: this.fullPath, iid, }, update(data) { @@ -164,7 +161,6 @@ export default { /> <work-item-children-wrapper :children="children" - :project-path="projectPath" :can-update="canUpdate" :work-item-id="workItemId" :work-item-iid="workItemIid" diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_tree_children.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_tree_children.vue index ba5c0794395..121c987da71 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_tree_children.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_tree_children.vue @@ -3,6 +3,7 @@ export default { components: { WorkItemLinkChild: () => import('./work_item_link_child.vue'), }, + inject: ['fullPath'], props: { workItemType: { type: String, @@ -22,10 +23,6 @@ export default { required: false, default: false, }, - projectPath: { - type: String, - required: true, - }, }, }; </script> @@ -35,7 +32,6 @@ export default { <work-item-link-child v-for="child in children" :key="child.id" - :project-path="projectPath" :can-update="canUpdate" :issuable-gid="workItemId" :child-item="child" diff --git a/app/assets/javascripts/work_items/components/work_item_milestone.vue b/app/assets/javascripts/work_items/components/work_item_milestone.vue index 06051eee3a3..693397686d0 100644 --- a/app/assets/javascripts/work_items/components/work_item_milestone.vue +++ b/app/assets/javascripts/work_items/components/work_item_milestone.vue @@ -46,6 +46,7 @@ export default { GlDropdownText, }, mixins: [Tracking.mixin()], + inject: ['fullPath'], props: { workItemId: { type: String, @@ -66,10 +67,6 @@ export default { required: false, default: false, }, - fullPath: { - type: String, - required: true, - }, }, data() { return { diff --git a/app/assets/javascripts/work_items/components/work_item_notes.vue b/app/assets/javascripts/work_items/components/work_item_notes.vue index 42afde76a00..092b90a5731 100644 --- a/app/assets/javascripts/work_items/components/work_item_notes.vue +++ b/app/assets/javascripts/work_items/components/work_item_notes.vue @@ -45,6 +45,7 @@ export default { WorkItemNotesActivityHeader, WorkItemHistoryOnlyFilterNote, }, + inject: ['fullPath'], props: { workItemId: { type: String, @@ -54,14 +55,6 @@ export default { type: String, required: true, }, - queryVariables: { - type: Object, - required: true, - }, - fullPath: { - type: String, - required: true, - }, workItemType: { type: String, required: true, @@ -122,9 +115,9 @@ export default { }, workItemCommentFormProps() { return { - queryVariables: this.queryVariables, fullPath: this.fullPath, workItemId: this.workItemId, + workItemIid: this.workItemIid, workItemType: this.workItemType, sortOrder: this.sortOrder, isNewDiscussion: true, @@ -169,7 +162,8 @@ export default { }, variables() { return { - ...this.queryVariables, + fullPath: this.fullPath, + iid: this.workItemIid, after: this.after, pageSize: DEFAULT_PAGE_SIZE_NOTES, }; @@ -179,7 +173,7 @@ export default { return widgets?.find((widget) => widget.type === 'NOTES')?.discussions || []; }, skip() { - return !this.queryVariables.iid; + return !this.workItemIid; }, error() { this.$emit('error', i18n.fetchError); @@ -264,7 +258,8 @@ export default { await this.$apollo.queries.workItemNotes .fetchMore({ variables: { - ...this.queryVariables, + fullPath: this.fullPath, + iid: this.workItemIid, after: this.pageInfo?.endCursor, }, }) @@ -359,9 +354,8 @@ export default { <work-item-discussion :key="getDiscussionKey(discussion)" :discussion="discussion.notes.nodes" - :query-variables="queryVariables" - :full-path="fullPath" :work-item-id="workItemId" + :work-item-iid="workItemIid" :work-item-type="workItemType" :is-modal="isModal" :autocomplete-data-sources="autocompleteDataSources" diff --git a/app/assets/javascripts/work_items/graphql/project_work_items.query.graphql b/app/assets/javascripts/work_items/graphql/project_work_items.query.graphql index fce10f6f2a6..7d63af448d4 100644 --- a/app/assets/javascripts/work_items/graphql/project_work_items.query.graphql +++ b/app/assets/javascripts/work_items/graphql/project_work_items.query.graphql @@ -1,10 +1,10 @@ query projectWorkItems( $searchTerm: String - $projectPath: ID! + $fullPath: ID! $types: [IssueType!] $in: [IssuableSearchableField!] ) { - workspace: project(fullPath: $projectPath) { + workspace: project(fullPath: $fullPath) { id workItems(search: $searchTerm, types: $types, in: $in) { nodes { diff --git a/app/assets/javascripts/work_items/index.js b/app/assets/javascripts/work_items/index.js index eb37336bbf9..70bda7d3783 100644 --- a/app/assets/javascripts/work_items/index.js +++ b/app/assets/javascripts/work_items/index.js @@ -29,7 +29,6 @@ export const initWorkItemsRoot = () => { apolloProvider, provide: { fullPath, - projectPath: fullPath, hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature), hasOkrsFeature: parseBoolean(hasOkrsFeature), issuesListPath, |