@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.
@@ -1185,12 +1185,157 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1185
1185
  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"] }]
1186
1186
  }], ctorParameters: function () { return [{ type: i1$2.UntypedFormBuilder }, { type: i1.GroupService }, { type: i1.SubscriptionService }, { type: i1.DataService }, { type: i0.Injector }]; }, propDecorators: { saveGroup: [] } });
1187
1187
 
1188
- const primeNgModules = [
1189
- TabMenuModule,
1190
- ProgressSpinnerModule,
1191
- TableModule,
1192
- AutoCompleteModule
1193
- ];
1188
+ class GroupDefinitionComponent extends AppBaseComponent {
1189
+ constructor(groupservice, fb, subscriptionService, data, injector) {
1190
+ super(injector);
1191
+ this.groupservice = groupservice;
1192
+ this.fb = fb;
1193
+ this.subscriptionService = subscriptionService;
1194
+ this.data = data;
1195
+ this.subscriptions = [];
1196
+ this.admins = [];
1197
+ this.subscriptionInfo = [];
1198
+ this.isLoaded = false;
1199
+ this.form = this.fb.group({
1200
+ name: new UntypedFormControl('', [Validators.required]),
1201
+ description: new UntypedFormControl(''),
1202
+ is_private: [true]
1203
+ });
1204
+ }
1205
+ ngOnInit() {
1206
+ this.getUserSubscriptionId().subscribe(id => {
1207
+ this.id = id;
1208
+ });
1209
+ this.getAllGroupDefinition();
1210
+ this.getSubscribedUsers();
1211
+ this.userStore().subscribe(user => {
1212
+ this.user = user;
1213
+ });
1214
+ this.data.currentMessage.subscribe(message => {
1215
+ this.message = message;
1216
+ });
1217
+ }
1218
+ getAllGroupDefinition() {
1219
+ this.groupservice
1220
+ .groupDefinitionGetAll(this.id, 'Subscription')
1221
+ .subscribe(response => {
1222
+ if (response.group_definitions.length > 0) {
1223
+ this.groupDefinition = response.group_definitions;
1224
+ }
1225
+ else {
1226
+ this.groupDefinition = [];
1227
+ }
1228
+ })
1229
+ .add(() => {
1230
+ this.isLoaded = true;
1231
+ });
1232
+ }
1233
+ getSubscribedUsers() {
1234
+ this.subscriptionService.getEnrolledSubscription(this.id).subscribe(response => {
1235
+ var _a, _b;
1236
+ this.subscriptionOwner = response.owner_id;
1237
+ this.admins = response.admins;
1238
+ this.enrolledUsers = response.members;
1239
+ this.enrolledUsers.forEach(element => {
1240
+ var _a;
1241
+ element.is_owner = (element === null || element === void 0 ? void 0 : element.id) === ((_a = this.user) === null || _a === void 0 ? void 0 : _a.id);
1242
+ });
1243
+ this.hasAccess =
1244
+ this.admins.includes((_a = this.user) === null || _a === void 0 ? void 0 : _a.id) ||
1245
+ ((_b = this.user) === null || _b === void 0 ? void 0 : _b.id) === this.subscriptionOwner ||
1246
+ this.permissionService.isSuperAdmin();
1247
+ });
1248
+ }
1249
+ updateDetails() {
1250
+ const formValue = this.form.value;
1251
+ const data = {
1252
+ name: formValue.name,
1253
+ description: formValue.description,
1254
+ is_private: formValue.is_private
1255
+ };
1256
+ this.groupservice.groupDefinitionsUpdate(this.groupDefId, data).subscribe(() => {
1257
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.UpdatedMessage'));
1258
+ this.form.reset();
1259
+ this.viewDefinition = false;
1260
+ this.getAllGroupDefinition();
1261
+ });
1262
+ }
1263
+ onGroupDefinitionEdit(id) {
1264
+ this.viewEdit = true;
1265
+ this.viewDefinition = true;
1266
+ this.groupDefId = id;
1267
+ this.getSubscriptionDetails();
1268
+ }
1269
+ getSubscriptionDetails() {
1270
+ this.groupservice.getGroupDefinitionById(this.groupDefId).subscribe(response => {
1271
+ this.groupDefinitionDetails = response;
1272
+ this.form.patchValue({
1273
+ description: this.groupDefinitionDetails.description,
1274
+ name: this.groupDefinitionDetails.name
1275
+ });
1276
+ });
1277
+ }
1278
+ saveGroupDefinition() {
1279
+ const data = {
1280
+ name: this.form.value.name,
1281
+ description: this.form.value.description,
1282
+ related_entity_id: this.id,
1283
+ related_entity_type: TAG_ENTITY.SUBSCRIPTION,
1284
+ is_private: this.form.value.is_private
1285
+ };
1286
+ this.groupservice.groupDefinitions(data).subscribe(() => {
1287
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.AddedMessage'));
1288
+ this.form.reset();
1289
+ this.getAllGroupDefinition();
1290
+ this.viewDefinition = false;
1291
+ });
1292
+ }
1293
+ onDelete(id) {
1294
+ swal.fire({
1295
+ title: 'Delete',
1296
+ text: 'Are you sure you want to delete this label?',
1297
+ showCancelButton: true,
1298
+ reverseButtons: true,
1299
+ icon: 'warning'
1300
+ }).then(rep => {
1301
+ if (rep.value) {
1302
+ this.groupservice.groupDefinitionsDelete(id).subscribe(_ => {
1303
+ this.toast.success(this.translation.translate('Admin.Shared.Definition.DeletedMessage'));
1304
+ this.getAllGroupDefinition();
1305
+ });
1306
+ }
1307
+ });
1308
+ }
1309
+ viewDefinitions() {
1310
+ this.viewDefinition = true;
1311
+ this.viewEdit = false;
1312
+ }
1313
+ previous() {
1314
+ this.location.back();
1315
+ this.data.changeMessage(1);
1316
+ }
1317
+ onCancel() {
1318
+ this.form.reset();
1319
+ this.viewDefinition = !this.viewDefinition;
1320
+ }
1321
+ ngOnDestroy() {
1322
+ super.ngOnDestroy();
1323
+ }
1324
+ }
1325
+ 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 });
1326
+ 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" }] });
1327
+ __decorate([
1328
+ ValidateForm('form'),
1329
+ __metadata("design:type", Function),
1330
+ __metadata("design:paramtypes", []),
1331
+ __metadata("design:returntype", void 0)
1332
+ ], GroupDefinitionComponent.prototype, "saveGroupDefinition", null);
1333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: GroupDefinitionComponent, decorators: [{
1334
+ type: Component,
1335
+ 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"] }]
1336
+ }], ctorParameters: function () { return [{ type: i1.GroupService }, { type: i1$2.UntypedFormBuilder }, { type: i1.SubscriptionService }, { type: i1.DataService }, { type: i0.Injector }]; }, propDecorators: { saveGroupDefinition: [] } });
1337
+
1338
+ const primeNgModules = [TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule];
1194
1339
  class SharedComponentsModule {
1195
1340
  }
