Skip to content

Commit

Permalink
Merge pull request #233 from uselagoon/env_order_by_name
Browse files Browse the repository at this point in the history
Order environments by name
  • Loading branch information
tobybellwood authored Apr 1, 2024
2 parents b6b64d6 + 81f97dc commit e35798e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ export const PageProject = ({ router }) => {
}
// Sort alphabetically by environmentType and then deployType
const environments = R.sortWith(
[R.descend(R.prop('environmentType')), R.ascend(R.prop('deployType'))],
[
R.descend(R.prop('environmentType')),
R.ascend(R.prop('deployType')),
R.ascend(env => (env.deployType === 'branch' ? env.name : null)),
],
project.environments
);
const environmentCount = environments.length;
Expand Down

0 comments on commit e35798e

Please sign in to comment.