-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add separate provide functions for optional features
* Teams, Audit, Admin and Help UI moved to seperate provide functions. * This makes it easier to disable feature functionality if not needed by a downstream project.
- Loading branch information
Showing
25 changed files
with
259 additions
and
160 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
1 change: 0 additions & 1 deletion
1
src/app/common/loading-overlay/loading-overlay.component.spec.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
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
9 changes: 1 addition & 8 deletions
9
src/app/common/table/filter/asy-header-text-filter/asy-header-text-filter.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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './public-api'; |
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,66 @@ | ||
import { InjectionToken, inject, makeEnvironmentProviders } from '@angular/core'; | ||
import { ROUTES } from '@angular/router'; | ||
|
||
import { ADMIN_TOPICS } from './admin-topic.model'; | ||
|
||
export const APP_FEATURE_ADMIN = new InjectionToken<boolean>('APP_FEATURE_ADMIN'); | ||
|
||
export function injectAdminEnabled() { | ||
return inject(APP_FEATURE_ADMIN, { optional: true }) ?? false; | ||
} | ||
|
||
export function provideAdminFeature() { | ||
return makeEnvironmentProviders([ | ||
{ | ||
provide: APP_FEATURE_ADMIN, | ||
useValue: true | ||
}, | ||
{ | ||
provide: ADMIN_TOPICS, | ||
multi: true, | ||
useValue: [ | ||
{ | ||
id: 'users', | ||
title: 'Users', | ||
ordinal: 0, | ||
path: 'users' | ||
}, | ||
|
||
{ | ||
id: 'cache-entries', | ||
title: 'Cache Entries', | ||
ordinal: 1, | ||
path: 'cacheEntries' | ||
}, | ||
{ | ||
id: 'end-user-agreements', | ||
title: 'EUAs', | ||
ordinal: 2, | ||
path: 'euas' | ||
}, | ||
{ | ||
id: 'messages', | ||
title: 'Messages', | ||
ordinal: 3, | ||
path: 'messages' | ||
}, | ||
{ | ||
id: 'feedback', | ||
title: 'Feedback', | ||
ordinal: 4, | ||
path: 'feedback' | ||
} | ||
] | ||
}, | ||
{ | ||
provide: ROUTES, | ||
multi: true, | ||
useValue: [ | ||
{ | ||
path: 'admin', | ||
loadChildren: () => import('./admin-routes').then((m) => m.ADMIN_ROUTES) | ||
} | ||
] | ||
} | ||
]); | ||
} |
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 @@ | ||
export * from './provider'; |
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 @@ | ||
export * from './public-api'; |
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,27 @@ | ||
import { InjectionToken, inject, makeEnvironmentProviders } from '@angular/core'; | ||
import { ROUTES } from '@angular/router'; | ||
|
||
export const APP_FEATURE_AUDIT = new InjectionToken<boolean>('APP_FEATURE_AUDIT'); | ||
|
||
export function injectAuditEnabled() { | ||
return inject(APP_FEATURE_AUDIT, { optional: true }) ?? false; | ||
} | ||
|
||
export function provideAuditFeature() { | ||
return makeEnvironmentProviders([ | ||
{ | ||
provide: APP_FEATURE_AUDIT, | ||
useValue: true | ||
}, | ||
{ | ||
provide: ROUTES, | ||
multi: true, | ||
useValue: [ | ||
{ | ||
path: 'audit', | ||
loadChildren: () => import('./audit-routes').then((m) => m.AUDIT_ROUTES) | ||
} | ||
] | ||
} | ||
]); | ||
} |
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 @@ | ||
export * from './provider'; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './public-api'; |
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,42 @@ | ||
import { InjectionToken, inject, makeEnvironmentProviders } from '@angular/core'; | ||
import { ROUTES } from '@angular/router'; | ||
|
||
import { GettingStartedHelpComponent } from './getting-started/getting-started-help.component'; | ||
import { HELP_TOPICS } from './help-topic.component'; | ||
|
||
export const APP_FEATURE_HELP = new InjectionToken<boolean>('APP_FEATURE_HELP'); | ||
|
||
export function injectHelpEnabled() { | ||
return inject(APP_FEATURE_HELP, { optional: true }) ?? false; | ||
} | ||
|
||
export function provideHelpFeature() { | ||
return makeEnvironmentProviders([ | ||
{ | ||
provide: APP_FEATURE_HELP, | ||
useValue: true | ||
}, | ||
{ | ||
provide: HELP_TOPICS, | ||
multi: true, | ||
useValue: [ | ||
{ | ||
id: 'getting-started', | ||
title: 'Getting Started', | ||
ordinal: 0, | ||
component: GettingStartedHelpComponent | ||
} | ||
] | ||
}, | ||
{ | ||
provide: ROUTES, | ||
multi: true, | ||
useValue: [ | ||
{ | ||
path: 'help', | ||
loadChildren: () => import('./help-routes').then((m) => m.HELP_ROUTES) | ||
} | ||
] | ||
} | ||
]); | ||
} |
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 @@ | ||
export * from './provider'; |
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.