Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config value from BE config #375

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading