Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
76645b00cd63
Commit
76645b00cd63
authored
2 years ago
by
Raphaël Gomès
Browse files
Options
Downloads
Patches
Plain Diff
web-ui: sort results based on rank of Mercurial commit
parent
9b0780bf18eb
No related branches found
No related tags found
No related merge requests found
Pipeline
#55428
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web-ui/src/lib/Graph.svelte
+6
-4
6 additions, 4 deletions
web-ui/src/lib/Graph.svelte
web-ui/src/utils.ts
+4
-0
4 additions, 0 deletions
web-ui/src/utils.ts
with
10 additions
and
4 deletions
web-ui/src/lib/Graph.svelte
+
6
−
4
View file @
76645b00
<script
lang=
"ts"
>
import
Chart
from
"
chart.js/auto
"
;
import
nodemap
from
"
../../../mercurial-mapping.json
"
;
import
{
onMount
}
from
"
svelte
"
;
import
{
COLORS
}
from
"
../config.js
"
;
...
...
@@ -4,6 +3,6 @@
import
{
onMount
}
from
"
svelte
"
;
import
{
COLORS
}
from
"
../config.js
"
;
import
{
getNodeForResult
,
sortVersions
}
from
"
../utils
"
;
import
{
getNodeForResult
,
getRankForResult
,
sortVersions
}
from
"
../utils
"
;
export
let
title
:
string
;
export
let
data
;
...
...
@@ -14,6 +13,9 @@
*/
const
groupResults
=
(
results
)
=>
{
return
results
.
reduce
((
acc
,
result
)
=>
{
if
(
getRankForResult
(
result
)
==
null
)
{
return
acc
;
}
const
dataEnvName
=
result
[
"
data-env-vars
"
][
"
name
"
];
const
key
=
dataEnvName
.
slice
(
dataEnvName
.
split
(
"
-
"
,
1
)[
0
].
length
+
1
)
+
...
...
@@ -38,8 +40,8 @@
).
entries
())
{
const
graphData
=
[];
const
sorted
=
[...
results
].
sort
((
a
,
b
)
=>
{
const
nodeA
=
nodemap
[
getNode
ForResult
(
a
)
]
;
const
nodeB
=
nodemap
[
getNode
ForResult
(
b
)
]
;
const
nodeA
=
getRank
ForResult
(
a
);
const
nodeB
=
getRank
ForResult
(
b
);
return
nodeA
-
nodeB
;
});
for
(
const
result
of
sorted
)
{
...
...
This diff is collapsed.
Click to expand it.
web-ui/src/utils.ts
+
4
−
0
View file @
76645b00
...
...
@@ -54,4 +54,8 @@
export
const
getNodeForResult
=
(
result
)
=>
{
return
result
[
"
bin-env-vars
"
][
"
hg
"
][
"
changeset
"
][
"
node
"
];
};
export
const
getRankForResult
=
(
result
)
=>
{
return
result
[
"
bin-env-vars
"
][
"
hg
"
][
"
changeset
"
][
"
rank
"
];
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment