ngx-techlify-core 14.9.2 → 14.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/core/index.mjs +1 -2
- package/esm2020/lib/entity-files/index.mjs +2 -1
- package/esm2020/lib/techlify-company-switcher/index.mjs +3 -0
- package/esm2020/lib/techlify-company-switcher/techlify-company-switcher/techlify-company-switcher.component.mjs +68 -0
- package/esm2020/lib/techlify-company-switcher/techlify-company-switcher.module.mjs +32 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/ngx-techlify-core.mjs +91 -1
- package/fesm2015/ngx-techlify-core.mjs.map +1 -1
- package/fesm2020/ngx-techlify-core.mjs +89 -1
- package/fesm2020/ngx-techlify-core.mjs.map +1 -1
- package/lib/core/index.d.ts +0 -1
- package/lib/entity-files/index.d.ts +1 -0
- package/lib/techlify-company-switcher/index.d.ts +2 -0
- package/lib/techlify-company-switcher/techlify-company-switcher/techlify-company-switcher.component.d.ts +26 -0
- package/lib/techlify-company-switcher/techlify-company-switcher.module.d.ts +10 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -12925,6 +12925,94 @@ var restrictors_module = /*#__PURE__*/Object.freeze({
|
|
|
12925
12925
|
RestrictorsModule: RestrictorsModule
|
|
12926
12926
|
});
|
|
12927
12927
|
|
|
12928
|
+
class TechlifyCompanySwitcherComponent {
|
|
12929
|
+
constructor(http, credentialsService, alertService, currentUserService) {
|
|
12930
|
+
this.http = http;
|
|
12931
|
+
this.credentialsService = credentialsService;
|
|
12932
|
+
this.alertService = alertService;
|
|
12933
|
+
this.currentUserService = currentUserService;
|
|
12934
|
+
this.userClients = [];
|
|
12935
|
+
this.user = this.credentialsService.credentials?.user;
|
|
12936
|
+
}
|
|
12937
|
+
ngOnInit() {
|
|
12938
|
+
this.loadUserClients();
|
|
12939
|
+
}
|
|
12940
|
+
/**
|
|
12941
|
+
* Load User Clients.
|
|
12942
|
+
*/
|
|
12943
|
+
loadUserClients() {
|
|
12944
|
+
this.http.get('api/user-clients').subscribe({
|
|
12945
|
+
next: (response) => {
|
|
12946
|
+
this.userClients = response?.data;
|
|
12947
|
+
}
|
|
12948
|
+
});
|
|
12949
|
+
}
|
|
12950
|
+
/**
|
|
12951
|
+
* Switch the company.
|
|
12952
|
+
*
|
|
12953
|
+
* @param userClient
|
|
12954
|
+
*/
|
|
12955
|
+
switchClient(userClient) {
|
|
12956
|
+
// Do nothing is same client selected
|
|
12957
|
+
if (this.user.client_id === userClient.client_id) {
|
|
12958
|
+
return;
|
|
12959
|
+
}
|
|
12960
|
+
// Send request to change the client if client is different
|
|
12961
|
+
this.http.get(`api/switch-company/${userClient?.id}`).subscribe({
|
|
12962
|
+
next: (response) => {
|
|
12963
|
+
const data = {};
|
|
12964
|
+
this.alertService.addAlert(`Company switched to ${userClient?.client?.name}.`, 'success');
|
|
12965
|
+
const tokenInfo = response;
|
|
12966
|
+
tokenInfo.expires_in = Date.now() + (tokenInfo.expires_in * 1000);
|
|
12967
|
+
data.token = tokenInfo;
|
|
12968
|
+
data.user = {};
|
|
12969
|
+
this.credentialsService.setCredentials(data, true);
|
|
12970
|
+
// Update the auth status of the user.
|
|
12971
|
+
this.currentUserService.updateAuthStatus(true);
|
|
12972
|
+
return this.http.get('api/user/current').subscribe((response) => {
|
|
12973
|
+
data.user = response?.user;
|
|
12974
|
+
// set the user and reload the page
|
|
12975
|
+
this.credentialsService.setCredentials(data, true);
|
|
12976
|
+
this.user = data.user;
|
|
12977
|
+
window.location.reload();
|
|
12978
|
+
});
|
|
12979
|
+
}
|
|
12980
|
+
});
|
|
12981
|
+
}
|
|
12982
|
+
}
|
|
12983
|
+
TechlifyCompanySwitcherComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherComponent, deps: [{ token: HttpService }, { token: CredentialsService }, { token: AlertService }, { token: CurrentUserService }], target: i0.ɵɵFactoryTarget.Component });
|
|
12984
|
+
TechlifyCompanySwitcherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: TechlifyCompanySwitcherComponent, selector: "app-techlify-company-switcher", ngImport: i0, template: "<div\n mat-menu-item\n [matMenuTriggerFor]=\"menu\"\n>\n {{ user.client?.name }}\n</div>\n<mat-menu #menu=\"matMenu\">\n <button\n mat-menu-item\n *ngFor=\"let userClient of userClients\"\n (click)=\"switchClient(userClient)\"\n [disabled]=\"!userClient.is_enabled || userClient.client?.status_id == 3\"\n >\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span>\n {{ userClient?.client?.name }}\n </span>\n <span *ngIf=\"userClient?.client_id === user.client_id\" class=\"active-company\"></span>\n <span *ngIf=\"!userClient.is_enabled\">(disabled)</span>\n <span *ngIf=\"userClient.client?.status_id == 3\">(Inactive)</span>\n </div>\n </button>\n</mat-menu>\n", styles: [".active-company{width:10px;height:10px;background-color:#00ce00;border-radius:50%}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i8$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i8$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }] });
|
|
12985
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherComponent, decorators: [{
|
|
12986
|
+
type: Component,
|
|
12987
|
+
args: [{ selector: 'app-techlify-company-switcher', template: "<div\n mat-menu-item\n [matMenuTriggerFor]=\"menu\"\n>\n {{ user.client?.name }}\n</div>\n<mat-menu #menu=\"matMenu\">\n <button\n mat-menu-item\n *ngFor=\"let userClient of userClients\"\n (click)=\"switchClient(userClient)\"\n [disabled]=\"!userClient.is_enabled || userClient.client?.status_id == 3\"\n >\n <div class=\"d-flex justify-content-start align-items-center gap-2\">\n <span>\n {{ userClient?.client?.name }}\n </span>\n <span *ngIf=\"userClient?.client_id === user.client_id\" class=\"active-company\"></span>\n <span *ngIf=\"!userClient.is_enabled\">(disabled)</span>\n <span *ngIf=\"userClient.client?.status_id == 3\">(Inactive)</span>\n </div>\n </button>\n</mat-menu>\n", styles: [".active-company{width:10px;height:10px;background-color:#00ce00;border-radius:50%}\n"] }]
|
|
12988
|
+
}], ctorParameters: function () { return [{ type: HttpService }, { type: CredentialsService }, { type: AlertService }, { type: CurrentUserService }]; } });
|
|
12989
|
+
|
|
12990
|
+
class TechlifyCompanySwitcherModule {
|
|
12991
|
+
}
|
|
12992
|
+
TechlifyCompanySwitcherModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
12993
|
+
TechlifyCompanySwitcherModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherModule, declarations: [TechlifyCompanySwitcherComponent], imports: [CommonModule,
|
|
12994
|
+
MatMenuModule,
|
|
12995
|
+
MatButtonModule], exports: [TechlifyCompanySwitcherComponent] });
|
|
12996
|
+
TechlifyCompanySwitcherModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherModule, imports: [CommonModule,
|
|
12997
|
+
MatMenuModule,
|
|
12998
|
+
MatButtonModule] });
|
|
12999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TechlifyCompanySwitcherModule, decorators: [{
|
|
13000
|
+
type: NgModule,
|
|
13001
|
+
args: [{
|
|
13002
|
+
declarations: [
|
|
13003
|
+
TechlifyCompanySwitcherComponent
|
|
13004
|
+
],
|
|
13005
|
+
exports: [
|
|
13006
|
+
TechlifyCompanySwitcherComponent
|
|
13007
|
+
],
|
|
13008
|
+
imports: [
|
|
13009
|
+
CommonModule,
|
|
13010
|
+
MatMenuModule,
|
|
13011
|
+
MatButtonModule
|
|
13012
|
+
]
|
|
13013
|
+
}]
|
|
13014
|
+
}] });
|
|
13015
|
+
|
|
12928
13016
|
/*
|
|
12929
13017
|
* Public API Surface of ngx-techlify-core
|
|
12930
13018
|
*/
|
|
@@ -12933,5 +13021,5 @@ var restrictors_module = /*#__PURE__*/Object.freeze({
|
|
|
12933
13021
|
* Generated bundle index. Do not edit.
|
|
12934
13022
|
*/
|
|
12935
13023
|
|
|
12936
|
-
export { AccessControlConfigModule, ActionPopup, ActionPopupComponent, ActionPopupModule, AlertService, ApiPrefixInterceptor, AuditLogForModelComponent, AuditLogForModelModule, AuditLogForModelRoutingModule, AuditLogListComponent, AuditLogListFilterComponent, AuditLogListFilterModule, AuditLogListFilterRoutingModule, AuditLogListModule, AuditLogListRoutingModule, AuditLogModule, AuditLogRoutingModule, AuditLogViewComponent, AuditLogViewModelComponent, AuditLogViewModelModule, AuditLogViewModelRoutingModule, AuditLogViewModule, AuditLogViewRoutingModule, AuditLogsViewModelComponent, AuditLogsViewModelModule, AuditLogsViewModelRoutingModule, AuthenticationGuard, AuthenticationService, CacheInterceptor, ChangePasswordModule, CommentFormComponent, ConfigService, CoreModule, CredentialsService, CurrentUserService, DataManager, DataTable, DataTableComponent, DataTableModule, DateUtils, DateValidator, DocumentViewerComponent, DocumentViewerModule, EmailSubscriptionForUserComponent, EmailSubscriptionForUserModule, EmailSubscriptionForUserRoutingModule, EmailSubscriptionModule, EmailSubscriptionRoutingModule, EmailSubscriptionTypeFormComponent, EmailSubscriptionTypeFormModule, EmailSubscriptionTypeFormRoutingModule, EmailSubscriptionTypeListComponent, EmailSubscriptionTypeListModule, EmailSubscriptionTypeListRoutingModule, EmailSubscriptionTypeModule, EmailSubscriptionTypeRoutingModule, EmailSubscriptionUserFormComponent, EmailSubscriptionUserFormModule, EmailSubscriptionUserFormRoutingModule, EmailSubscriptionUserListComponent, EmailSubscriptionUserListFilterComponent, EmailSubscriptionUserListFilterModule, EmailSubscriptionUserListFilterRoutingModule, EmailSubscriptionUserListModule, EmailSubscriptionUserListRoutingModule, EmailSubscriptionUserModule, EmailSubscriptionUserRoutingModule, EntityFileFormComponent, EntityFilesViewAllComponent, EntityFilesViewAllModule, ErrorHandlerInterceptor, ErrorHandlerService, ErrorSnackComponent, ExportExcelButtonComponent, ExportExcelModule, FileDropperComponent, FileDropperConfig, FileDropperModule, FilterService, ForgotPasswordComponent, ForgotPasswordModule, ForgotPasswordRoutingModule, FormValidatorService, HTTP_DYNAMIC_INTERCEPTORS, HttpCacheService, HttpService, ImportCsvComponent, ImportCsvModule, LoaderComponent, LoaderModule, LogLevel, Logger, LoginComponent, LoginHistoryForUserComponent, LoginHistoryForUserModule, LoginHistoryForUserRoutingModule, LoginModule, LoginRoutingModule, MatSelectInfiniteScrollDirective, MaterialModule, MultiUserConfig, NgxTechlifyNotifierComponent, NgxTechlifyNotifierModule, NgxTechlifyNotifierRoutingModule, NgxTechlifyUsersModule, NoteFormComponent, NoteListComponent, NoteModule, NumItemsSelector, NumberSelector, PageEvent, Permission, PermissionModule, PermissionRoutingProvider, PermissionsManagementComponent, ProfileEditComponent, ProfileModule, ProfileRoutingModule, ReadMoreComponent, ReadMoreModule, RequestHelperService, RestrictorTypeSelectorComponent, RestrictorTypeSelectorModule, RestrictorsModule, Role, RoleFormComponent, RoleModule, RoleRoutingProvider, RoleService, RolesViewAllComponent, RouteReusableStrategy, SearchableSelectorComponent, SearchableSelectorModule, SignUpComponent, SignupModule, SignupRoutingModule, SnackModule, StorageService, SuccessSnackComponent, TechlifyConfig, TechlifyFeatureEnabledDirective, TechlifyFeatureListingComponent, TechlifyFeatureModule, TechlifyFeatureRoutes, TechlifyFormComponentInterface, TechlifyListingControllerInterface, TechlifyNotficationSubscriberDashboardComponent, TechlifyNotficationSubscriberDashboardModule, TechlifyNotficationSubscriberDashboardRoutingModule, TechlifyNotificationForUserComponent, TechlifyNotificationForUserModule, TechlifyNotificationForUserRoutingModule, TechlifyNotificationModule, TechlifyNotificationRoutingModule, TechlifyNotificationSubscriberFormComponent, TechlifyNotificationSubscriberFormModule, TechlifyNotificationSubscriberListComponent, TechlifyNotificationSubscriberListFilterComponent, TechlifyNotificationSubscriberListFilterModule, TechlifyNotificationSubscriberListModule, TechlifyNotificationSubscriberListRoutingModule, TechlifyNotificationSubscriberModule, TechlifyNotificationSubscriberRoutingModule, TechlifyNotificationSubscriptionEntity, TechlifyNotificationTypeFormComponent, TechlifyNotificationTypeFormModule, TechlifyNotificationTypeListComponent, TechlifyNotificationTypeListModule, TechlifyNotificationTypeListRoutingModule, TechlifyNotificationTypeModule, TechlifyNotificationTypeRoutingModule, TechlifyNotificationUserStatus, TechlifyServiceBaseClass, TechlifyTaggerTagFormConfigModel, TechlifyTaggerTagFormFieldComponent, TechlifyTaggerTagFormFieldModule, TechlifyTaggerTagSelectorComponent, TechlifyTaggerTagSelectorModule, TechlifyUpdateHistoryModule, TechlifyUpdateModule, TechlifyUpdateService, TechlifyUpdatesTeaserComponent, TechlifyUpdatesTeaserModule, Timeline, TimelineFilterComponent, TimelineFilterModule, TokenInterceptor, UpdateNotifierComponent, UpdateNotifierModule, User, UserConfig, UserConfigService, UserDataService, UserExploreComponent, UserFormComponent, UserListPageConfig, UserModule, UserRoutingProvider, UserSelectorComponent, UserSelectorModule, UserService, UsersViewAllComponent, UtilityModule, ViewerConfig, calculateTimeline, esfur, estlr, esulr };
|
|
13024
|
+
export { AccessControlConfigModule, ActionPopup, ActionPopupComponent, ActionPopupModule, AlertService, ApiPrefixInterceptor, AuditLogForModelComponent, AuditLogForModelModule, AuditLogForModelRoutingModule, AuditLogListComponent, AuditLogListFilterComponent, AuditLogListFilterModule, AuditLogListFilterRoutingModule, AuditLogListModule, AuditLogListRoutingModule, AuditLogModule, AuditLogRoutingModule, AuditLogViewComponent, AuditLogViewModelComponent, AuditLogViewModelModule, AuditLogViewModelRoutingModule, AuditLogViewModule, AuditLogViewRoutingModule, AuditLogsViewModelComponent, AuditLogsViewModelModule, AuditLogsViewModelRoutingModule, AuthenticationGuard, AuthenticationService, CacheInterceptor, ChangePasswordModule, CommentFormComponent, ConfigService, CoreModule, CredentialsService, CurrentUserService, DataManager, DataTable, DataTableComponent, DataTableModule, DateUtils, DateValidator, DocumentViewerComponent, DocumentViewerModule, EmailSubscriptionForUserComponent, EmailSubscriptionForUserModule, EmailSubscriptionForUserRoutingModule, EmailSubscriptionModule, EmailSubscriptionRoutingModule, EmailSubscriptionTypeFormComponent, EmailSubscriptionTypeFormModule, EmailSubscriptionTypeFormRoutingModule, EmailSubscriptionTypeListComponent, EmailSubscriptionTypeListModule, EmailSubscriptionTypeListRoutingModule, EmailSubscriptionTypeModule, EmailSubscriptionTypeRoutingModule, EmailSubscriptionUserFormComponent, EmailSubscriptionUserFormModule, EmailSubscriptionUserFormRoutingModule, EmailSubscriptionUserListComponent, EmailSubscriptionUserListFilterComponent, EmailSubscriptionUserListFilterModule, EmailSubscriptionUserListFilterRoutingModule, EmailSubscriptionUserListModule, EmailSubscriptionUserListRoutingModule, EmailSubscriptionUserModule, EmailSubscriptionUserRoutingModule, EntityFileFormComponent, EntityFileService, EntityFilesViewAllComponent, EntityFilesViewAllModule, ErrorHandlerInterceptor, ErrorHandlerService, ErrorSnackComponent, ExportExcelButtonComponent, ExportExcelModule, FileDropperComponent, FileDropperConfig, FileDropperModule, FilterService, ForgotPasswordComponent, ForgotPasswordModule, ForgotPasswordRoutingModule, FormValidatorService, HTTP_DYNAMIC_INTERCEPTORS, HttpCacheService, HttpService, ImportCsvComponent, ImportCsvModule, LoaderComponent, LoaderModule, LogLevel, Logger, LoginComponent, LoginHistoryForUserComponent, LoginHistoryForUserModule, LoginHistoryForUserRoutingModule, LoginModule, LoginRoutingModule, MatSelectInfiniteScrollDirective, MaterialModule, MultiUserConfig, NgxTechlifyNotifierComponent, NgxTechlifyNotifierModule, NgxTechlifyNotifierRoutingModule, NgxTechlifyUsersModule, NoteFormComponent, NoteListComponent, NoteModule, NumItemsSelector, NumberSelector, PageEvent, Permission, PermissionModule, PermissionRoutingProvider, PermissionsManagementComponent, ProfileEditComponent, ProfileModule, ProfileRoutingModule, ReadMoreComponent, ReadMoreModule, RequestHelperService, RestrictorTypeSelectorComponent, RestrictorTypeSelectorModule, RestrictorsModule, Role, RoleFormComponent, RoleModule, RoleRoutingProvider, RoleService, RolesViewAllComponent, RouteReusableStrategy, SearchableSelectorComponent, SearchableSelectorModule, SignUpComponent, SignupModule, SignupRoutingModule, SnackModule, StorageService, SuccessSnackComponent, TechlifyCompanySwitcherComponent, TechlifyCompanySwitcherModule, TechlifyConfig, TechlifyFeatureEnabledDirective, TechlifyFeatureListingComponent, TechlifyFeatureModule, TechlifyFeatureRoutes, TechlifyFormComponentInterface, TechlifyListingControllerInterface, TechlifyNotficationSubscriberDashboardComponent, TechlifyNotficationSubscriberDashboardModule, TechlifyNotficationSubscriberDashboardRoutingModule, TechlifyNotificationForUserComponent, TechlifyNotificationForUserModule, TechlifyNotificationForUserRoutingModule, TechlifyNotificationModule, TechlifyNotificationRoutingModule, TechlifyNotificationSubscriberFormComponent, TechlifyNotificationSubscriberFormModule, TechlifyNotificationSubscriberListComponent, TechlifyNotificationSubscriberListFilterComponent, TechlifyNotificationSubscriberListFilterModule, TechlifyNotificationSubscriberListModule, TechlifyNotificationSubscriberListRoutingModule, TechlifyNotificationSubscriberModule, TechlifyNotificationSubscriberRoutingModule, TechlifyNotificationSubscriptionEntity, TechlifyNotificationTypeFormComponent, TechlifyNotificationTypeFormModule, TechlifyNotificationTypeListComponent, TechlifyNotificationTypeListModule, TechlifyNotificationTypeListRoutingModule, TechlifyNotificationTypeModule, TechlifyNotificationTypeRoutingModule, TechlifyNotificationUserStatus, TechlifyServiceBaseClass, TechlifyTaggerTagFormConfigModel, TechlifyTaggerTagFormFieldComponent, TechlifyTaggerTagFormFieldModule, TechlifyTaggerTagSelectorComponent, TechlifyTaggerTagSelectorModule, TechlifyUpdateHistoryModule, TechlifyUpdateModule, TechlifyUpdateService, TechlifyUpdatesTeaserComponent, TechlifyUpdatesTeaserModule, Timeline, TimelineFilterComponent, TimelineFilterModule, TokenInterceptor, UpdateNotifierComponent, UpdateNotifierModule, User, UserConfig, UserConfigService, UserDataService, UserExploreComponent, UserFormComponent, UserListPageConfig, UserModule, UserRoutingProvider, UserSelectorComponent, UserSelectorModule, UserService, UsersViewAllComponent, UtilityModule, ViewerConfig, calculateTimeline, esfur, estlr, esulr };
|
|
12937
13025
|
//# sourceMappingURL=ngx-techlify-core.mjs.map
|