Skip to content

Commit

Permalink
added firebase hosting for spacebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelh1983 committed Jun 19, 2023
1 parent 00d8d49 commit 22b1dc2
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
release/
backend/Diggel.Backend/appsettings.local.json
frontend/tools/android-app/key/diggel.jks
frontend/.firebase/hosting.ZGlzdC9hcHBzL3NwYWNlYm9vaw.cache
15 changes: 15 additions & 0 deletions frontend/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"projects": {
"default": "citolab-qti",
"spacebook": "citolab-qti"
},
"targets": {
"citolab-qti": {
"hosting": {
"spacebook": [
"citolab-spacebook"
]
}
}
}
}
27 changes: 27 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,33 @@
}
]
},
"production-nobackend": {
"fileReplacements": [
{
"replace": "environments/environment.ts",
"with": "environments/environment.prod.nobackend.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
},
"localprod": {
"fileReplacements": [
{
Expand Down
8 changes: 4 additions & 4 deletions frontend/apps/spacebook/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
style="bottom: 5px; left: 5px; z-index: 1000"
>
<div class="d-flex">
<span *ngIf="!userService.useBackend" class="badge badge-danger m-2"
<!-- <span *ngIf="!userService.useBackend" class="badge badge-danger m-2"
>No backend</span
>
> -->
<span
style="z-index: 1000; cursor: pointer"
(click)="setLang('en')"
Expand All @@ -26,7 +26,7 @@
</span>
</div>
</div>
<div
<!-- <div
*ngIf="allowNavigation"
class="position-fixed"
style="top: 12px; right: 50vw; z-index: 10000"
Expand Down Expand Up @@ -57,5 +57,5 @@
</button>
</div>
</div>
</div>
</div> -->
<router-outlet></router-outlet>
2 changes: 1 addition & 1 deletion frontend/apps/spacetalk/src/app/startPage/start.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class StartPageComponent
extends BaseStartPageComponent
implements OnInit {
ngOnInit() {
this.welcomeMessage = `Ik moet een spreekbeurt maken over Bolivia met het programma
this.welcomeMessage = `Ik moet een spreekbeurt maken over de Tweede Wereldoorlog met het programma
SpaceTalk. Ik heb dit nog niet zo vaak gedaan. Kun jij me helpen? `;
this.firstItem = itemDefinitions[0];
super.ngOnInit();
Expand Down
7 changes: 7 additions & 0 deletions frontend/environments/environment.prod.nobackend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const environment = {
production: true,
apibase: 'https://diggel.azurewebsites.net/', // value will be reduced to / if its serve on save url
useBackend: false,
updateUrl:
'https://diggel.azurewebsites.net/remote_server_apk/version.xml',
};
22 changes: 22 additions & 0 deletions frontend/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"hosting": [
{
"target": "spacebook",
"public": "dist/apps/spacebook",
"predeploy": [
"nx build spacebook --configuration=production-nobackend"
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
2 changes: 1 addition & 1 deletion frontend/libs/data/src/lib/translations/translations-nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const translations = {...en,
DIGGEL_NEXT_SESSION: `Klik op verder om de volgende opdracht te starten`,
DIGGEL_END: `Dit is het eind van de toets. Bedankt voor het meedoen!`,
DIGGEL_NOT_ANSWERED: '<span class="h5">😱</span> Je hebt mijn vraag nog niet helemaal beantwoord.',
DIGGEL_REGISTRATION_NOT_ANSWERED: '<span class="h5">😱</span> The registration is not yet completed.',
DIGGEL_REGISTRATION_NOT_ANSWERED: '<span class="h5">😱</span> Je bent nog niet helemaal klaar met registreren.',
DIGGEL_NEXT_ITEM: 'Ok, dan gaan we verder!',
DIGGEL_HELP: `Ik ga je helpen`,
DIGGEL_WELCOME: `
Expand Down
2 changes: 1 addition & 1 deletion frontend/libs/ui/src/lib/components/base-end.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export abstract class BaseEndPageComponent implements OnInit, OnDestroy {
protected translate: TranslateService
) {
toastr.clear();
this.textSessionReady = translate.instant('SPACEBOOK_END_THANKS`,');
this.textSessionReady = translate.instant('SPACEBOOK_END_THANKS');
}
ngOnDestroy(): void {
if (this.endSubscription) {
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"build:spacegram:prod:cordova": "ng build spacegram --delete-output-path --prod --base-href . --output-path tools/android-app/www/spacegram",
"build:webspace:prod:cordova": "ng build webspace --delete-output-path --prod --base-href . --output-path tools/android-app/www/webspace",
"build:spacetalk:prod:cordova": "ng build spacetalk --delete-output-path --prod --base-href . --output-path tools/android-app/www/spacetalk",
"deploy:diggel:nobackend": "firebase use citolab-qti && firebase deploy --only hosting:spacebook",
"apk:build": "npm run build:prod:cordova && npm run --prefix tools/android-app apk:build",
"apk:nobuild": "npm run --prefix tools/android-app apk:build",
"lint": "nx workspace-lint && ng lint diggel && ng lint spacebook && ng lint spacegram && ng lint webspace && ng lint spacetalk && ng lint data && ng lint ui",
Expand Down

0 comments on commit 22b1dc2

Please sign in to comment.