@posiwise/shared-components 0.0.31 → 0.0.32

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.
@@ -1170,12 +1170,155 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1170
1170
  args: [{ selector: 'pw-groups', template: "<div>\n <section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams</h2>\n\n <p>\n Here you can define the teams for your Enterprise members. For example\n \"Corporate Sales Team\", \"Frontend Dev Team\" etc.\n <br />\n Once the teams created, you'll be able to add members to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n <div class=\"row\"\n *ngIf=\"!isGroupOperations\">\n <div class=\"col-12 d-flex justify-content-end align-items-center text-end\">\n <button *ngIf=\"hasAccess\"\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"groupOperation()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Add Team\n </button>\n <button *ngIf=\"hasAccess\"\n class=\"btn btn-sm btn-outline-primary ms-1\"\n [routerLink]=\"['/' + subscription?.slug + '/enterprise', 'groups', 'labels']\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Manage Team Categories\n </button>\n </div>\n </div>\n\n <!-- Add Group Template -->\n <div *ngIf=\"isGroupOperations\"\n class=\"mb-4\">\n <h4 class=\"card-title d-inline\">{{ viewEdit ? 'Update the' : 'Create a new' }} team</h4>\n\n <div class=\"mt-4\"\n *ngIf=\"!isGroupEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroup()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.TeamName' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.Description' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"description\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.TeamCategory' | transloco\n }}<span class=\"text-danger\">*</span>\n </label>\n <select class=\"form-select\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{\n 'is-invalid':\n submitted && form.controls['group_definition_id'].errors\n }\">\n <option *ngFor=\"let label of groupDefinition\"\n [value]=\"label.id\">\n {{ label.name }}\n </option>\n </select>\n </div>\n </div>\n\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n (click)=\"isGroupOperations = !isGroupOperations\"\n class=\"btn btn-outline-default me-2\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">Add</button>\n </div>\n </div>\n </form>\n </div>\n\n <!-- Edit Group Template -->\n <div class=\"mt-4\"\n *ngIf=\"isGroupEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.TeamName' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\"\n required=\"true\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.TeamDescription' | transloco }}</label>\n <input type=\"text\"\n value=\"{{ description }}\"\n class=\"form-control\"\n formControlName=\"description\"\n required=\"true\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.TeamCategory' | transloco\n }}<span class=\"text-danger\">*</span>\n </label>\n <select class=\"form-select\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{\n 'is-invalid':\n submitted && form.controls['group_definition_id'].errors\n }\">\n <option *ngFor=\"let label of groupDefinition\"\n [value]=\"label.id\">\n {{ label.name }}\n </option>\n </select>\n </div>\n </div>\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancelUpdate()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <div class=\"row\"\n *ngIf=\"!isGroupOperations\">\n <div class=\"col-4 mt-2 filter\">\n <select (change)=\"filterDomainsList($event)\"\n class=\"form-select\">\n <option value=\"0\">All Team Categories</option>\n <option *ngFor=\"let option of groupDefinition\"\n [value]=\"option.id\">\n {{ option.name }}\n </option>\n </select>\n </div>\n </div>\n <div class=\"w-100 text-center mt-3\"\n *ngIf=\"!isLoaded\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n <div class=\"row group_list my-4\"\n *ngIf=\"!isGroupOperations\">\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n *ngFor=\"let group of allGroups; trackBy: trackByGroup\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n <span><a class=\"badge bg-primary\">{{\n group?.group_definition_name\n }}</a></span>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n <a class=\"me-2 my-1\"\n *ngIf=\"hasAccess\"\n (click)=\"onDelete(group.id)\">\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i></a>\n <a class=\"me-2 my-1\"\n *ngIf=\"hasAccess\"\n (click)=\"editGroup(group.id)\"><i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i></a>\n <a class=\"me-2 my-1\"\n [routerLink]=\"[group.id, 'members']\"><i class=\"fa fa-tasks cta1-icon\" aria-hidden=\"true\"></i>\n </a>\n <a class=\"communications me-2 my-1\"\n (click)=\"navigateToCommunications(group.id)\"><i class=\"fa fa-comments cta2-icon\" aria-hidden=\"true\"></i></a>\n <a class=\"communications my-1\"\n (click)=\"navigateToDocumentations(group.id)\"><i class=\"fab fa-wikipedia-w cta1-icon\" aria-hidden=\"true\"></i></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n</div>\n<div *ngIf=\"allGroups?.length === 0 && hasAccess && !isGroupOperations && isLoaded\"\n class=\"clearboth\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoTeamMessage' | transloco\"> </pw-no-data>\n</div>\n<div *ngIf=\"allGroups?.length === 0 && !hasAccess && !isGroupOperations && isLoaded\"\n class=\"clearboth\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoTeamMessageIfUser' | transloco\"> </pw-no-data>\n</div>\n", styles: ["a.previous i{line-height:13px}.clearboth{clear:both}@media screen and (max-width: 480px){.filter{flex:none;max-width:100%!important}.communications{margin-top:2%}}\n"] }]
