mirror of https://github.com/abpframework/abp
parent
3e993c321d
commit
e397c0e0a8
@ -0,0 +1,19 @@
|
||||
<button class="btn btn-primary" type="button" (click)="openFeaturesModal()">
|
||||
<i class="fa fa-cog"></i>
|
||||
{{ 'Saas::ManageHostFeatures' | abpLocalization }}
|
||||
</button>
|
||||
<abp-feature-management
|
||||
*abpReplaceableTemplate="{
|
||||
inputs: {
|
||||
providerName: { value: 'T' },
|
||||
providerKey: { value: providerKey },
|
||||
visible: { value: visibleFeatures, twoWay: true }
|
||||
},
|
||||
outputs: { visibleChange: onVisibleFeaturesChange },
|
||||
componentKey: 'FeatureManagement.FeatureManagementComponent'
|
||||
}"
|
||||
[(visible)]="visibleFeatures"
|
||||
providerName="T"
|
||||
[providerKey]="providerKey"
|
||||
>
|
||||
</abp-feature-management>
|
||||
@ -0,0 +1,20 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'abp-feature-management-tab',
|
||||
templateUrl: './feature-management-tab.component.html',
|
||||
})
|
||||
export class FeatureManagementTabComponent {
|
||||
visibleFeatures = false;
|
||||
providerKey: string;
|
||||
|
||||
openFeaturesModal() {
|
||||
setTimeout(() => {
|
||||
this.visibleFeatures = true;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
onVisibleFeaturesChange = (value: boolean) => {
|
||||
this.visibleFeatures = value;
|
||||
};
|
||||
}
|
||||
@ -1 +1,2 @@
|
||||
export * from './feature-management/feature-management.component';
|
||||
export * from './feature-management-tab/feature-management-tab.component';
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
export const enum eFeatureManagementTabNames {
|
||||
FeatureManagement = 'AbpFeatureManagement::Features',
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
export * from './feature-management-tab-names';
|
||||
export * from './components';
|
||||
@ -1,15 +1,28 @@
|
||||
import { CoreModule } from '@abp/ng.core';
|
||||
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { FeatureManagementComponent } from './components/feature-management/feature-management.component';
|
||||
import { FreeTextInputDirective } from './directives/free-text-input.directive';
|
||||
import { FEATURE_MANAGEMENT_SETTINGS_PROVIDERS } from './providers';
|
||||
import { FeatureManagementTabComponent } from './components';
|
||||
|
||||
const exported = [FeatureManagementComponent, FreeTextInputDirective];
|
||||
const exported = [
|
||||
FeatureManagementComponent,
|
||||
FreeTextInputDirective,
|
||||
FeatureManagementTabComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [...exported],
|
||||
imports: [CoreModule, ThemeSharedModule, NgbNavModule],
|
||||
exports: [...exported],
|
||||
})
|
||||
export class FeatureManagementModule {}
|
||||
export class FeatureManagementModule {
|
||||
static forRoot(): ModuleWithProviders<FeatureManagementModule> {
|
||||
return {
|
||||
ngModule: FeatureManagementModule,
|
||||
providers: [FEATURE_MANAGEMENT_SETTINGS_PROVIDERS],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
import { SettingTabsService } from '@abp/ng.setting-management/config';
|
||||
import { APP_INITIALIZER } from '@angular/core';
|
||||
import { eFeatureManagementTabNames } from '../enums/feature-management-tab-names';
|
||||
import { FeatureManagementTabComponent } from '../components';
|
||||
|
||||
export const FEATURE_MANAGEMENT_SETTINGS_PROVIDERS = [
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
useFactory: configureSettingTabs,
|
||||
deps: [SettingTabsService],
|
||||
multi: true,
|
||||
},
|
||||
];
|
||||
|
||||
export function configureSettingTabs(settingtabs: SettingTabsService) {
|
||||
return () => {
|
||||
settingtabs.add([
|
||||
{
|
||||
name: eFeatureManagementTabNames.FeatureManagement,
|
||||
order: 104,
|
||||
requiredPolicy: 'FeatureManagement.ManageHostFeatures',
|
||||
component: FeatureManagementTabComponent,
|
||||
},
|
||||
]);
|
||||
};
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
export * from './feature-management-settings.provider';
|
||||
@ -1,5 +1,6 @@
|
||||
export * from './lib/components';
|
||||
export * from './lib/directives';
|
||||
export * from './lib/providers';
|
||||
export * from './lib/enums/components';
|
||||
export * from './lib/feature-management.module';
|
||||
export * from './lib/models';
|
||||
export * from './lib/models';
|
||||
|
||||
Loading…
Reference in new issue