1196
1341
  SharedComponentsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -1214,14 +1359,12 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1214
1359
  ComingSoonComponent,
1215
1360
  NoDataComponent,
1216
1361
  EntityGroupComponent,
1217
- GroupsComponent], imports: [FormsModule,
1362
+ GroupsComponent,
1363
+ GroupDefinitionComponent], imports: [FormsModule,
1218
1364
  ReactiveFormsModule,
1219
1365
  DirectivesModule,
1220
1366
  CoreTranslocoModule,
1221
- ImageCropperModule, TabMenuModule,
1222
- ProgressSpinnerModule,
1223
- TableModule,
1224
- AutoCompleteModule, PipesModule,
1367
+ ImageCropperModule, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule, PipesModule,
1225
1368
  CommonModule,
1226
1369
  SharedPublicComponentsModule,
1227
1370
  NgbModule], exports: [AbTestContainerComponent,
@@ -1230,10 +1373,7 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1230
1373
  CustomUploaderComponent,
1231
1374
  ProfileImageCropperComponent,
1232
1375
  ImageCropperModule,
1233
- PwTabsComponent, TabMenuModule,
1234
- ProgressSpinnerModule,
1235
- TableModule,
1236
- AutoCompleteModule, PermissionTreeComponent,
1376
+ PwTabsComponent, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule, PermissionTreeComponent,
1237
1377
  InputContainerComponent,
1238
1378
  FieldErrorDisplayComponent,
1239
1379
  PrivacyAndTosComponent,
@@ -1247,7 +1387,8 @@ SharedComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
1247
1387
  ComingSoonComponent,
1248
1388
  NoDataComponent,
1249
1389
  EntityGroupComponent,
1250
- GroupsComponent] });
1390
+ GroupsComponent,
1391
+ GroupDefinitionComponent] });
1251
1392
  SharedComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, imports: [FormsModule,
1252
1393
  ReactiveFormsModule,
1253
1394
  DirectivesModule,
@@ -1257,10 +1398,7 @@ SharedComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
1257
1398
  PipesModule,
1258
1399
  CommonModule,
1259
1400
  SharedPublicComponentsModule,
1260
- NgbModule, ImageCropperModule, TabMenuModule,
1261
- ProgressSpinnerModule,
1262
- TableModule,
1263
- AutoCompleteModule] });
1401
+ NgbModule, ImageCropperModule, TabMenuModule, ProgressSpinnerModule, TableModule, AutoCompleteModule] });
1264
1402
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: SharedComponentsModule, decorators: [{
1265
1403
  type: NgModule,
1266
1404
  args: [{
@@ -1285,7 +1423,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1285
1423
  ComingSoonComponent,
1286
1424
  NoDataComponent,
1287
1425
  EntityGroupComponent,
1288
- GroupsComponent
1426
+ GroupsComponent,
1427
+ GroupDefinitionComponent
1289
1428
  ],
1290
1429
  imports: [
1291
1430
  FormsModule,
@@ -1322,7 +1461,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1322
1461
  ComingSoonComponent,
1323
1462
  NoDataComponent,
1324
1463
  EntityGroupComponent,
1325
- GroupsComponent
1464
+ GroupsComponent,
1465
+ GroupDefinitionComponent
1326
1466
  ]
1327
1467
  }]
1328
1468
  }] });
