-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): redirect user to an error page if the
.env
file is i…
- Loading branch information
Showing
13 changed files
with
122 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/angular/src/ng-add-setup-project/files/src/app/app-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {RouterModule, Routes} from '@angular/router'; | ||
import {ErrorComponent} from './error/error.component'; | ||
import {HomeComponent} from './home/home.component'; | ||
|
||
const routes: Routes = [ | ||
{path: '', component: HomeComponent}, | ||
{path: 'error', component: ErrorComponent}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule {} |
7 changes: 1 addition & 6 deletions
7
packages/angular/src/ng-add-setup-project/files/src/app/app.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
<!-- Toolbar --> | ||
<app-hero></app-hero> | ||
|
||
<div class="content" role="main"> | ||
<app-search-page></app-search-page> | ||
</div> | ||
<router-outlet></router-outlet> |
19 changes: 19 additions & 0 deletions
19
packages/angular/src/ng-add-setup-project/files/src/app/error/error.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<section class="warning-bg full-height center"> | ||
<div class="inner-container"> | ||
<p class="mat-display-1 mb-5">Invalid Environment Variables</p> | ||
<p class="mat-headline"> | ||
You should have a valid <code>.env</code> file at the root of this | ||
project. You can use <code>.env.example</code> as starting point and make | ||
sure to replace all placeholder variables <code><...></code> by | ||
the proper information for your organization. | ||
</p> | ||
|
||
<div *ngIf="this.errorMessage" class="mat-subheading-2"> | ||
Error Message: <b>{{ this.errorMessage }}</b> | ||
</div> | ||
|
||
<p class="mat-subheading-1"> | ||
Refer to the project <b>README</b> file for more information. | ||
</p> | ||
</div> | ||
</section> |
23 changes: 23 additions & 0 deletions
23
packages/angular/src/ng-add-setup-project/files/src/app/error/error.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.warning-bg { | ||
background-color: #fadd6e; | ||
} | ||
|
||
.full-height { | ||
height: 100%; | ||
} | ||
|
||
.inner-container { | ||
margin-top: 30vh; | ||
} | ||
|
||
.center { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 2rem; | ||
} | ||
|
||
code { | ||
color: #cc3c52; | ||
padding: 5px 2px; | ||
background-color: #f5f5f5; | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/angular/src/ng-add-setup-project/files/src/app/error/error.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-error', | ||
templateUrl: './error.component.html', | ||
styleUrls: ['./error.component.scss'], | ||
}) | ||
export class ErrorComponent implements OnInit { | ||
constructor() {} | ||
|
||
ngOnInit(): void {} | ||
|
||
get errorMessage() { | ||
return history.state.errorMessage || ''; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/angular/src/ng-add-setup-project/files/src/app/home/home.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<app-hero></app-hero> | ||
|
||
<div class="content" role="main"> | ||
<app-search-page></app-search-page> | ||
</div> |
Empty file.
12 changes: 12 additions & 0 deletions
12
packages/angular/src/ng-add-setup-project/files/src/app/home/home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-home', | ||
templateUrl: './home.component.html', | ||
styleUrls: ['./home.component.scss'], | ||
}) | ||
export class HomeComponent implements OnInit { | ||
constructor() {} | ||
|
||
ngOnInit(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters