This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from SmartStockTz/csb-twokej
update core libs and change publish configuration to npm
- Loading branch information
Showing
32 changed files
with
516 additions
and
354 deletions.
There are no files selected for viewing
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,24 @@ | ||
|
||
name: Publish to npm | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
- run: npm install --location=global @angular/cli | ||
- run: npm install --location=global yarn | ||
- run: npm install -f | ||
- run: npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN} | ||
- run: npm run publish | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,53 @@ | ||
import {Injectable} from '@angular/core'; | ||
import {ActivatedRouteSnapshot, CanActivate, Route, Router, RouterStateSnapshot, UrlTree} from '@angular/router'; | ||
import {Observable} from 'rxjs'; | ||
import {init, auth} from 'bfast'; | ||
import {getDaasAddress, getFaasAddress} from '@smartstocktz/core-libs'; | ||
import {environment} from '../../environments/environment'; | ||
import { Injectable } from "@angular/core"; | ||
import { | ||
ActivatedRouteSnapshot, | ||
CanActivate, | ||
Route, | ||
Router, | ||
RouterStateSnapshot, | ||
UrlTree | ||
} from "@angular/router"; | ||
import { Observable } from "rxjs"; | ||
import { init, auth } from "bfast"; | ||
import { getDaasAddress, getFaasAddress } from "smartstock-core"; | ||
import { environment } from "../../environments/environment"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
providedIn: "root" | ||
}) | ||
export class AuthGuard implements CanActivate { | ||
constructor(private readonly router: Router) { | ||
} | ||
constructor(private readonly router: Router) {} | ||
|
||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) | ||
: Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree { | ||
canActivate( | ||
route: ActivatedRouteSnapshot, | ||
state: RouterStateSnapshot | ||
): | ||
| Observable<boolean | UrlTree> | ||
| Promise<boolean | UrlTree> | ||
| boolean | ||
| UrlTree { | ||
return new Promise(async (resolve, reject) => { | ||
const user = await auth().currentUser(); | ||
if (user && user.role) { | ||
init({ | ||
applicationId: user.applicationId, | ||
projectId: user.projectId, | ||
databaseURL: getDaasAddress(user, environment.baseFaasUrl), | ||
functionsURL: getFaasAddress(user, environment.baseFaasUrl), | ||
adapters: { | ||
auth: 'DEFAULT', | ||
cache: 'DEFAULT', | ||
http: 'DEFAULT' | ||
} | ||
}, user.projectId); | ||
init( | ||
{ | ||
applicationId: user.applicationId, | ||
projectId: user.projectId, | ||
databaseURL: getDaasAddress(user, environment.baseFaasUrl), | ||
functionsURL: getFaasAddress(user, environment.baseFaasUrl), | ||
adapters: { | ||
auth: "DEFAULT", | ||
cache: "DEFAULT", | ||
http: "DEFAULT" | ||
} | ||
}, | ||
user.projectId | ||
); | ||
resolve(true); | ||
} else { | ||
this.router.navigateByUrl('/').catch(); | ||
this.router.navigateByUrl("/").catch(); | ||
resolve(false); | ||
} | ||
}); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
20 changes: 9 additions & 11 deletions
20
projects/web/src/componets/mall-filters-drawer.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
Oops, something went wrong.