diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-14 15:10:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-14 15:10:37 +0300 |
commit | 89a0c1fa668ec9af6e7cc39935199f24dbee23b6 (patch) | |
tree | cbc83b998450c3cad752abc9450f211e084bba58 /app | |
parent | 3c0faf1c6b40536c7b7687225ff4e03e884192d5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
25 files changed, 218 insertions, 206 deletions
diff --git a/app/assets/javascripts/environments/helpers/k8s_integration_helper.js b/app/assets/javascripts/environments/helpers/k8s_integration_helper.js index 5813ce488ff..bb5cab7c279 100644 --- a/app/assets/javascripts/environments/helpers/k8s_integration_helper.js +++ b/app/assets/javascripts/environments/helpers/k8s_integration_helper.js @@ -1,6 +1,7 @@ import { calculateDeploymentStatus, calculateStatefulSetStatus, + calculateDaemonSetStatus, } from '~/kubernetes_dashboard/helpers/k8s_integration_helper'; import { STATUS_READY, STATUS_FAILED } from '~/kubernetes_dashboard/constants'; import { CLUSTER_AGENT_ERROR_MESSAGES } from '../constants'; @@ -46,16 +47,10 @@ export function getDeploymentsStatuses(items) { export function getDaemonSetStatuses(items) { const failed = items.filter((item) => { - return ( - item.status?.numberMisscheduled > 0 || - item.status?.numberReady !== item.status?.desiredNumberScheduled - ); + return calculateDaemonSetStatus(item) === STATUS_FAILED; }); const ready = items.filter((item) => { - return ( - item.status?.numberReady === item.status?.desiredNumberScheduled && - !item.status?.numberMisscheduled - ); + return calculateDaemonSetStatus(item) === STATUS_READY; }); return { diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index be76ce2c28b..b11f7b1ba76 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -289,7 +289,7 @@ class GfmAutoComplete { displayTpl({ name }) { const reviewState = REVIEW_STATES[name]; - return `<li><span class="gl-font-weight-bold gl-display-block">${reviewState.header}</span><small class="description gl-display-block gl-w-full gl-float-left! gl-px-0!">${reviewState.description}</small></li>`; + return `<li><span class="name gl-font-weight-bold">${reviewState.header}</span><small class="description"><em>${reviewState.description}</em></small></li>`; }, }); } diff --git a/app/assets/javascripts/kubernetes_dashboard/graphql/client.js b/app/assets/javascripts/kubernetes_dashboard/graphql/client.js index e4f0c7ee344..5894472d83b 100644 --- a/app/assets/javascripts/kubernetes_dashboard/graphql/client.js +++ b/app/assets/javascripts/kubernetes_dashboard/graphql/client.js @@ -5,6 +5,7 @@ import k8sPodsQuery from './queries/k8s_dashboard_pods.query.graphql'; import k8sDeploymentsQuery from './queries/k8s_dashboard_deployments.query.graphql'; import k8sStatefulSetsQuery from './queries/k8s_dashboard_stateful_sets.query.graphql'; import k8sReplicaSetsQuery from './queries/k8s_dashboard_replica_sets.query.graphql'; +import k8sDaemonSetsQuery from './queries/k8s_dashboard_daemon_sets.query.graphql'; import { resolvers } from './resolvers'; export const apolloProvider = () => { @@ -83,6 +84,24 @@ export const apolloProvider = () => { }, }); + cache.writeQuery({ + query: k8sDaemonSetsQuery, + data: { + metadata: { + name: null, + namespace: null, + creationTimestamp: null, + labels: null, + annotations: null, + }, + status: { + numberMisscheduled: null, + numberReady: null, + desiredNumberScheduled: null, + }, + }, + }); + return new VueApollo({ defaultClient, }); diff --git a/app/assets/javascripts/kubernetes_dashboard/graphql/queries/k8s_dashboard_daemon_sets.query.graphql b/app/assets/javascripts/kubernetes_dashboard/graphql/queries/k8s_dashboard_daemon_sets.query.graphql new file mode 100644 index 00000000000..4469c7a161a --- /dev/null +++ b/app/assets/javascripts/kubernetes_dashboard/graphql/queries/k8s_dashboard_daemon_sets.query.graphql @@ -0,0 +1,16 @@ +query getK8sDashboardDaemonSets($configuration: LocalConfiguration) { + k8sDaemonSets(configuration: $configuration) @client { + metadata { + name + namespace + creationTimestamp + labels + annotations + } + status { + numberMisscheduled + numberReady + desiredNumberScheduled + } + } +} diff --git a/app/assets/javascripts/kubernetes_dashboard/graphql/resolvers/kubernetes.js b/app/assets/javascripts/kubernetes_dashboard/graphql/resolvers/kubernetes.js index 818295dab07..e59bed5581b 100644 --- a/app/assets/javascripts/kubernetes_dashboard/graphql/resolvers/kubernetes.js +++ b/app/assets/javascripts/kubernetes_dashboard/graphql/resolvers/kubernetes.js @@ -12,6 +12,7 @@ import k8sDashboardPodsQuery from '../queries/k8s_dashboard_pods.query.graphql'; import k8sDashboardDeploymentsQuery from '../queries/k8s_dashboard_deployments.query.graphql'; import k8sDashboardStatefulSetsQuery from '../queries/k8s_dashboard_stateful_sets.query.graphql'; import k8sDashboardReplicaSetsQuery from '../queries/k8s_dashboard_replica_sets.query.graphql'; +import k8sDaemonSetsQuery from '../queries/k8s_dashboard_daemon_sets.query.graphql'; export default { k8sPods(_, { configuration }, { client }) { @@ -129,4 +130,40 @@ export default { } }); }, + + k8sDaemonSets(_, { configuration, namespace = '' }, { client }) { + const config = new Configuration(configuration); + + const appsV1api = new AppsV1Api(config); + const deploymentsApi = namespace + ? appsV1api.listAppsV1NamespacedDaemonSet({ namespace }) + : appsV1api.listAppsV1DaemonSetForAllNamespaces(); + return deploymentsApi + .then((res) => { + const watchPath = buildWatchPath({ + resource: 'daemonsets', + api: 'apis/apps/v1', + namespace, + }); + watchWorkloadItems({ + client, + query: k8sDaemonSetsQuery, + configuration, + namespace, + watchPath, + queryField: 'k8sDaemonSets', + }); + + const data = res?.items || []; + + return data.map(mapWorkloadItem); + }) + .catch(async (err) => { + try { + await handleClusterError(err); + } catch (error) { + throw new Error(error.message); + } + }); + }, }; diff --git a/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js b/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js index 17f1ebdc013..24f43e21506 100644 --- a/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js +++ b/app/assets/javascripts/kubernetes_dashboard/helpers/k8s_integration_helper.js @@ -48,3 +48,13 @@ export function calculateStatefulSetStatus(item) { } return STATUS_FAILED; } + +export function calculateDaemonSetStatus(item) { + if ( + item.status?.numberReady === item.status?.desiredNumberScheduled && + !item.status?.numberMisscheduled + ) { + return STATUS_READY; + } + return STATUS_FAILED; +} diff --git a/app/assets/javascripts/kubernetes_dashboard/pages/daemon_sets_page.vue b/app/assets/javascripts/kubernetes_dashboard/pages/daemon_sets_page.vue new file mode 100644 index 00000000000..bdde4e89f34 --- /dev/null +++ b/app/assets/javascripts/kubernetes_dashboard/pages/daemon_sets_page.vue @@ -0,0 +1,80 @@ +<script> +import { s__ } from '~/locale'; +import { getAge, calculateDaemonSetStatus } from '../helpers/k8s_integration_helper'; +import WorkloadLayout from '../components/workload_layout.vue'; +import k8sDaemonSetsQuery from '../graphql/queries/k8s_dashboard_daemon_sets.query.graphql'; +import { STATUS_FAILED, STATUS_READY, STATUS_LABELS } from '../constants'; + +export default { + components: { + WorkloadLayout, + }, + inject: ['configuration'], + apollo: { + k8sDaemonSets: { + query: k8sDaemonSetsQuery, + variables() { + return { + configuration: this.configuration, + }; + }, + update(data) { + return ( + data?.k8sDaemonSets?.map((daemonSet) => { + return { + name: daemonSet.metadata?.name, + namespace: daemonSet.metadata?.namespace, + status: calculateDaemonSetStatus(daemonSet), + age: getAge(daemonSet.metadata?.creationTimestamp), + labels: daemonSet.metadata?.labels, + annotations: daemonSet.metadata?.annotations, + kind: s__('KubernetesDashboard|DaemonSet'), + }; + }) || [] + ); + }, + error(err) { + this.errorMessage = err?.message; + }, + }, + }, + data() { + return { + k8sDaemonSets: [], + errorMessage: '', + }; + }, + computed: { + daemonSetsStats() { + return [ + { + value: this.countDaemonSetsByStatus(STATUS_READY), + title: STATUS_LABELS[STATUS_READY], + }, + { + value: this.countDaemonSetsByStatus(STATUS_FAILED), + title: STATUS_LABELS[STATUS_FAILED], + }, + ]; + }, + loading() { + return this.$apollo.queries.k8sDaemonSets.loading; + }, + }, + methods: { + countDaemonSetsByStatus(status) { + const filteredDaemonSets = this.k8sDaemonSets.filter((item) => item.status === status) || []; + + return filteredDaemonSets.length; + }, + }, +}; +</script> +<template> + <workload-layout + :loading="loading" + :error-message="errorMessage" + :stats="daemonSetsStats" + :items="k8sDaemonSets" + /> +</template> diff --git a/app/assets/javascripts/kubernetes_dashboard/router/constants.js b/app/assets/javascripts/kubernetes_dashboard/router/constants.js index daa2bd6075b..700f501ade4 100644 --- a/app/assets/javascripts/kubernetes_dashboard/router/constants.js +++ b/app/assets/javascripts/kubernetes_dashboard/router/constants.js @@ -2,8 +2,10 @@ export const PODS_ROUTE_NAME = 'pods'; export const DEPLOYMENTS_ROUTE_NAME = 'deployments'; export const STATEFUL_SETS_ROUTE_NAME = 'statefulSets'; export const REPLICA_SETS_ROUTE_NAME = 'replicaSets'; +export const DAEMON_SETS_ROUTE_NAME = 'daemonSets'; export const PODS_ROUTE_PATH = '/pods'; export const DEPLOYMENTS_ROUTE_PATH = '/deployments'; export const STATEFUL_SETS_ROUTE_PATH = '/statefulsets'; export const REPLICA_SETS_ROUTE_PATH = '/replicasets'; +export const DAEMON_SETS_ROUTE_PATH = '/daemonsets'; diff --git a/app/assets/javascripts/kubernetes_dashboard/router/routes.js b/app/assets/javascripts/kubernetes_dashboard/router/routes.js index ee5afcef14f..a1684a62ca4 100644 --- a/app/assets/javascripts/kubernetes_dashboard/router/routes.js +++ b/app/assets/javascripts/kubernetes_dashboard/router/routes.js @@ -3,6 +3,7 @@ import PodsPage from '../pages/pods_page.vue'; import DeploymentsPage from '../pages/deployments_page.vue'; import StatefulSetsPage from '../pages/stateful_sets_page.vue'; import ReplicaSetsPage from '../pages/replica_sets_page.vue'; +import DaemonSetsPage from '../pages/daemon_sets_page.vue'; import { PODS_ROUTE_NAME, PODS_ROUTE_PATH, @@ -12,6 +13,8 @@ import { STATEFUL_SETS_ROUTE_PATH, REPLICA_SETS_ROUTE_NAME, REPLICA_SETS_ROUTE_PATH, + DAEMON_SETS_ROUTE_NAME, + DAEMON_SETS_ROUTE_PATH, } from './constants'; export default [ @@ -47,4 +50,12 @@ export default [ title: s__('KubernetesDashboard|ReplicaSets'), }, }, + { + name: DAEMON_SETS_ROUTE_NAME, + path: DAEMON_SETS_ROUTE_PATH, + component: DaemonSetsPage, + meta: { + title: s__('KubernetesDashboard|DaemonSets'), + }, + }, ]; diff --git a/app/assets/javascripts/search/topbar/components/app.vue b/app/assets/javascripts/search/topbar/components/app.vue index 555892659fd..adf695afb0c 100644 --- a/app/assets/javascripts/search/topbar/components/app.vue +++ b/app/assets/javascripts/search/topbar/components/app.vue @@ -69,9 +69,15 @@ export default { <template> <section> - <div class="gl-lg-display-flex gl-flex-direction-row gl-justify-content-space-between gl-pt-5"> + <div + class="gl-lg-display-flex gl-flex-direction-row gl-py-5" + :class="{ + 'gl-justify-content-space-between': showSyntaxOptions, + 'gl-justify-content-end': !showSyntaxOptions, + }" + > <template v-if="showSyntaxOptions"> - <div class="gl-pb-6"> + <div> <gl-button category="tertiary" variant="link" diff --git a/app/assets/javascripts/work_items/components/update_work_item.js b/app/assets/javascripts/work_items/components/update_work_item.js deleted file mode 100644 index fc395fa5be3..00000000000 --- a/app/assets/javascripts/work_items/components/update_work_item.js +++ /dev/null @@ -1,23 +0,0 @@ -import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; -import updateWorkItemTaskMutation from '../graphql/update_work_item_task.mutation.graphql'; - -export function getUpdateWorkItemMutation({ input, workItemParentId }) { - let mutation = updateWorkItemMutation; - - const variables = { - input, - }; - - if (workItemParentId) { - mutation = updateWorkItemTaskMutation; - variables.input = { - id: workItemParentId, - taskData: input, - }; - } - - return { - mutation, - variables, - }; -} diff --git a/app/assets/javascripts/work_items/components/work_item_actions.vue b/app/assets/javascripts/work_items/components/work_item_actions.vue index 0a71fbc9a34..013c9f229ec 100644 --- a/app/assets/javascripts/work_items/components/work_item_actions.vue +++ b/app/assets/javascripts/work_items/components/work_item_actions.vue @@ -134,11 +134,6 @@ export default { required: false, default: false, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, }, apollo: { workItemTypes: { @@ -328,7 +323,6 @@ export default { :data-testid="$options.stateToggleTestId" :work-item-id="workItemId" :work-item-state="workItemState" - :work-item-parent-id="workItemParentId" :work-item-type="workItemType" show-as-dropdown-item /> diff --git a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue index 02585bb8a3e..b7206d502a6 100644 --- a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue +++ b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue @@ -1,7 +1,6 @@ <script> import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { - sprintfWorkItem, WIDGET_TYPE_ASSIGNEES, WIDGET_TYPE_HEALTH_STATUS, WIDGET_TYPE_HIERARCHY, @@ -51,11 +50,6 @@ export default { type: Object, required: true, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, }, computed: { workItemType() { @@ -67,15 +61,6 @@ export default { canDelete() { return this.workItem?.userPermissions?.deleteWorkItem; }, - canSetWorkItemMetadata() { - return this.workItem?.userPermissions?.setWorkItemMetadata; - }, - canAssignUnassignUser() { - return this.workItemAssignees && this.canSetWorkItemMetadata; - }, - confidentialTooltip() { - return sprintfWorkItem(this.$options.i18n.confidentialTooltip, this.workItemType); - }, workItemAssignees() { return this.isWidgetPresent(WIDGET_TYPE_ASSIGNEES); }, 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 ad9eb936d85..b74cbc85379 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -17,7 +17,6 @@ import { WIDGET_TYPE_DESCRIPTION, WIDGET_TYPE_AWARD_EMOJI, WIDGET_TYPE_HIERARCHY, - WORK_ITEM_TYPE_VALUE_ISSUE, WORK_ITEM_TYPE_VALUE_OBJECTIVE, WIDGET_TYPE_NOTES, WIDGET_TYPE_LINKED_ITEMS, @@ -25,7 +24,6 @@ import { import workItemUpdatedSubscription from '../graphql/work_item_updated.subscription.graphql'; import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; -import updateWorkItemTaskMutation from '../graphql/update_work_item_task.mutation.graphql'; import groupWorkItemByIidQuery from '../graphql/group_work_item_by_iid.query.graphql'; import workItemByIidQuery from '../graphql/work_item_by_iid.query.graphql'; import { findHierarchyWidgetChildren } from '../utils'; @@ -83,11 +81,6 @@ export default { required: false, default: null, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, }, data() { return { @@ -163,9 +156,6 @@ export default { workItemTypeId() { return this.workItem.workItemType?.id; }, - workItemBreadcrumbReference() { - return this.workItemType ? `#${this.workItem.iid}` : ''; - }, canUpdate() { return this.workItem.userPermissions?.updateWorkItem; }, @@ -184,26 +174,9 @@ export default { parentWorkItem() { return this.isWidgetPresent(WIDGET_TYPE_HIERARCHY)?.parent; }, - parentWorkItemType() { - return this.parentWorkItem?.workItemType?.name; - }, - parentWorkItemIconName() { - return this.parentWorkItem?.workItemType?.iconName; - }, parentWorkItemConfidentiality() { return this.parentWorkItem?.confidential; }, - parentWorkItemReference() { - return this.parentWorkItem ? `${this.parentWorkItem.title} #${this.parentWorkItem.iid}` : ''; - }, - parentUrl() { - // Once more types are moved to have Work Items involved - // we need to handle this properly. - if (this.parentWorkItemType === WORK_ITEM_TYPE_VALUE_ISSUE) { - return `../../-/issues/${this.parentWorkItem?.iid}`; - } - return this.parentWorkItem?.webUrl; - }, workItemIconName() { return this.workItem.workItemType?.iconName; }, @@ -290,34 +263,21 @@ export default { }, toggleConfidentiality(confidentialStatus) { this.updateInProgress = true; - let updateMutation = updateWorkItemMutation; - let inputVariables = { - id: this.workItem.id, - confidential: confidentialStatus, - }; - - if (this.parentWorkItem) { - updateMutation = updateWorkItemTaskMutation; - inputVariables = { - id: this.parentWorkItem.id, - taskData: { - id: this.workItem.id, - confidential: confidentialStatus, - }, - }; - } this.$apollo .mutate({ - mutation: updateMutation, + mutation: updateWorkItemMutation, variables: { - input: inputVariables, + input: { + id: this.workItem.id, + confidential: confidentialStatus, + }, }, }) .then( ({ data: { - workItemUpdate: { errors, workItem, task }, + workItemUpdate: { errors, workItem }, }, }) => { if (errors?.length) { @@ -325,7 +285,7 @@ export default { } this.$emit('workItemUpdated', { - confidential: workItem?.confidential || task?.confidential, + confidential: workItem?.confidential, }); }, ) @@ -435,7 +395,6 @@ export default { :work-item-id="workItem.id" :work-item-title="workItem.title" :work-item-type="workItemType" - :work-item-parent-id="workItemParentId" :can-update="canUpdate" @error="updateError = $event" /> @@ -465,7 +424,6 @@ export default { :work-item-create-note-email="workItem.createNoteEmail" :is-modal="isModal" :work-item-state="workItem.state" - :work-item-parent-id="workItemParentId" @deleteWorkItem="$emit('deleteWorkItem', { workItemType, workItemId: workItem.id })" @toggleWorkItemConfidentiality="toggleConfidentiality" @error="updateError = $event" @@ -490,7 +448,6 @@ export default { :work-item-id="workItem.id" :work-item-title="workItem.title" :work-item-type="workItemType" - :work-item-parent-id="workItemParentId" :can-update="canUpdate" :use-h1="!isModal" @error="updateError = $event" @@ -511,7 +468,6 @@ export default { :is-modal="isModal" :work-item="workItem" :is-sticky-header-showing="isStickyHeaderShowing" - :work-item-parent-id="workItemParentId" :work-item-notifications-subscribed="workItemNotificationsSubscribed" @hideStickyHeader="hideStickyHeader" @showStickyHeader="showStickyHeader" @@ -530,7 +486,6 @@ export default { class="gl-border-b" :full-path="fullPath" :work-item="workItem" - :work-item-parent-id="workItemParentId" @error="updateError = $event" /> <work-item-description @@ -605,7 +560,6 @@ export default { <work-item-attributes-wrapper :full-path="fullPath" :work-item="workItem" - :work-item-parent-id="workItemParentId" @error="updateError = $event" /> </aside> diff --git a/app/assets/javascripts/work_items/components/work_item_state_toggle.vue b/app/assets/javascripts/work_items/components/work_item_state_toggle.vue index 581ef9ec945..69752967efe 100644 --- a/app/assets/javascripts/work_items/components/work_item_state_toggle.vue +++ b/app/assets/javascripts/work_items/components/work_item_state_toggle.vue @@ -3,7 +3,6 @@ import { GlButton, GlDisclosureDropdownItem, GlLoadingIcon } from '@gitlab/ui'; import * as Sentry from '~/sentry/sentry_browser_wrapper'; import Tracking from '~/tracking'; import { __ } from '~/locale'; -import { getUpdateWorkItemMutation } from '~/work_items/components/update_work_item'; import { sprintfWorkItem, I18N_WORK_ITEM_ERROR_UPDATING, @@ -12,6 +11,7 @@ import { STATE_EVENT_REOPEN, TRACKING_CATEGORY_SHOW, } from '../constants'; +import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; export default { components: { @@ -33,11 +33,6 @@ export default { type: String, required: true, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, showAsDropdownItem: { type: Boolean, required: false, @@ -75,24 +70,19 @@ export default { }, methods: { async updateWorkItem() { - const input = { - id: this.workItemId, - stateEvent: this.isWorkItemOpen ? STATE_EVENT_CLOSE : STATE_EVENT_REOPEN, - }; - this.updateInProgress = true; try { this.track('updated_state'); - const { mutation, variables } = getUpdateWorkItemMutation({ - workItemParentId: this.workItemParentId, - input, - }); - const { data } = await this.$apollo.mutate({ - mutation, - variables, + mutation: updateWorkItemMutation, + variables: { + input: { + id: this.workItemId, + stateEvent: this.isWorkItemOpen ? STATE_EVENT_CLOSE : STATE_EVENT_REOPEN, + }, + }, }); const errors = data.workItemUpdate?.errors; @@ -102,7 +92,6 @@ export default { } } catch (error) { const msg = sprintfWorkItem(I18N_WORK_ITEM_ERROR_UPDATING, this.workItemType); - this.$emit('error', msg); Sentry.captureException(error); } diff --git a/app/assets/javascripts/work_items/components/work_item_sticky_header.vue b/app/assets/javascripts/work_items/components/work_item_sticky_header.vue index ec6d2c21748..523b145d9ef 100644 --- a/app/assets/javascripts/work_items/components/work_item_sticky_header.vue +++ b/app/assets/javascripts/work_items/components/work_item_sticky_header.vue @@ -30,11 +30,6 @@ export default { type: Boolean, required: true, }, - workItemParentId: { - type: String, - required: false, - default: null, - }, updateInProgress: { type: Boolean, required: false, @@ -126,7 +121,6 @@ export default { :work-item-reference="workItem.reference" :work-item-create-note-email="workItem.createNoteEmail" :work-item-state="workItem.state" - :work-item-parent-id="workItemParentId" :is-modal="isModal" @deleteWorkItem="$emit('deleteWorkItem')" @toggleWorkItemConfidentiality=" diff --git a/app/assets/javascripts/work_items/components/work_item_title.vue b/app/assets/javascripts/work_items/components/work_item_title.vue index 8bdf616cf47..0be57e291f4 100644 --- a/app/assets/javascripts/work_items/components/work_item_title.vue +++ b/app/assets/javascripts/work_items/components/work_item_title.vue @@ -8,7 +8,7 @@ import { WORK_ITEM_TITLE_MAX_LENGTH, I18N_MAX_CHARS_IN_WORK_ITEM_TITLE_MESSAGE, } from '../constants'; -import { getUpdateWorkItemMutation } from './update_work_item'; +import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; import ItemTitle from './item_title.vue'; export default { @@ -32,11 +32,6 @@ export default { required: false, default: '', }, - workItemParentId: { - type: String, - required: false, - default: null, - }, canUpdate: { type: Boolean, required: false, @@ -68,24 +63,19 @@ export default { return; } - const input = { - id: this.workItemId, - title: updatedTitle, - }; - this.updateInProgress = true; try { this.track('updated_title'); - const { mutation, variables } = getUpdateWorkItemMutation({ - workItemParentId: this.workItemParentId, - input, - }); - const { data } = await this.$apollo.mutate({ - mutation, - variables, + mutation: updateWorkItemMutation, + variables: { + input: { + id: this.workItemId, + title: updatedTitle, + }, + }, }); const errors = data.workItemUpdate?.errors; diff --git a/app/assets/javascripts/work_items/constants.js b/app/assets/javascripts/work_items/constants.js index daa72204609..4f8b7fadb28 100644 --- a/app/assets/javascripts/work_items/constants.js +++ b/app/assets/javascripts/work_items/constants.js @@ -54,9 +54,6 @@ export const i18n = { "WorkItem|This work item is not available. It either doesn't exist or you don't have permission to view it.", ), updateError: s__('WorkItem|Something went wrong while updating the work item. Please try again.'), - confidentialTooltip: s__( - 'WorkItem|Only project members with at least the Reporter role, the author, and assignees can view or be notified about this %{workItemType}.', - ), }; export const I18N_WORK_ITEM_ERROR_FETCHING_LABELS = s__( diff --git a/app/assets/javascripts/work_items/graphql/create_work_item_from_task.mutation.graphql b/app/assets/javascripts/work_items/graphql/create_work_item_from_task.mutation.graphql deleted file mode 100644 index ccfe62cc585..00000000000 --- a/app/assets/javascripts/work_items/graphql/create_work_item_from_task.mutation.graphql +++ /dev/null @@ -1,13 +0,0 @@ -#import "./work_item.fragment.graphql" - -mutation workItemCreateFromTask($input: WorkItemCreateFromTaskInput!) { - workItemCreateFromTask(input: $input) { - workItem { - ...WorkItem - } - newWorkItem { - ...WorkItem - } - errors - } -} diff --git a/app/assets/javascripts/work_items/graphql/update_work_item_task.mutation.graphql b/app/assets/javascripts/work_items/graphql/update_work_item_task.mutation.graphql deleted file mode 100644 index f25828e36de..00000000000 --- a/app/assets/javascripts/work_items/graphql/update_work_item_task.mutation.graphql +++ /dev/null @@ -1,14 +0,0 @@ -#import "./work_item.fragment.graphql" - -mutation workItemUpdateTask($input: WorkItemUpdateTaskInput!) { - workItemUpdate: workItemUpdateTask(input: $input) { - errors - workItem { - id - descriptionHtml - } - task { - ...WorkItem - } - } -} diff --git a/app/assets/stylesheets/page_bundles/profile.scss b/app/assets/stylesheets/page_bundles/profile.scss index 2c08db048fd..9a8eeb9c9d6 100644 --- a/app/assets/stylesheets/page_bundles/profile.scss +++ b/app/assets/stylesheets/page_bundles/profile.scss @@ -234,7 +234,7 @@ color: $skype; } -.twitter-icon { +.x-icon { color: var(--gl-text-color, $gl-text-color); } diff --git a/app/models/issue.rb b/app/models/issue.rb index d0d8abffdd8..1c9a8d65e3d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -65,24 +65,7 @@ class Issue < ApplicationRecord belongs_to :moved_to, class_name: 'Issue', inverse_of: :moved_from has_one :moved_from, class_name: 'Issue', foreign_key: :moved_to_id, inverse_of: :moved_to - has_internal_id :iid, scope: :namespace, track_if: -> { !importing? }, init: ->(issue, scope) do - # we need this init for the case where the IID allocation in internal_ids#last_value - # is higher than the actual issues.max(iid) value for a given project. For instance - # in case of an import where a batch of IIDs may be prealocated - # - # TODO: remove this once the UpdateIssuesInternalIdScope migration completes - if issue - [ - InternalId.where(project: issue.project, usage: :issues).pick(:last_value).to_i, - issue.namespace&.issues&.maximum(:iid).to_i - ].max - else - [ - InternalId.where(**scope, usage: :issues).pick(:last_value).to_i, - where(**scope).maximum(:iid).to_i - ].max - end - end + has_internal_id :iid, scope: :namespace, track_if: -> { !importing? } has_many :events, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 1caf0bb5893..e7ebe6d808c 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -23,7 +23,7 @@ - if Feature.enabled?(:restyle_login_page, @project) && Gitlab::CurrentSettings.current_application_settings.terms %p.gl-px-5 - = html_escape(s_("SignUp|By signing in you accept the %{link_start}Terms of Use and acknowledge the Privacy Policy and Cookie Policy%{link_end}.")) % { link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, + = html_escape(s_("SignUp|By signing in you accept the %{link_start}Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}.")) % { link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - if allow_signup? diff --git a/app/views/devise/shared/_terms_of_service_notice.html.haml b/app/views/devise/shared/_terms_of_service_notice.html.haml index c19d64e789d..3749dc66a04 100644 --- a/app/views/devise/shared/_terms_of_service_notice.html.haml +++ b/app/views/devise/shared/_terms_of_service_notice.html.haml @@ -3,15 +3,15 @@ %p.gl-text-gray-500.gl-mt-5.gl-mb-0 - if Feature.enabled?(:restyle_login_page, @project) - if Gitlab.com? - = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the GitLab%{link_start} Terms of Use and acknowledge the Privacy Policy and Cookie Policy%{link_end}")) % { button_text: button_text, + = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the GitLab%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - else - = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the%{link_start} Terms of Use and acknowledge the Privacy Policy and Cookie Policy%{link_end}")) % { button_text: button_text, + = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - else - if Gitlab.com? - = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the GitLab %{link_start}Terms of Use and Privacy Policy%{link_end}")) % { button_text: button_text, + = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the GitLab %{link_start}Terms of Use and Privacy Statement%{link_end}")) % { button_text: button_text, link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - else - = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the %{link_start}Terms of Use and Privacy Policy%{link_end}")) % { button_text: button_text, + = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the %{link_start}Terms of Use and Privacy Statement%{link_end}")) % { button_text: button_text, link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 5e1945b9576..99097ac397c 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -88,7 +88,7 @@ - if @user.twitter.present? = render 'middle_dot_divider', breakpoint: 'sm' do = link_to twitter_url(@user), class: 'gl-hover-text-decoration-none', title: _("X (formerly Twitter)"), target: '_blank', rel: 'noopener noreferrer nofollow' do - = sprite_icon('twitter', css_class: 'twitter-icon') + = sprite_icon('x', css_class: 'x-icon') - if @user.discord.present? = render 'middle_dot_divider', breakpoint: 'sm' do = link_to discord_url(@user), class: 'gl-hover-text-decoration-none', title: "Discord", target: '_blank', rel: 'noopener noreferrer nofollow' do |