Skip to content

Commit

Permalink
fix bug with rest token
Browse files Browse the repository at this point in the history
  • Loading branch information
natb1 committed Mar 6, 2023
1 parent 24b30cd commit e1d5a55
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"image": "ghcr.io/natb1/study-site-manager-development",
"forwardPorts": [
9876, // karma
4200, // client dev server
4300, // client dev server
5001, // plots server
6006 // storybook
],
Expand Down
Binary file not shown.
21 changes: 2 additions & 19 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,12 @@
},
"defaultConfiguration": "development",
"options": {
"port": 4200,
"port": 4300,
"host": "127.0.0.1",
"publicHost": "http://127.0.0.1:4200",
"publicHost": "http://127.0.0.1:4300",
"extraWebpackConfig": "projects/navigation/webpack.config.js"
}
},
// "serve": {
// "builder": "@angular-devkit/build-angular:dev-server",
// "configurations": {
// "production": {
// "browserTarget": "navigation:build:production"
// },
// "development": {
// "browserTarget": "navigation:build:development",
// // Host needed to address an apparent bug with GH spaces.
// "host": "127.0.0.1",
// // This prevents console errors when in GH spaces.
// "allowedHosts": [".github.dev"]
// // "disableHostCheck": true
// }
// },
// "defaultConfiguration": "development"
// },
"extract-i18n": {
"builder": "ngx-build-plus:extract-i18n",
"options": {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"ng": "ng",
"build": "ng build rest",
"serve": "yarn build && yarn ng serve-gh ${NG_ALLOWED_HOSTS:-}",
"serve": "yarn build && yarn ng serve ${NG_ALLOWED_HOSTS:-}",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test:ci": "ng test --no-watch --no-progress",
Expand All @@ -19,6 +19,7 @@
"@angular/common": "^15.0.4",
"@angular/compiler": "^15.0.4",
"@angular/core": "^15.0.4",
"@angular/elements": "^15.2.1",
"@angular/fire": "7.5.0",
"@angular/forms": "^15.0.4",
"@angular/material": "^15.0.3",
Expand Down
2 changes: 1 addition & 1 deletion projects/development/env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if [ -n $GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN ]; then
export NG_ALLOWED_HOSTS="--allowed-hosts ${CODESPACE_NAME}-4200.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"
export NG_ALLOWED_HOSTS="--allowed-hosts ${CODESPACE_NAME}-4300.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN"
gh codespace ports visibility 5001:public -c $CODESPACE_NAME # https://github.com/community/community/discussions/15351
fi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface CourseStat {
export class CourseStatsService extends RestDelegate<CourseStat> {

constructor(
@Inject(RestToken) rest: Rest,
@Inject('RestToken') rest: Rest,
) {
super(rest, '', 'course-stats')
}
Expand Down
4 changes: 2 additions & 2 deletions projects/navigation/src/app/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const environment = {
return localPort
} else {
// GH Codespaces is using a proxy.
const portProxy = `${location.protocol}//${location.hostname.replace('4200', '5001')}/`
const portProxy = `${location.protocol}//${location.hostname.replace('4300', '5001')}/`
return portProxy
}
},
Expand All @@ -16,7 +16,7 @@ export const environment = {
return localPort
} else {
// GH Codespaces is using a proxy.
const portProxy = `${location.protocol}//${location.hostname.replace('4200', '5001')}`
const portProxy = `${location.protocol}//${location.hostname.replace('4300', '5001')}`
return portProxy
}
},
Expand Down
2 changes: 1 addition & 1 deletion projects/navigation/src/app/funding/funding.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface Funding {
export class FundingService extends RestDelegate<Funding> {

constructor(
@Inject(RestToken) rest: Rest
@Inject('RestToken') rest: Rest
) {
super(rest, '', 'funding')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface Publication {
export class PublicationsService extends RestDelegate<Publication> {

constructor(
@Inject(RestToken) rest: Rest,
@Inject('RestToken') rest: Rest,
@Inject('environment') private environment: any,
) {
super(rest, '', 'publications')
Expand Down
2 changes: 1 addition & 1 deletion projects/navigation/src/app/scan-logs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface ScanLog {
export class ScanLogsService extends RestDelegate<ScanLog> {

constructor(
@Inject(RestToken) rest: Rest
@Inject('RestToken') rest: Rest
) {
super(rest, '', 'scanLogs')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ReadmeSummaryDetails {
export class ReadmeSummariesService extends RestDelegate<ReadmeSummary> {

constructor(
@Inject(RestToken) rest: Rest,
@Inject('RestToken') rest: Rest,
) {
super(
rest, '', 'readmeSummaries',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface RepoSummary {
export class RepoSummariesService extends RestDelegate<RepoSummary> {

constructor(
@Inject(RestToken) rest: Rest,
@Inject('RestToken') rest: Rest,
) {
super(rest, '', 'communityDashboardRepos')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<mat-card-header class="absolute">
<mat-card-title class="header-text headline-title">Network Studies</mat-card-title>
<p style="color: white">
[...A brief about network studies.]
<!-- [...A brief about network studies.] -->
</p>
</mat-card-header>
<!-- <img mat-card-image src="/assets/orange-texture.png" class="full-width"> -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface YouTubeVideo {
export class YouTubeService extends RestDelegate<YouTubeVideo> {

constructor(
@Inject(RestToken) rest: Rest,
@Inject('RestToken') rest: Rest,
@Inject('environment') private environment: any,
) {
super(rest, '', 'youtube')
Expand Down
4 changes: 2 additions & 2 deletions projects/navigation/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { provideRouter, Route } from '@angular/router';
import { environment } from './app/environments/environment';
import { AppComponent } from './app/app.component';
import { RestMock } from './test/rest-mock.service';
import { RestToken } from '@community-dashboard/rest';

if (environment.production) {
enableProdMode();
Expand All @@ -33,6 +32,7 @@ bootstrapApplication(AppComponent, {
provideAnimations(),
provideHttpClient(),
{provide: 'environment', useValue: environment},
{provide: RestToken, useClass: RestMock},
// {provide: RestToken, useClass: RestMock},
{provide: 'RestToken', useClass: RestMock},
]
})
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,18 @@ __metadata:
languageName: node
linkType: hard

"@angular/elements@npm:^15.2.1":
version: 15.2.1
resolution: "@angular/elements@npm:15.2.1"
dependencies:
tslib: ^2.3.0
peerDependencies:
"@angular/core": 15.2.1
rxjs: ^6.5.3 || ^7.4.0
checksum: e2037f771217ea0f5b02704b558d81983ab832154afa8eda0ab538d111e49c2bbb6e1613545aa20a59b69420c5ecbab322e31bc5c66e18a9e3682c7d5077341a
languageName: node
linkType: hard

"@angular/fire@npm:7.5.0":
version: 7.5.0
resolution: "@angular/fire@npm:7.5.0"
Expand Down Expand Up @@ -7811,6 +7823,7 @@ __metadata:
"@angular/compiler": ^15.0.4
"@angular/compiler-cli": ^15.0.4
"@angular/core": ^15.0.4
"@angular/elements": ^15.2.1
"@angular/fire": 7.5.0
"@angular/forms": ^15.0.4
"@angular/material": ^15.0.3
Expand Down

0 comments on commit e1d5a55

Please sign in to comment.