Skip to content

Commit

Permalink
[#1468] Dashboard loading empty if base URL is given (#1469)
Browse files Browse the repository at this point in the history
Repositories with more than 19 different types of files will crash,
which can be traced from line 448 of `v_summary.js`.

Bug is caused by a function not being copied properly in #1421,
leading to an undefined function call.

Let's copy the function over properly.
  • Loading branch information
gerhean authored Mar 8, 2021
1 parent e478bb3 commit 3973bf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion frontend/src/static/js/utils/ramp_colour_generator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// eslint-disable-next-line new-cap
const randomGenerator = new Math.seedrandom('Seeded Random Generator');

function getRandomHex() {
const maxHexColorValue = 16777214;
// excludes #000000 and #FFFFFF as they are reserved
return `#${Math.round(this.randomGenerator() * maxHexColorValue + 1).toString(16).padStart(6, '0')}`;
return `#${Math.round(randomGenerator() * maxHexColorValue + 1).toString(16).padStart(6, '0')}`;
}

function rgb2lab(rgb) {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/static/js/v_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ window.vSummary = {
maxDate: '',
fileTypeColors: {},
isSafariBrowser: /.*Version.*Safari.*/.test(navigator.userAgent),
// eslint-disable-next-line new-cap
randomGenerator: new Math.seedrandom('Seeded Random Generator'),
filterGroupSelectionWatcherFlag: false,
};
},
Expand Down

0 comments on commit 3973bf0

Please sign in to comment.