Skip to content

Commit

Permalink
Fix config value from BE config (#375)
Browse files Browse the repository at this point in the history
* Fix config value from BE config

* Use lowercase for consistency
  • Loading branch information
minottic authored Oct 2, 2024
1 parent 9c79efe commit 9188866
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/app/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface AppConfig {
logoBanner: string | null;
logoWidth?: string;
retrieveToEmail: RetrieveDestinations | undefined;
lbBaseUrl: string | null;
}

export class RetrieveDestinations {
Expand Down
12 changes: 11 additions & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { TestBed, waitForAsync } from "@angular/core/testing";
import { fakeAsync, TestBed, waitForAsync } from "@angular/core/testing";
import { RouterTestingModule } from "@angular/router/testing";
import { AppComponent } from "./app.component";
import { APP_CONFIG } from "./app-config.module";
import { MatToolbarModule } from "@angular/material/toolbar";
import { HttpClientModule } from "@angular/common/http";
import { APP_DYN_CONFIG } from "./app-config.service";
import { MockAppConfigService } from "./shared/MockStubs";
import { LoopBackConfig } from "./shared/sdk";

describe("AppComponent", () => {
beforeEach(waitForAsync(() => {
Expand Down Expand Up @@ -35,4 +36,13 @@ describe("AppComponent", () => {
const app = fixture.componentInstance;
expect(app.title).toEqual("ESS Public Data Repository test");
});

it(`should test app config values'`, fakeAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
fixture.detectChanges();
expect(app.config.scicatBaseUrl).toEqual("https://scicat.esss.se");
expect(app.config.lbBaseUrl).toEqual("https://scicat.esss.se/api");
expect(LoopBackConfig.getPath()).toEqual("https://scicat.esss.se/api");
}));
});
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AppComponent implements OnInit {
}

ngOnInit() {
LoopBackConfig.setBaseURL(this.config.scicatBaseUrl);
LoopBackConfig.setBaseURL(this.config.lbBaseUrl);
console.log("API Path: ", LoopBackConfig.getPath());
console.log("API Version: ", LoopBackConfig.getApiVersion());
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/MockStubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class MockAppConfigService extends AppConfigService {
accessInstructions:
"Instructions: Login with brightness username and password",
scicatBaseUrl: "https://scicat.esss.se",
lbBaseUrl: "https://scicat.esss.se",
lbBaseUrl: "https://scicat.esss.se/api",
retrieveToEmail: {
option: "URLs",
username: "lp_service",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const environment = {
directMongoAccess: false,
doiBaseUrl: "https://doi.org/",
facility: "psi",
lbBaseURL: "https://doi2.psi.ch:3001",
lbBaseUrl: "https://doi2.psi.ch:3001",
oaiProviderRoute: "https://doi2.psi.ch/oaipmh/Publication",
production: true,
scicatBaseUrl: null,
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.dmsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "https://kubetest02.dm.esss.dk:32223",
lbBaseUrl: "https://kubetest02.dm.esss.dk:32223",
oaiProviderRoute: null,
production: false,
scicatBaseUrl: "https://scicat.esss.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.dmscdev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "https://catamelservice.esss.dk:30003",
lbBaseUrl: "https://catamelservice.esss.dk:30003",
oaiProviderRoute: null,
production: false,
scicatBaseUrl: "https://scicat.esss.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.dmscprod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "https://scicatapi.esss.dk",
lbBaseUrl: "https://scicatapi.esss.dk",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://scicat.esss.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "http://127.0.0.1:3000",
lbBaseUrl: "http://127.0.0.1:3000",
oaiProviderRoute: null,
production: false,
scicatBaseUrl: "https://scicat.esss.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.essdev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "https://scitest.esss.lu.se",
lbBaseUrl: "https://scitest.esss.lu.se",
oaiProviderRoute: null,
production: false,
scicatBaseUrl: "https://scitest.esss.lu.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.essprod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "https://scicat.ess.eu",
lbBaseUrl: "https://scicat.ess.eu",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://scicat.ess.eu",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.maxivdemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "maxiv",
lbBaseURL: "https://scicat-demo.maxiv.lu.se",
lbBaseUrl: "https://scicat-demo.maxiv.lu.se",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://scicat-demo.maxiv.lu.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.maxivdev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "maxiv",
lbBaseURL: "https://scicat-test.maxiv.lu.se",
lbBaseUrl: "https://scicat-test.maxiv.lu.se",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://scicat-test.maxiv.lu.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.maxivprod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "maxiv",
lbBaseURL: "https://scicat.maxiv.lu.se",
lbBaseUrl: "https://scicat.maxiv.lu.se",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: "https://scicat.maxiv.lu.se",
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const environment = {
directMongoAccess: false,
doiBaseUrl: "https://doi.org/",
facility: "psi",
lbBaseURL: "https://doi.psi.ch:3001",
lbBaseUrl: "https://doi.psi.ch:3001",
oaiProviderRoute: "https://doi.psi.ch/oaipmh/Publication",
production: true,
scicatBaseUrl: null,
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.qa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const environment = {
directMongoAccess: false,
doiBaseUrl: "https://doi.org/",
facility: "PSI",
lbBaseURL: "https://dacat-qa.psi.ch",
lbBaseUrl: "https://dacat-qa.psi.ch",
oaiProviderRoute: null,
production: true,
scicatBaseUrl: null,
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const environment = {
directMongoAccess: true,
doiBaseUrl: "https://doi.org/",
facility: "ess",
lbBaseURL: "http://localhost:3000",
lbBaseUrl: "http://localhost:3000",
oaiProviderRoute: "http://127.0.0.1:3001",
production: false,
scicatBaseUrl: "https://scicat.esss.se",
Expand Down

0 comments on commit 9188866

Please sign in to comment.