Skip to content

Commit

Permalink
stable colors for master, main, development, develop, dev, stage and …
Browse files Browse the repository at this point in the history
…staging
  • Loading branch information
phil294 committed May 1, 2023
1 parent 54867bd commit 1a8f4a7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions web/src/views/log-utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,16 @@ parse = (data, separator) =>
branch
}

for branch, i in branches
# cannot do this at creation because branches list is not fixed before this (see wrong_branch)
branch.color = colors[i % (colors.length - 1)]
# cannot do this at creation because branches list is not fixed before this (see wrong_branch)
i = -1
for branch from branches
branch.color = switch branch.name
when 'master', 'main' then '#ff3333'
when 'development', 'develop', 'dev' then '#009000'
when 'stage', 'staging' then '#d7d700'
else
i++
colors[i % (colors.length - 1)]

branches = branches
.filter (branch) =>
Expand Down

0 comments on commit 1a8f4a7

Please sign in to comment.