Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit c66111b

Browse files
authored
Merge pull request #20 from chihab/chore/fix-version-number
chore: fix version number
2 parents f0f3fd8 + 05d8684 commit c66111b

File tree

5 files changed

+49
-63
lines changed

5 files changed

+49
-63
lines changed

package-lock.json

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"start": "ng serve",
77
"lint": "ng lint core",
88
"build": "ng build --prod core",
9-
"test": "ng test core --watch=false --browsers=ChromeHeadless"
9+
"test": "ng test core --watch=false --browsers=ChromeHeadless",
10+
"build:demo": "ng build --prod ngx-access"
1011
},
1112
"private": true,
1213
"dependencies": {
@@ -20,8 +21,7 @@
2021
"@angular/router": "~11.2.7",
2122
"rxjs": "~6.6.0",
2223
"tslib": "^2.0.0",
23-
"zone.js": "~0.11.3",
24-
"ngx-access": "~1.1.2"
24+
"zone.js": "~0.11.3"
2525
},
2626
"devDependencies": {
2727
"@angular-devkit/build-angular": "~0.1102.6",

projects/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-access",
3-
"version": "0.0.1",
3+
"version": "1.2.0",
44
"description": "Add access control to your components using hierarchical configuration with logical expressions.",
55
"author": "Chihab Otmani",
66
"repository": {

src/app/app.module.ts

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,47 @@ import { ProfileComponent } from './profile/profile.component';
1010
import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
1111

1212
@NgModule({
13-
declarations: [
14-
AppComponent, ProfileComponent, MainComponent, UnauthorizedComponent
15-
],
16-
imports: [
17-
AccessModule.forRoot({
18-
accesses: {
19-
UserForm: {
20-
FirstName: {
21-
Read: 'UserAccess'
22-
},
23-
Login: {
24-
Read: 'Adminccess'
25-
}
26-
}
27-
},
28-
redirect: '/forbidden',
29-
strategy: { provide: AccessStrategy, useClass: MyAccessStrategy }
30-
}),
31-
RouterModule.forRoot([
32-
{ path: '', component: MainComponent },
33-
{ path: 'forbidden', component: UnauthorizedComponent },
34-
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' },
35-
{
36-
path: 'profile',
37-
component: ProfileComponent,
38-
canActivate: [AccessGuard],
39-
data: {
40-
accesses: ['Hello.View:Read', 'Hello.View:Update']
41-
}
42-
}
43-
]),
44-
BrowserModule,
45-
HttpClientModule
46-
],
47-
bootstrap: [AppComponent]
13+
declarations: [
14+
AppComponent,
15+
ProfileComponent,
16+
MainComponent,
17+
UnauthorizedComponent,
18+
],
19+
imports: [
20+
AccessModule.forRoot({
21+
accesses: {
22+
UserForm: {
23+
FirstName: {
24+
Read: 'UserAccess',
25+
},
26+
Login: {
27+
Read: 'Adminccess',
28+
},
29+
},
30+
},
31+
redirect: '/forbidden',
32+
strategy: { provide: AccessStrategy, useClass: MyAccessStrategy },
33+
}),
34+
RouterModule.forRoot([
35+
{ path: '', component: MainComponent },
36+
{ path: 'forbidden', component: UnauthorizedComponent },
37+
{
38+
path: 'lazy',
39+
loadChildren: () =>
40+
import('./lazy/lazy.module').then((m) => m.LazyModule),
41+
},
42+
{
43+
path: 'profile',
44+
component: ProfileComponent,
45+
canActivate: [AccessGuard],
46+
data: {
47+
accesses: ['Hello.View:Read', 'Hello.View:Update'],
48+
},
49+
},
50+
]),
51+
BrowserModule,
52+
HttpClientModule,
53+
],
54+
bootstrap: [AppComponent],
4855
})
49-
export class AppModule { }
56+
export class AppModule {}

tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"compilerOptions": {
55
"baseUrl": "./",
66
"paths": {
7-
"core": [
8-
"dist/core/core",
9-
"dist/core"
10-
]
7+
"ngx-access": ["projects/core/src/public-api"]
118
},
129
"outDir": "./dist/out-tsc",
1310
"forceConsistentCasingInFileNames": true,
@@ -22,10 +19,7 @@
2219
"importHelpers": true,
2320
"target": "es2015",
2421
"module": "es2020",
25-
"lib": [
26-
"es2018",
27-
"dom"
28-
]
22+
"lib": ["es2018", "dom"]
2923
},
3024
"angularCompilerOptions": {
3125
"enableI18nLegacyMessageIdFormat": false,

0 commit comments

Comments
 (0)