mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Add statistics pages - fix link caching issue
This commit is contained in:
@@ -88,28 +88,32 @@ export class MenuEffects {
|
|||||||
|
|
||||||
private resolveSubstitutions(object, params) {
|
private resolveSubstitutions(object, params) {
|
||||||
|
|
||||||
|
let resolved;
|
||||||
if (typeof object === 'string') {
|
if (typeof object === 'string') {
|
||||||
|
resolved = object;
|
||||||
let match: RegExpMatchArray;
|
let match: RegExpMatchArray;
|
||||||
do {
|
do {
|
||||||
match = object.match(/:(\w+)/);
|
match = resolved.match(/:(\w+)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
const substitute = params[match[1]];
|
const substitute = params[match[1]];
|
||||||
if (hasValue(substitute)) {
|
if (hasValue(substitute)) {
|
||||||
object = object.replace(match[0], `${substitute}`);
|
resolved = resolved.replace(match[0], `${substitute}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (match);
|
} while (match);
|
||||||
} else if (Array.isArray(object)) {
|
} else if (Array.isArray(object)) {
|
||||||
|
resolved = [];
|
||||||
object.forEach((entry, index) => {
|
object.forEach((entry, index) => {
|
||||||
object[index] = this.resolveSubstitutions(object[index], params);
|
resolved[index] = this.resolveSubstitutions(object[index], params);
|
||||||
|
});
|
||||||
|
} else if (typeof object === 'object') {
|
||||||
|
resolved = {};
|
||||||
|
Object.keys(object).forEach((key) => {
|
||||||
|
resolved[key] = this.resolveSubstitutions(object[key], params);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Object.keys(object).forEach((key) => {
|
resolved = object;
|
||||||
object = Object.assign({}, object, {
|
|
||||||
[key]: this.resolveSubstitutions(object[key], params)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return object;
|
return resolved;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user