Skip to content

Commit

Permalink
Merge pull request #146 from brightlayer-ui/dev
Browse files Browse the repository at this point in the history
test out firebase
  • Loading branch information
jeffvg authored Jun 14, 2022
2 parents 70023bb + a39d3ea commit f4d605f
Show file tree
Hide file tree
Showing 14 changed files with 2,956 additions and 479 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cd login-workflow && yarn copy-to-example && cd example && yarn && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
entryPoint: "./login-workflow"
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLUI_ANGULAR_LOGIN }}'
channelId: live
projectId: blui-angular-login
19 changes: 19 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cd login-workflow && yarn copy-to-example && cd example && yarn && yarn build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
entryPoint: "./login-workflow"
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BLUI_ANGULAR_LOGIN }}'
expires: 2d
projectId: blui-angular-login
5 changes: 5 additions & 0 deletions login-workflow/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "blui-angular-login"
}
}
7 changes: 7 additions & 0 deletions login-workflow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## v3.0.1 (June 13, 2022)

### Fixed

- Fixed bug in create-account workflow where `requestRegistrationCode` was not invoked before reaching the "Verify Email" screen ([#132](https://github.com/brightlayer-ui/angular-workflows/issues/132)).


## v3.0.0 (March 15, 2022)

### Changed
Expand Down
42 changes: 42 additions & 0 deletions login-workflow/VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Validation Steps

### Manual Steps

#### Authentication
1. User can log into the app using an email & password.
2. User can toggle show/hide password fields.
3. Correct console output appears when logging in.
4. User can log out of the app.
5. If 'Remember Me' is disabled, email is forgotten after logging out.

#### Account Creation
1. User cannot create an account until they enter a valid email.
2. User cannot create an account until they accept the EULA.
3. User cannot create an account until they enter First & Last Name.
4. Information is retained so that users can step backwards while creating an account.
5. Correct console output appears when validating a user-registration code.
6. Correct console output appears when creating an account.

#### Account Creation Via Invite
1. User cannot create an account until they accept the EULA.
2. User cannot create an account until they enter First & Last Name.
3. Information is retained so that users can step backwards while creating an account.
4. Correct console output appears when creating an account via invite.

#### Translations
1. User can toggle the spanish translation and all pages are converted to the appropriate language.
2. User can toggle the french translation.
3. User can toggle the chinese translation.

#### Change Password
1. Correct console output appears when requesting a reset password email.
2. Correct console output appears when changing password via reset email.
3. After a user changes their password, they are logged out of the application.


#### Misc.
1. User can cancel/close any sub-task (forgot password, forgot password email, invite register and create account).

### Unit Test Count
67

1 change: 0 additions & 1 deletion login-workflow/example/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@
last 2 versions
Firefox ESR
not dead
IE 11
41 changes: 11 additions & 30 deletions login-workflow/example/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,7 @@
"scripts": []
},
"configurations": {
"defaultConfiguration": "npm",
"npm": {
"tsConfig": "tsconfig.npm.json",
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"defaultConfiguration": "lib",
"lib": {
"tsConfig": "tsconfig.lib.json",
"buildOptimizer": false,
Expand All @@ -55,21 +46,7 @@
"namedChunks": true
},
"production": {
"tsConfig": "tsconfig.npm.json",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"tsConfig": "tsconfig.lib.json",
"budgets": [
{
"type": "initial",
Expand All @@ -81,7 +58,14 @@
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
}
}
},
Expand All @@ -93,12 +77,9 @@
},
"production": {
"browserTarget": "example:build:production"
},
"npm": {
"browserTarget": "example:build:npm"
}
},
"defaultConfiguration": "npm"
"defaultConfiguration": "lib"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand Down
5 changes: 2 additions & 3 deletions login-workflow/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start:lib": "ng serve --configuration lib",
"start:npm": "ng serve --configuration npm",
"build": "ng build",
"start:lib": "ng serve --c lib",
"build": "ng build --c production",
"test": "ng test",
"lint": "eslint \"src/app/**/**.ts\"",
"e2e": "ng e2e",
Expand Down
16 changes: 0 additions & 16 deletions login-workflow/example/tsconfig.npm.json

This file was deleted.

12 changes: 6 additions & 6 deletions login-workflow/example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2106,9 +2106,9 @@ [email protected]:
integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=

async@^2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
version "2.6.4"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221"
integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==
dependencies:
lodash "^4.17.14"

Expand Down Expand Up @@ -4888,9 +4888,9 @@ minimatch@^3.0.4:
brace-expansion "^1.1.7"

minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

minipass-collect@^1.0.2:
version "1.0.2"
Expand Down
16 changes: 16 additions & 0 deletions login-workflow/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "example/dist/example",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
21 changes: 12 additions & 9 deletions login-workflow/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@brightlayer-ui/angular-auth-workflow",
"description": "Re-usable workflow components for Authentication and Registration within Eaton applications.",
"version": "3.0.0",
"version": "3.0.1",
"scripts": {
"ng": "ng",
"watch": "npm-watch",
Expand All @@ -27,14 +27,16 @@
"type": "git",
"url": "git+https://github.com/brightlayer-ui/angular-workflows.git"
},
"watch": {
"copy-to-example": {
"patterns": ["src"],
"extensions": "ts,html,scss",
"quiet": false,
"runOnChangeOnly": false
}
},
"watch": {
"copy-to-example": {
"patterns": [
"src"
],
"extensions": "ts,html,scss",
"quiet": false,
"runOnChangeOnly": false
}
},
"keywords": [
"angular",
"workflow",
Expand Down Expand Up @@ -85,6 +87,7 @@
"codelyzer": "~5.2.1",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"firebase-tools": "^11.0.1",
"jasmine-core": "~3.9.0",
"jasmine-spec-reporter": "~6.0.0",
"karma": "^6.3.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ export class BluiCreateAccountComponent implements OnDestroy {
this.stateListener.unsubscribe();
}

sendVerificationEmail(): void {
this._bluiSecurityService.setLoading(true);
this._bluiRegisterService
.requestRegistrationCode(this.email)
.then(() => {
this._bluiSecurityService.setLoading(false);
this.registrationUtils.nextStep();
})
.catch((data: ErrorDialogData) => {
this._bluiErrorDialogService.openDialog(data);
this._bluiSecurityService.setLoading(false);
});
}

validateVerificationCode(): void {
this._bluiSecurityService.setLoading(true);
this._bluiRegisterService
Expand Down Expand Up @@ -165,6 +179,9 @@ export class BluiCreateAccountComponent implements OnDestroy {
? this.registerAccount()
: this.registrationUtils.nextStep();
}
if (this.registrationUtils.getCurrentPage() === 1) {
return this.sendVerificationEmail();
}
if (this.registrationUtils.getCurrentPage() === 2) {
return this.validateVerificationCode();
}
Expand Down
Loading

0 comments on commit f4d605f

Please sign in to comment.