1171
1171
  }], ctorParameters: function () { return [{ type: i1$2.UntypedFormBuilder }, { type: i1.GroupService }, { type: i1.SubscriptionService }, { type: i1.DataService }, { type: i0.Injector }]; }, propDecorators: { saveGroup: [] } });
1172
1172
 
1173
- const primeNgModules = [
1174
- TabMenuModule,
1175
- ProgressSpinnerModule,
1176
- TableModule,
1177
- AutoCompleteModule
1178
- ];
1173
+ class GroupDefinitionComponent extends AppBaseComponent {
1174
+ constructor(groupservice, fb, subscriptionService, data, injector) {
1175
+ super(injector);
1176
+ this.groupservice = groupservice;
1177
+ this.fb = fb;
1178
+ this.subscriptionService = subscriptionService;
1179
+ this.data = data;
1180
+ this.subscriptions = [];
1181
+ this.admins = [];
1182
+ this.subscriptionInfo = [];
1183
+ this.isLoaded = false;
1184
+ this.form = this.fb.group({
1185
+ name: new UntypedFormControl('', [Validators.required]),
1186
+ description: new UntypedFormControl(''),
1187
+ is_private: [true]
1188
+ });
1189
+ }
1190
+ ngOnInit() {
1191
+ this.getUserSubscriptionId().subscribe(id => {
1192
+ this.id = id;
1193
+ });
1194
+ this.getAllGroupDefinition();
1195
+ this.getSubscribedUsers();
1196
+ this.userStore().subscribe(user => {
1197
+ this.user = user;
1198
+ });
1199
+ this.data.currentMessage.subscribe(message => {
1200
+ this.message = message;
1201
+ });
1202
+ }
1203
+ getAllGroupDefinition() {
1204
+ this.groupservice
1205
+ .groupDefinitionGetAll(this.id, 'Subscription')
1206
+ .subscribe(response => {
1207
+ if (response.group_definitions.length > 0) {
1208
+ this.groupDefinition = response.group_definitions;
1209
+ }
1210
+ else {
1211
+ this.groupDefinition = [];
1212
+ }
1213
+ })
1214
+ .add(() => {
1215
+ this.isLoaded = true;
1216
+ });
1217
+ }
1218
+ getSubscribedUsers() {
1219
+ this.subscriptionService.getEnrolledSubscription(this.id).subscribe(response => {
1220
+ this.subscriptionOwner = response.owner_id;
1221
+ this.admins = response.admins;
1222
+ this.enrolledUsers = response.members;
1223
+ this.enrolledUsers.forEach(element => {
1224
+ element.is_owner = element?.id === this.user?.id;
1225
+ });
1226
+ this.hasAccess =
1227
+ this.admins.includes(this.user?.id) ||
1228
+ this.user?.id === this.subscriptionOwner ||
1229
+ this.permissionService.isSuperAdmin();
1230
+ });
1231
+ }
1232
+ updateDetails() {
1233
+ const formValue = this.form.value;
1234
+ const data = {
1235
+ name: formValue.name,
1236
+ description: formValue.description,
1237
+ is_private: formValue.is_private
1238
+ };
1239
+ this.groupservice.groupDefinitionsUpdate(this.groupDefId, data).subscribe(() => {
1240
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.UpdatedMessage'));
1241
+ this.form.reset();
1242
+ this.viewDefinition = false;
1243
+ this.getAllGroupDefinition();
1244
+ });
1245
+ }
1246
+ onGroupDefinitionEdit(id) {
1247
+ this.viewEdit = true;
1248
+ this.viewDefinition = true;
1249
+ this.groupDefId = id;
1250
+ this.getSubscriptionDetails();
1251
+ }
1252
+ getSubscriptionDetails() {
1253
+ this.groupservice.getGroupDefinitionById(this.groupDefId).subscribe(response => {
1254
+ this.groupDefinitionDetails = response;
1255
+ this.form.patchValue({
1256
+ description: this.groupDefinitionDetails.description,
1257
+ name: this.groupDefinitionDetails.name
1258
+ });
1259
+ });
1260
+ }
1261
+ saveGroupDefinition() {
1262
+ const data = {
1263
+ name: this.form.value.name,
1264
+ description: this.form.value.description,
1265
+ related_entity_id: this.id,
1266
+ related_entity_type: TAG_ENTITY.SUBSCRIPTION,
1267
+ is_private: this.form.value.is_private
1268
+ };
1269
+ this.groupservice.groupDefinitions(data).subscribe(() => {
1270
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.AddedMessage'));
1271
+ this.form.reset();
1272
+ this.getAllGroupDefinition();
1273
+ this.viewDefinition = false;
1274
+ });
1275
+ }
1276
+ onDelete(id) {
1277
+ swal.fire({
1278
+ title: 'Delete',
1279
+ text: 'Are you sure you want to delete this label?',
1280
+ showCancelButton: true,
1281
+ reverseButtons: true,
1282
+ icon: 'warning'
1283
+ }).then(rep => {
1284
+ if (rep.value) {
1285
+ this.groupservice.groupDefinitionsDelete(id).subscribe(_ => {
1286
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.DeletedMessage'));
1287
+ this.getAllGroupDefinition();
1288
+ });
1289
+ }
1290
+ });
1291
+ }
1292
+ viewDefinitions() {
1293
+ this.viewDefinition = true;
1294
+ this.viewEdit = false;
1295
+ }
1296
+ previous() {
1297
+ this.location.back();
1298
+ this.data.changeMessage(1);
1299
+ }
1300
+ onCancel() {
1301
+ this.form.reset();
1302
+ this.viewDefinition = !this.viewDefinition;
1303
+ }
1304
+ ngOnDestroy() {
1305
+ super.ngOnDestroy();
1306
+ }
1307
+ }
1308
+ GroupDefinitionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GroupDefinitionComponent, deps: [{ token: i1.GroupService }, { token: i1$2.UntypedFormBuilder }, { token: i1.SubscriptionService }, { token: i1.DataService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1309
+ GroupDefinitionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: GroupDefinitionComponent, selector: "pw-groupdefinition", usesInheritance: true, ngImport: i0, template: "<section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams Categories</h2>\n\n <p>\n Here you can define the categories for your enterprise's groups. For example \"Sales\n Department\", \"Development Department\", etc.\n <br />\n Once the category created, you'll be able to add teams to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n <div class=\"row\"\n *ngIf=\"!viewDefinition\">\n <div class=\"col-6 d-flex align-items-center text-start mb-sm-3 mb-lg-0\">\n <a href=\"javascript:void(0)\"\n (click)=\"previous()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n </div>\n <div class=\"col-6\"\n *ngIf=\"hasAccess\">\n <button class=\"float-end btn btn-sm btn-outline-primary me-2\"\n (click)=\"viewDefinitions()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Create new Team Category\n </button>\n </div>\n </div>\n\n <div *ngIf=\"viewDefinition\">\n <h4 class=\"card-title d-inline mb-5\">\n {{ viewEdit ? 'Update the' : 'Create a new' }} category\n </h4>\n\n <div class=\"mt-4\"\n *ngIf=\"!viewEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroupDefinition()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Label.Name' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.Description' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"description\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.IsPrivate' | transloco }}</label>\n <div class=\"display-block\">\n <ui-switch size=\"small\"\n checkedLabel=\"True\"\n uncheckedLabel=\"false\"\n formControlName=\"is_private\">\n </ui-switch>\n </div>\n </div>\n </div>\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">Add Category</button>\n </div>\n </div>\n </form>\n </div>\n\n <div class=\"mt-4\"\n *ngIf=\"viewEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Label.Name' | transloco }}: </label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.Description' | transloco }}:</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"description\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.IsPrivate' | transloco }}</label>\n <div class=\"display-block\">\n <ui-switch size=\"small\"\n checkedLabel=\"True\"\n uncheckedLabel=\"false\"\n formControlName=\"is_private\">\n </ui-switch>\n </div>\n </div>\n </div>\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <div class=\"w-100 text-center mt-3\"\n *ngIf=\"!isLoaded\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n\n <ng-container *ngIf=\"groupDefinition?.length !== 0\">\n <div class=\"row mb-last-3 group-definitions-wrapper\"\n *ngIf=\"!viewDefinition\">\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n *ngFor=\"let group of groupDefinition\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n <a class=\"btn btn-sm btn-outline-danger me-2\"\n *ngIf=\"hasAccess\"\n (click)=\"onDelete(group.id)\">{{ 'Button.Delete' | transloco }}</a>\n <a class=\"btn btn-sm btn-outline-primary me-2\"\n *ngIf=\"hasAccess\"\n (click)=\"onGroupDefinitionEdit(group.id)\">{{ 'Button.Edit' | transloco }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n <div *ngIf=\"groupDefinition?.length === 0 && hasAccess && !viewDefinition && isLoaded\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoLabelsMessage' | transloco\"> </pw-no-data>\n </div>\n <div *ngIf=\"groupDefinition?.length === 0 && !hasAccess && isLoaded\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoLabelsUserMessage' | transloco\"> </pw-no-data>\n </div>\n</section>\n", styles: [".mb-last-3{margin-bottom:3rem}\n"], dependencies: [{ kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i7.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NoDataComponent, selector: "pw-no-data", inputs: ["message"] }, { kind: "pipe", type: i5.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: i1$1.SlicePipe, name: "slice" }] });
1310
+ __decorate([
1311
+ ValidateForm('form'),
1312
+ __metadata("design:type", Function),
1313
+ __metadata("design:paramtypes", []),
1314
+ __metadata("design:returntype", void 0)
1315
+ ], GroupDefinitionComponent.prototype, "saveGroupDefinition", null);
1316
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GroupDefinitionComponent, decorators: [{
1317
+ type: Component,
1318
+ args: [{ selector: 'pw-groupdefinition', template: "<section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams Categories</h2>\n\n <p>\n Here you can define the categories for your enterprise's groups. For example \"Sales\n Department\", \"Development Department\", etc.\n <br />\n Once the category created, you'll be able to add teams to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n <div class=\"row\"\n *ngIf=\"!viewDefinition\">\n <div class=\"col-6 d-flex align-items-center text-start mb-sm-3 mb-lg-0\">\n <a href=\"javascript:void(0)\"\n (click)=\"previous()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n </div>\n <div class=\"col-6\"\n *ngIf=\"hasAccess\">\n <button class=\"float-end btn btn-sm btn-outline-primary me-2\"\n (click)=\"viewDefinitions()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Create new Team Category\n </button>\n </div>\n </div>\n\n <div *ngIf=\"viewDefinition\">\n <h4 class=\"card-title d-inline mb-5\">\n {{ viewEdit ? 'Update the' : 'Create a new' }} category\n </h4>\n\n <div class=\"mt-4\"\n *ngIf=\"!viewEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroupDefinition()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Label.Name' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.Description' | transloco }}</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"description\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.IsPrivate' | transloco }}</label>\n <div class=\"display-block\">\n <ui-switch size=\"small\"\n checkedLabel=\"True\"\n uncheckedLabel=\"false\"\n formControlName=\"is_private\">\n </ui-switch>\n </div>\n </div>\n </div>\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">Add Category</button>\n </div>\n </div>\n </form>\n </div>\n\n <div class=\"mt-4\"\n *ngIf=\"viewEdit\">\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Label.Name' | transloco }}: </label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"name\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.Description' | transloco }}:</label>\n <input type=\"text\"\n class=\"form-control\"\n formControlName=\"description\" />\n </div>\n <div class=\"mb-3 col-xs-12 col-sm-6 col-md-3\">\n <label>{{ 'Enterprise.Teams.IsPrivate' | transloco }}</label>\n <div class=\"display-block\">\n <ui-switch size=\"small\"\n checkedLabel=\"True\"\n uncheckedLabel=\"false\"\n formControlName=\"is_private\">\n </ui-switch>\n </div>\n </div>\n </div>\n <div class=\"row text-end mt-4\">\n <div class=\"col-12\">\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n\n <div class=\"w-100 text-center mt-3\"\n *ngIf=\"!isLoaded\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n\n <ng-container *ngIf=\"groupDefinition?.length !== 0\">\n <div class=\"row mb-last-3 group-definitions-wrapper\"\n *ngIf=\"!viewDefinition\">\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n *ngFor=\"let group of groupDefinition\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n <a class=\"btn btn-sm btn-outline-danger me-2\"\n *ngIf=\"hasAccess\"\n (click)=\"onDelete(group.id)\">{{ 'Button.Delete' | transloco }}</a>\n <a class=\"btn btn-sm btn-outline-primary me-2\"\n *ngIf=\"hasAccess\"\n (click)=\"onGroupDefinitionEdit(group.id)\">{{ 'Button.Edit' | transloco }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n <div *ngIf=\"groupDefinition?.length === 0 && hasAccess && !viewDefinition && isLoaded\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoLabelsMessage' | transloco\"> </pw-no-data>\n </div>\n <div *ngIf=\"groupDefinition?.length === 0 && !hasAccess && isLoaded\">\n <pw-no-data [message]=\"'Enterprise.Teams.NoLabelsUserMessage' | transloco\"> </pw-no-data>\n </div>\n</section>\n", styles: [".mb-last-3{margin-bottom:3rem}\n"] }]
1319
+ }], ctorParameters: function () { return [{ type: i1.GroupService }, { type: i1$2.UntypedFormBuilder }, { type: i1.SubscriptionService }, { type: i1.DataService }, { type: i0.Injector }]; }, propDecorators: { saveGroupDefinition: [] } });
1320
+
1321
+ const primeNgModules = [TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule];
1179
1322
  class SharedComponentsModule {
1180
1323
  }
