mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-27 01:02:34 +01:00
Add querry parameter for setting.json (#16081)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
3d26bbc2e2
commit
d711f02401
@ -41,7 +41,7 @@ describe('SkinableConfig', () => {
|
||||
expect(res).toEqual(mockCustomSkinData);
|
||||
});
|
||||
|
||||
const req = httpMock.expectOne('setting.json');
|
||||
const req = httpMock.expectOne('setting.json?buildTimeStamp=0');
|
||||
expect(req.request.method).toBe('GET');
|
||||
req.flush(mockCustomSkinData);
|
||||
expect(service.getSkinConfig()).toEqual(mockCustomSkinData);
|
||||
|
@ -5,6 +5,7 @@ import { map, catchError } from "rxjs/operators";
|
||||
import { Observable, throwError as observableThrowError } from "rxjs";
|
||||
import { CustomStyle } from "./theme";
|
||||
import { DOCUMENT } from "@angular/common";
|
||||
import { environment } from "src/environments/environment";
|
||||
@Injectable()
|
||||
export class SkinableConfig {
|
||||
private customSkinData: CustomStyle;
|
||||
@ -12,7 +13,7 @@ export class SkinableConfig {
|
||||
@Inject(DOCUMENT) private document: Document) {}
|
||||
|
||||
public getCustomFile(): Observable<any> {
|
||||
return this.http.get('setting.json')
|
||||
return this.http.get(`setting.json?buildTimeStamp=${environment?.buildTimestamp}`)
|
||||
.pipe(map(response => this.customSkinData = response as CustomStyle)
|
||||
, catchError((error: any) => {
|
||||
console.error('custom skin json file load failed');
|
||||
|
Loading…
Reference in New Issue
Block a user