Skip to content

Commit

Permalink
fix(openchallenges): move OC API docs URL to app config (#2230)
Browse files Browse the repository at this point in the history
* update config + env file for oc app

* update footer params in html and ts scripts
  • Loading branch information
vpchung authored Oct 14, 2023
1 parent 3a1da2c commit 6b7f7ac
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/openchallenges/app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ CSR_API_URL="http://localhost:8082/api/v1"
DATA_UPDATED_ON="2023-09-26"
ENVIRONMENT="production"
GOOGLE_TAG_MANAGER_ID=""
SSR_API_URL="http://openchallenges-api-gateway:8082/api/v1"
SSR_API_URL="http://openchallenges-api-gateway:8082/api/v1"
API_DOCS_URL="http://localhost:8000/api-docs"
3 changes: 2 additions & 1 deletion apps/openchallenges/app/src/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"dataUpdatedOn": "yyyy-mm-dd",
"environment": "development",
"googleTagManagerId": "",
"ssrApiUrl": "http://openchallenges-api-gateway:8082/api/v1"
"ssrApiUrl": "http://openchallenges-api-gateway:8082/api/v1",
"apiDocsUrl": "http://localhost:8000/api-docs"
}
1 change: 1 addition & 0 deletions apps/openchallenges/app/src/config/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
"environment": "${ENVIRONMENT}",
"googleTagManagerId": "${GOOGLE_TAG_MANAGER_ID}",
"ssrApiUrl": "${SSR_API_URL}"
"apiDocsUrl": "${API_DOCS_URL}"
}
1 change: 1 addition & 0 deletions libs/openchallenges/about/src/lib/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ <h4 class="card-title text-center">Promote discoverability and reusability</h4>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
2 changes: 2 additions & 0 deletions libs/openchallenges/about/src/lib/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class AboutComponent {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

constructor(
private readonly configService: ConfigService,
Expand All @@ -27,6 +28,7 @@ export class AboutComponent {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
this.seoService.setData(getSeoData(), this.renderer2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ <h3>Results ({{ searchResultsCount }})</h3>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class ChallengeSearchComponent
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;
datePipe: DatePipe = new DatePipe('en-US');

private query: BehaviorSubject<ChallengeSearchQuery> =
Expand Down Expand Up @@ -205,6 +206,7 @@ export class ChallengeSearchComponent
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
this.seoService.setData(getSeoData(), this.renderer2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ <h2>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
2 changes: 2 additions & 0 deletions libs/openchallenges/challenge/src/lib/challenge.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class ChallengeComponent implements OnInit {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

challenge$!: Observable<Challenge>;
loggedIn = false;
Expand All @@ -88,6 +89,7 @@ export class ChallengeComponent implements OnInit {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
}

ngOnInit(): void {
Expand Down
1 change: 1 addition & 0 deletions libs/openchallenges/config/src/lib/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface AppConfig {
privacyPolicyUrl: string;
ssrApiUrl: string;
termsOfUseUrl: string;
apiDocsUrl: string;
}

export const EMPTY_APP_CONFIG = {} as AppConfig;
1 change: 1 addition & 0 deletions libs/openchallenges/home/src/lib/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ <h4>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
2 changes: 2 additions & 0 deletions libs/openchallenges/home/src/lib/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class HomeComponent {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

constructor(
private readonly configService: ConfigService,
Expand All @@ -52,6 +53,7 @@ export class HomeComponent {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
this.seoService.setData(getSeoData(), this.renderer2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ <h1>Page Not Found</h1>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
2 changes: 2 additions & 0 deletions libs/openchallenges/not-found/src/lib/not-found.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ export class NotFoundComponent {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

constructor(private readonly configService: ConfigService) {
this.appVersion = this.configService.config.appVersion;
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ <h2>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class OrgProfileComponent implements OnInit {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

organization$!: Observable<Organization>;
organizationAvatar$!: Observable<Avatar>;
Expand All @@ -95,6 +96,7 @@ export class OrgProfileComponent implements OnInit {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ <h3>Results ({{ searchResultsCount }})</h3>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class OrgSearchComponent implements OnInit, AfterContentInit, OnDestroy {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;

private query: BehaviorSubject<OrganizationSearchQuery> =
new BehaviorSubject<OrganizationSearchQuery>({});
Expand Down Expand Up @@ -143,6 +144,7 @@ export class OrgSearchComponent implements OnInit, AfterContentInit, OnDestroy {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
this.seoService.setData(getSeoData(), this.renderer2);
}

Expand Down
1 change: 1 addition & 0 deletions libs/openchallenges/team/src/lib/team.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ <h3 class="card-name">Jake Albrecht</h3>
[dataUpdatedOn]="dataUpdatedOn"
[privacyPolicyUrl]="privacyPolicyUrl"
[termsOfUseUrl]="termsOfUseUrl"
[apiDocsUrl]="apiDocsUrl"
/>
2 changes: 2 additions & 0 deletions libs/openchallenges/team/src/lib/team.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class TeamComponent implements OnInit {
public dataUpdatedOn: string;
public privacyPolicyUrl: string;
public termsOfUseUrl: string;
public apiDocsUrl: string;
public logo$: Observable<Image> | undefined;
public thomas$: Observable<Image> | undefined;
public rong$: Observable<Image> | undefined;
Expand All @@ -40,6 +41,7 @@ export class TeamComponent implements OnInit {
this.dataUpdatedOn = this.configService.config.dataUpdatedOn;
this.privacyPolicyUrl = this.configService.config.privacyPolicyUrl;
this.termsOfUseUrl = this.configService.config.termsOfUseUrl;
this.apiDocsUrl = this.configService.config.apiDocsUrl;
this.seoService.setData(getSeoData(), this.renderer2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<li><a href="/team">Meet Our Team</a></li>
<li>
<a
href="https://openchallenges.io/api-docs"
[href]="apiDocsUrl"
title="Interactive documentation for OC API"
rel="noopener noreferrer"
target="_blank"
Expand Down
1 change: 1 addition & 0 deletions libs/openchallenges/ui/src/lib/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export class FooterComponent {
@Input({ required: true }) dataUpdatedOn = '';
@Input({ required: true }) privacyPolicyUrl = '';
@Input({ required: true }) termsOfUseUrl = '';
@Input({ required: true }) apiDocsUrl = '';
}

0 comments on commit 6b7f7ac

Please sign in to comment.