1181
1324
  SharedComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -1199,14 +1342,12 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1199
1342
  ComingSoonComponent,
1200
1343
  NoDataComponent,
1201
1344
  EntityGroupComponent,
1202
- GroupsComponent], imports: [FormsModule,
1345
+ GroupsComponent,
1346
+ GroupDefinitionComponent], imports: [FormsModule,
1203
1347
  ReactiveFormsModule,
1204
1348
  DirectivesModule,
1205
1349
  CoreTranslocoModule,
1206
- ImageCropperModule, TabMenuModule,
1207
- ProgressSpinnerModule,
1208
- TableModule,
1209
- AutoCompleteModule, PipesModule,
1350
+ ImageCropperModule, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule, PipesModule,
1210
1351
  CommonModule,
1211
1352
  SharedPublicComponentsModule,
1212
1353
  NgbModule], exports: [AbTestContainerComponent,
@@ -1215,10 +1356,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1215
1356
  CustomUploaderComponent,
1216
1357
  ProfileImageCropperComponent,
1217
1358
  ImageCropperModule,
1218
- PwTabsComponent, TabMenuModule,
1219
- ProgressSpinnerModule,
1220
- TableModule,
1221
- AutoCompleteModule, PermissionTreeComponent,
1359
+ PwTabsComponent, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule, PermissionTreeComponent,
1222
1360
  InputContainerComponent,
1223
1361
  FieldErrorDisplayComponent,
1224
1362
  PrivacyAndTosComponent,
@@ -1232,7 +1370,8 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1232
1370
  ComingSoonComponent,
1233
1371
  NoDataComponent,
1234
1372
  EntityGroupComponent,
1235
- GroupsComponent] });
1373
+ GroupsComponent,
1374
+ GroupDefinitionComponent] });
1236
1375
  SharedComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, imports: [FormsModule,
1237
1376
  ReactiveFormsModule,
1238
1377
  DirectivesModule,
@@ -1242,10 +1381,7 @@ SharedComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
1242
1381
  PipesModule,
1243
1382
  CommonModule,
1244
1383
  SharedPublicComponentsModule,
1245
- NgbModule, ImageCropperModule, TabMenuModule,
1246
- ProgressSpinnerModule,
1247
- TableModule,
1248
- AutoCompleteModule] });
1384
+ NgbModule, ImageCropperModule, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule] });
1249
1385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, decorators: [{
1250
1386
  type: NgModule,
1251
1387
  args: [{
@@ -1270,7 +1406,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1270
1406
  ComingSoonComponent,
1271
1407
  NoDataComponent,
1272
1408
  EntityGroupComponent,
1273
- GroupsComponent
1409
+ GroupsComponent,
1410
+ GroupDefinitionComponent
1274
1411
  ],
1275
1412
  imports: [
1276
1413
  FormsModule,
@@ -1307,7 +1444,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1307
1444
  ComingSoonComponent,
1308
1445
  NoDataComponent,
1309
1446
  EntityGroupComponent,
1310
- GroupsComponent
1447
+ GroupsComponent,
1448
+ GroupDefinitionComponent
1311
1449
  ]
1312
1450
  }]
1313
1451
  }] });
