Commit a04e6dd7 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '37358-avoid-sorting-ca-stages-on-fe' into 'master'

Avoid sorting CA stages in JS

Closes #37358

See merge request gitlab-org/gitlab!22541
parents 71e0fb5d addad0cc
...@@ -67,8 +67,7 @@ const stageUrlSlug = ({ id, title, custom = false }) => { ...@@ -67,8 +67,7 @@ const stageUrlSlug = ({ id, title, custom = false }) => {
}; };
export const transformRawStages = (stages = []) => export const transformRawStages = (stages = []) =>
stages stages.map(({ id, title, name = '', custom = false, ...rest }) => ({
.map(({ id, title, name = '', custom = false, ...rest }) => ({
...convertObjectPropsToCamelCase(rest, { deep: true }), ...convertObjectPropsToCamelCase(rest, { deep: true }),
id, id,
title, title,
...@@ -76,8 +75,7 @@ export const transformRawStages = (stages = []) => ...@@ -76,8 +75,7 @@ export const transformRawStages = (stages = []) =>
slug: isPersistedStage({ custom, id }) ? id : stageUrlSlug({ custom, id, title }), slug: isPersistedStage({ custom, id }) ? id : stageUrlSlug({ custom, id, title }),
// the name field is used to create a stage, but the get request returns title // the name field is used to create a stage, but the get request returns title
name: name.length ? name : title, name: name.length ? name : title,
})) }));
.sort((a, b) => a.id > b.id);
export const nestQueryStringKeys = (obj = null, targetKey = '') => { export const nestQueryStringKeys = (obj = null, targetKey = '') => {
if (!obj || !isString(targetKey) || !targetKey.length) return {}; if (!obj || !isString(targetKey) || !targetKey.length) return {};
......
---
title: Fix initial sorting of non-persisted Cycle Analytics stages
merge_request: 22541
author:
type: fixed
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