Commit addad0cc authored by Adam Hegyi's avatar Adam Hegyi

Avoid sorting CA stages in JS

The backend endpoint already sorts them.
parent 4372a6c9
......@@ -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