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,17 +67,15 @@ const stageUrlSlug = ({ id, title, custom = false }) => {
};
export const transformRawStages = (stages = []) =>
stages
.map(({ id, title, name = '', custom = false, ...rest }) => ({
...convertObjectPropsToCamelCase(rest, { deep: true }),
id,
title,
custom,
slug: isPersistedStage({ custom, id }) ? id : stageUrlSlug({ custom, id, title }),
// the name field is used to create a stage, but the get request returns title
name: name.length ? name : title,
}))
.sort((a, b) => a.id > b.id);
stages.map(({ id, title, name = '', custom = false, ...rest }) => ({
...convertObjectPropsToCamelCase(rest, { deep: true }),
id,
title,
custom,
slug: isPersistedStage({ custom, id }) ? id : stageUrlSlug({ custom, id, title }),
// the name field is used to create a stage, but the get request returns title
name: name.length ? name : title,
}));
export const nestQueryStringKeys = (obj = null, targetKey = '') => {
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