@@ -1331,5 +1471,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImpor
1331
1471
  * Generated bundle index. Do not edit.
1332
1472
  */
1333
1473
 
1334
- export { AbAlternativeComponent, AbTestContainerComponent, AppLoaderComponent, AuthenticatorComponent, ClearbitIconComponent, ComingSoonComponent, CustomUploaderComponent, EntityGroupComponent, FieldErrorDisplayComponent, GeoTemplateComponent, GroupsComponent, InputContainerComponent, NoDataComponent, PasswordValidationComponent, PermissionTreeComponent, PrivacyAndTosComponent, PrivacyPolicyComponent, ProfileImageCropperComponent, PwTabsComponent, SharedComponentsModule, SplashComponent, TermsConditionsComponent };
1474
+ export { AbAlternativeComponent, AbTestContainerComponent, AppLoaderComponent, AuthenticatorComponent, ClearbitIconComponent, ComingSoonComponent, CustomUploaderComponent, EntityGroupComponent, FieldErrorDisplayComponent, GeoTemplateComponent, GroupDefinitionComponent, GroupsComponent, InputContainerComponent, NoDataComponent, PasswordValidationComponent, PermissionTreeComponent, PrivacyAndTosComponent, PrivacyPolicyComponent, ProfileImageCropperComponent, PwTabsComponent, SharedComponentsModule, SplashComponent, TermsConditionsComponent };
1335
1475
  //# sourceMappingURL=shared-components.mjs.map