@@ -1316,5 +1454,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1316
1454
  * Generated bundle index. Do not edit.
1317
1455
  */
1318
1456
 
1319
- export { AbAlternativeComponent, AbTestContainerComponent, AppLoaderComponent, AuthenticatorComponent, ClearbitIconComponent, ComingSoonComponent, CustomUploaderComponent, EntityGroupComponent, FieldErrorDisplayComponent, GeoTemplateComponent, GroupsComponent, InputContainerComponent, NoDataComponent, PasswordValidationComponent, PermissionTreeComponent, PrivacyAndTosComponent, PrivacyPolicyComponent, ProfileImageCropperComponent, PwTabsComponent, SharedComponentsModule, SplashComponent, TermsConditionsComponent };
1457
+ export { AbAlternativeComponent, AbTestContainerComponent, AppLoaderComponent, AuthenticatorComponent, ClearbitIconComponent, ComingSoonComponent, CustomUploaderComponent, EntityGroupComponent, FieldErrorDisplayComponent, GeoTemplateComponent, GroupDefinitionComponent, GroupsComponent, InputContainerComponent, NoDataComponent, PasswordValidationComponent, PermissionTreeComponent, PrivacyAndTosComponent, PrivacyPolicyComponent, ProfileImageCropperComponent, PwTabsComponent, SharedComponentsModule, SplashComponent, TermsConditionsComponent };
1320
1458
  //# sourceMappingURL=shared-components.mjs.map