@smarterplan/ngx-smarterplan-admin 0.1.52 → 0.1.53

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.
@@ -15,7 +15,6 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
15
15
  import * as i4$1 from 'ngx-clipboard';
16
16
  import { ClipboardModule } from 'ngx-clipboard';
17
17
  import { DateTime } from 'luxon';
18
- import { v4 } from 'uuid';
19
18
  import * as i2 from '@angular/router';
20
19
  import { RouterModule } from '@angular/router';
21
20
  import * as Papa from 'papaparse';
@@ -747,9 +746,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
747
746
  class DetailOrganisationComponent {
748
747
  constructor(organisationService,
749
748
  // private localStripe: StripeService,
750
- formBuilder) {
749
+ formBuilder, propertyService, missionService, translate) {
751
750
  this.organisationService = organisationService;
752
751
  this.formBuilder = formBuilder;
752
+ this.propertyService = propertyService;
753
+ this.missionService = missionService;
754
+ this.translate = translate;
753
755
  this.orgChanged = new EventEmitter();
754
756
  this.loading = false;
755
757
  this.connectingStripe = false;
@@ -766,17 +768,20 @@ class DetailOrganisationComponent {
766
768
  ngOnChanges() {
767
769
  this.myOrg = this.currentOrg.id === this.org.id;
768
770
  }
769
- async onToken() {
770
- const token = v4();
771
- const expires = new Date();
772
- expires.setDate(expires.getDate() + 7); // 7 days expiration
773
- this.org = await this.organisationService.updateOrganisation({
774
- id: this.org.id,
775
- shareToken: token,
776
- tokenExpiresAt: expires.getTime(),
777
- });
778
- this.orgChanged.emit(true);
779
- }
771
+ /**
772
+ * Tokens were supposed to be used if Organisation exists already (created by one account) and it should be resused (by another account) instead of creating a duplicate.
773
+ */
774
+ // async onToken() {
775
+ // const token = uuidv4();
776
+ // const expires = new Date();
777
+ // expires.setDate(expires.getDate() + 7); // 7 days expiration
778
+ // this.org = await this.organisationService.updateOrganisation({
779
+ // id: this.org.id,
780
+ // shareToken: token,
781
+ // tokenExpiresAt: expires.getTime(),
782
+ // });
783
+ // this.orgChanged.emit(true);
784
+ // }
780
785
  prettifyToken() {
781
786
  const expirationDate = new Date(this.org.tokenExpiresAt);
782
787
  const diffTime = expirationDate.getTime() - Date.now();
@@ -894,13 +899,25 @@ class DetailOrganisationComponent {
894
899
  const target = event.target;
895
900
  this.fileToUpload = target.files.item(0);
896
901
  }
902
+ async onDelete() {
903
+ const message = this.translate.instant("confirm.deleteOrganisation");
904
+ if (window.confirm(message) && this.org.id !== "6e28201f-4679-4c29-9d2d-8a325f57cee9") {
905
+ const propertiesToDelete = await this.propertyService.getPropertiesForOrganisation(this.org.id);
906
+ await this.organisationService.softDeteleOrg(this.org.id);
907
+ (await this.missionService.getMissionsByOrganisation(this.org.id)).map((m) => this.missionService.softDeleteMission(m.id));
908
+ await Promise.all(propertiesToDelete.map(async (property) => {
909
+ await this.propertyService.deleteProperty(property.id);
910
+ }));
911
+ this.orgChanged.emit(true);
912
+ }
913
+ }
897
914
  }
898
- DetailOrganisationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DetailOrganisationComponent, deps: [{ token: i1.OrganisationService }, { token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
899
- DetailOrganisationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: DetailOrganisationComponent, selector: "lib-detail-organisation", inputs: { org: "org", currentOrg: "currentOrg", isSP: "isSP" }, outputs: { orgChanged: "orgChanged" }, usesOnChanges: true, ngImport: i0, template: "<div>\r\n <h5>{{'Organisation Details' | translate }}</h5>\r\n <div *ngIf=\"!editForm\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\">{{'Name' | translate}}: {{ org.name }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Logo' | translate }}: {{ org.logoUrl ? \"\" : \"No logo uploaded\"}} \r\n <img class=\"logo-img\" *ngIf=\"signedLogo\" [src]=\"signedLogo\">\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'SIRET' | translate }}: {{\r\n org.siret ? org.siret : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Address' | translate }}: {{\r\n org.address ? org.address : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'City' | translate }}: {{org.city }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Contact information' | translate}}:\r\n {{ org.contactDetails ? org.contactDetails : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"isSP\">\r\n <div class=\"row ml-0\">\r\n <div>\r\n {{'Active token' | translate }}:\r\n {{ org.shareToken ? prettifyToken() : ('No' | translate) }}\r\n </div>\r\n <div *ngIf=\"org.shareToken && !tokenExpired\" ngxClipboard [cbContent]=\"org.shareToken\"\r\n [style.cursor]=\"'pointer'\" style=\"margin-left: 5px; max-width: 20px;\" ngbTooltip=\"Copied!\"\r\n triggers=\"click:blur\">\r\n <span class=\"iconify\" data-icon=\"mdi:content-copy\" data-inline=\"false\" data-width=\"20\"\r\n data-height=\"20\"></span>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\">\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP || myOrg\"\r\n (click)=\"onEdit()\">\r\n {{'Edit' | translate}}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onToken()\">{{'Generate\r\n token' | translate}}</button>\r\n </div>\r\n </div>\r\n\r\n <!--Edit Form-->\r\n <div *ngIf=\"editForm\">\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"editForm\">\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Name' | translate}} *</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" [class.is-invalid]=\"name.invalid && name.touched\" required\r\n formControlName=\"name\">\r\n <div class=\"invalid-feedback\">\r\n {{'A name is required' | translate}}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Contact information' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"contactDetails\"\r\n placeholder=\"{{'Name, phone, email' | translate}}\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Address' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"address\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'City' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"city\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Postal code' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"postal\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'SIRET' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"siret\">\r\n </div>\r\n </div>\r\n \r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Logo' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <label for=\"file\" class=\"btn btn-label-file rounded-pill\">\r\n <input type=\"file\" id=\"file\" (change)=\"handleFileInput($event)\" />\r\n {{'Add logo image' | translate}}</label>\r\n <p class=\"fileToUploadName\" *ngIf=\"fileToUpload\">{{fileToUpload.name}}</p>\r\n </div>\r\n \r\n </div>\r\n <div class=\"action-button-container\">\r\n <button type=\"submit\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n [disabled]=\"editForm.invalid\">{{'Save' |\r\n translate}}</button>\r\n <button type=\"button\" (click)=\"onCancel()\"\r\n class=\"btn btn-outline-primary rounded-pill action-button\">{{'Cancel' |\r\n translate}}</button>\r\n </div>\r\n </form>\r\n </div>\r\n <!--Loading-->\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n\r\n <!--Stripe-->\r\n <hr>\r\n <h5>{{'stripe.account' | translate }}</h5>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.connectedAccountStripeID\">\r\n {{'stripe.connected' | translate }}: {{org.connectedAccountStripeID.substring(0, 15) }}...</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.stripeOnBoardingCompleted !== null\">\r\n {{'stripe.completed' | translate }}: {{org.stripeOnBoardingCompleted }}</li>\r\n </ul>\r\n <!-- <a *ngIf=\"(myOrg || isSP) && !org.connectedAccountStripeID\" id=\"linkStripe\" \r\n class=\"ml-3 stripe-connect\"><span>Connect with</span>\r\n </a>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-3 mb-3 ml-3 no-lowercase\"\r\n *ngIf=\"(myOrg || isSP) && org.connectedAccountStripeID && !org.stripeOnBoardingCompleted\"\r\n (click)=\"onCompleteOnboardingStripe()\">{{'stripe.toComplete' | translate}}</button> -->\r\n\r\n</div>", styles: [".form-group{margin:1.5rem 0}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.logo-img{height:100px;object-fit:contain;margin:4px 10px}\n"], components: [{ type: i1.LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4$1.ClipboardDirective, selector: "[ngxClipboard]", inputs: ["ngxClipboard", "container", "cbContent", "cbSuccessMsg"], outputs: ["cbOnSuccess", "cbOnError"] }, { type: i4.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "translate": i3.TranslatePipe } });
915
+ DetailOrganisationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DetailOrganisationComponent, deps: [{ token: i1.OrganisationService }, { token: i1$1.FormBuilder }, { token: i1.PropertyService }, { token: i1.MissionService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
916
+ DetailOrganisationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: DetailOrganisationComponent, selector: "lib-detail-organisation", inputs: { org: "org", currentOrg: "currentOrg", isSP: "isSP" }, outputs: { orgChanged: "orgChanged" }, usesOnChanges: true, ngImport: i0, template: "<div>\r\n <h5>{{'Organisation Details' | translate }}</h5>\r\n <div *ngIf=\"!editForm\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\">{{'Name' | translate}}: {{ org.name }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Logo' | translate }}: {{ org.logoUrl ? \"\" : \"No logo uploaded\"}} \r\n <img class=\"logo-img\" *ngIf=\"signedLogo\" [src]=\"signedLogo\">\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'SIRET' | translate }}: {{\r\n org.siret ? org.siret : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Address' | translate }}: {{\r\n org.address ? org.address : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'City' | translate }}: {{org.city }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Contact information' | translate}}:\r\n {{ org.contactDetails ? org.contactDetails : (\"No data\" | translate)}}</li>\r\n <!-- <li class=\"list-group-item bg-transparent\" *ngIf=\"isSP\">\r\n <div class=\"row ml-0\">\r\n <div>\r\n {{'Active token' | translate }}:\r\n {{ org.shareToken ? prettifyToken() : ('No' | translate) }}\r\n </div>\r\n <div *ngIf=\"org.shareToken && !tokenExpired\" ngxClipboard [cbContent]=\"org.shareToken\"\r\n [style.cursor]=\"'pointer'\" style=\"margin-left: 5px; max-width: 20px;\" ngbTooltip=\"Copied!\"\r\n triggers=\"click:blur\">\r\n <span class=\"iconify\" data-icon=\"mdi:content-copy\" data-inline=\"false\" data-width=\"20\"\r\n data-height=\"20\"></span>\r\n </div>\r\n </div>\r\n </li> -->\r\n </ul>\r\n <div class=\"action-button-container\">\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP || myOrg\"\r\n (click)=\"onEdit()\"> {{'Edit' | translate}}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onDelete()\"> {{'Delete' | translate}}</button>\r\n <!-- <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onToken()\">{{'Generate token' | translate}}</button> -->\r\n </div>\r\n </div>\r\n\r\n <!--Edit Form-->\r\n <div *ngIf=\"editForm\">\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"editForm\">\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Name' | translate}} *</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" [class.is-invalid]=\"name.invalid && name.touched\" required\r\n formControlName=\"name\">\r\n <div class=\"invalid-feedback\">\r\n {{'A name is required' | translate}}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Contact information' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"contactDetails\"\r\n placeholder=\"{{'Name, phone, email' | translate}}\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Address' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"address\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'City' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"city\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Postal code' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"postal\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'SIRET' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"siret\">\r\n </div>\r\n </div>\r\n \r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Logo' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <label for=\"file\" class=\"btn btn-label-file rounded-pill\">\r\n <input type=\"file\" id=\"file\" (change)=\"handleFileInput($event)\" />\r\n {{'Add logo image' | translate}}</label>\r\n <p class=\"fileToUploadName\" *ngIf=\"fileToUpload\">{{fileToUpload.name}}</p>\r\n </div>\r\n \r\n </div>\r\n <div class=\"action-button-container\">\r\n <button type=\"submit\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n [disabled]=\"editForm.invalid\">{{'Save' |\r\n translate}}</button>\r\n <button type=\"button\" (click)=\"onCancel()\"\r\n class=\"btn btn-outline-primary rounded-pill action-button\">{{'Cancel' |\r\n translate}}</button>\r\n </div>\r\n </form>\r\n </div>\r\n <!--Loading-->\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n\r\n <!--Stripe-->\r\n <!-- <hr>\r\n <h5>{{'stripe.account' | translate }}</h5>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.connectedAccountStripeID\">\r\n {{'stripe.connected' | translate }}: {{org.connectedAccountStripeID.substring(0, 15) }}...</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.stripeOnBoardingCompleted !== null\">\r\n {{'stripe.completed' | translate }}: {{org.stripeOnBoardingCompleted }}</li>\r\n </ul> -->\r\n</div>", styles: [".form-group{margin:1.5rem 0}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.logo-img{height:100px;object-fit:contain;margin:4px 10px}\n"], components: [{ type: i1.LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }], pipes: { "translate": i3.TranslatePipe } });
900
917
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DetailOrganisationComponent, decorators: [{
901
918
  type: Component,
902
- args: [{ selector: 'lib-detail-organisation', template: "<div>\r\n <h5>{{'Organisation Details' | translate }}</h5>\r\n <div *ngIf=\"!editForm\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\">{{'Name' | translate}}: {{ org.name }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Logo' | translate }}: {{ org.logoUrl ? \"\" : \"No logo uploaded\"}} \r\n <img class=\"logo-img\" *ngIf=\"signedLogo\" [src]=\"signedLogo\">\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'SIRET' | translate }}: {{\r\n org.siret ? org.siret : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Address' | translate }}: {{\r\n org.address ? org.address : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'City' | translate }}: {{org.city }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Contact information' | translate}}:\r\n {{ org.contactDetails ? org.contactDetails : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"isSP\">\r\n <div class=\"row ml-0\">\r\n <div>\r\n {{'Active token' | translate }}:\r\n {{ org.shareToken ? prettifyToken() : ('No' | translate) }}\r\n </div>\r\n <div *ngIf=\"org.shareToken && !tokenExpired\" ngxClipboard [cbContent]=\"org.shareToken\"\r\n [style.cursor]=\"'pointer'\" style=\"margin-left: 5px; max-width: 20px;\" ngbTooltip=\"Copied!\"\r\n triggers=\"click:blur\">\r\n <span class=\"iconify\" data-icon=\"mdi:content-copy\" data-inline=\"false\" data-width=\"20\"\r\n data-height=\"20\"></span>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\">\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP || myOrg\"\r\n (click)=\"onEdit()\">\r\n {{'Edit' | translate}}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onToken()\">{{'Generate\r\n token' | translate}}</button>\r\n </div>\r\n </div>\r\n\r\n <!--Edit Form-->\r\n <div *ngIf=\"editForm\">\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"editForm\">\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Name' | translate}} *</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" [class.is-invalid]=\"name.invalid && name.touched\" required\r\n formControlName=\"name\">\r\n <div class=\"invalid-feedback\">\r\n {{'A name is required' | translate}}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Contact information' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"contactDetails\"\r\n placeholder=\"{{'Name, phone, email' | translate}}\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Address' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"address\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'City' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"city\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Postal code' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"postal\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'SIRET' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"siret\">\r\n </div>\r\n </div>\r\n \r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Logo' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <label for=\"file\" class=\"btn btn-label-file rounded-pill\">\r\n <input type=\"file\" id=\"file\" (change)=\"handleFileInput($event)\" />\r\n {{'Add logo image' | translate}}</label>\r\n <p class=\"fileToUploadName\" *ngIf=\"fileToUpload\">{{fileToUpload.name}}</p>\r\n </div>\r\n \r\n </div>\r\n <div class=\"action-button-container\">\r\n <button type=\"submit\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n [disabled]=\"editForm.invalid\">{{'Save' |\r\n translate}}</button>\r\n <button type=\"button\" (click)=\"onCancel()\"\r\n class=\"btn btn-outline-primary rounded-pill action-button\">{{'Cancel' |\r\n translate}}</button>\r\n </div>\r\n </form>\r\n </div>\r\n <!--Loading-->\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n\r\n <!--Stripe-->\r\n <hr>\r\n <h5>{{'stripe.account' | translate }}</h5>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.connectedAccountStripeID\">\r\n {{'stripe.connected' | translate }}: {{org.connectedAccountStripeID.substring(0, 15) }}...</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.stripeOnBoardingCompleted !== null\">\r\n {{'stripe.completed' | translate }}: {{org.stripeOnBoardingCompleted }}</li>\r\n </ul>\r\n <!-- <a *ngIf=\"(myOrg || isSP) && !org.connectedAccountStripeID\" id=\"linkStripe\" \r\n class=\"ml-3 stripe-connect\"><span>Connect with</span>\r\n </a>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-3 mb-3 ml-3 no-lowercase\"\r\n *ngIf=\"(myOrg || isSP) && org.connectedAccountStripeID && !org.stripeOnBoardingCompleted\"\r\n (click)=\"onCompleteOnboardingStripe()\">{{'stripe.toComplete' | translate}}</button> -->\r\n\r\n</div>", styles: [".form-group{margin:1.5rem 0}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.logo-img{height:100px;object-fit:contain;margin:4px 10px}\n"] }]
903
- }], ctorParameters: function () { return [{ type: i1.OrganisationService }, { type: i1$1.FormBuilder }]; }, propDecorators: { org: [{
919
+ args: [{ selector: 'lib-detail-organisation', template: "<div>\r\n <h5>{{'Organisation Details' | translate }}</h5>\r\n <div *ngIf=\"!editForm\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\">{{'Name' | translate}}: {{ org.name }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Logo' | translate }}: {{ org.logoUrl ? \"\" : \"No logo uploaded\"}} \r\n <img class=\"logo-img\" *ngIf=\"signedLogo\" [src]=\"signedLogo\">\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'SIRET' | translate }}: {{\r\n org.siret ? org.siret : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Address' | translate }}: {{\r\n org.address ? org.address : (\"No data\" | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'City' | translate }}: {{org.city }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Contact information' | translate}}:\r\n {{ org.contactDetails ? org.contactDetails : (\"No data\" | translate)}}</li>\r\n <!-- <li class=\"list-group-item bg-transparent\" *ngIf=\"isSP\">\r\n <div class=\"row ml-0\">\r\n <div>\r\n {{'Active token' | translate }}:\r\n {{ org.shareToken ? prettifyToken() : ('No' | translate) }}\r\n </div>\r\n <div *ngIf=\"org.shareToken && !tokenExpired\" ngxClipboard [cbContent]=\"org.shareToken\"\r\n [style.cursor]=\"'pointer'\" style=\"margin-left: 5px; max-width: 20px;\" ngbTooltip=\"Copied!\"\r\n triggers=\"click:blur\">\r\n <span class=\"iconify\" data-icon=\"mdi:content-copy\" data-inline=\"false\" data-width=\"20\"\r\n data-height=\"20\"></span>\r\n </div>\r\n </div>\r\n </li> -->\r\n </ul>\r\n <div class=\"action-button-container\">\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP || myOrg\"\r\n (click)=\"onEdit()\"> {{'Edit' | translate}}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onDelete()\"> {{'Delete' | translate}}</button>\r\n <!-- <button class=\"btn btn-outline-primary rounded-pill mt-2 ml-3 action-button\" *ngIf=\"isSP\"\r\n (click)=\"onToken()\">{{'Generate token' | translate}}</button> -->\r\n </div>\r\n </div>\r\n\r\n <!--Edit Form-->\r\n <div *ngIf=\"editForm\">\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"editForm\">\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Name' | translate}} *</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" [class.is-invalid]=\"name.invalid && name.touched\" required\r\n formControlName=\"name\">\r\n <div class=\"invalid-feedback\">\r\n {{'A name is required' | translate}}\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Contact information' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"contactDetails\"\r\n placeholder=\"{{'Name, phone, email' | translate}}\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Address' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"address\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'City' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"city\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Postal code' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"postal\">\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'SIRET' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <input type=\"text\" class=\"form-control\" formControlName=\"siret\">\r\n </div>\r\n </div>\r\n \r\n <div class=\"form-group row\">\r\n <label class=\"col-sm-3 col-form-label\">{{'Logo' | translate}}</label>\r\n <div class=\"col-sm-9\">\r\n <label for=\"file\" class=\"btn btn-label-file rounded-pill\">\r\n <input type=\"file\" id=\"file\" (change)=\"handleFileInput($event)\" />\r\n {{'Add logo image' | translate}}</label>\r\n <p class=\"fileToUploadName\" *ngIf=\"fileToUpload\">{{fileToUpload.name}}</p>\r\n </div>\r\n \r\n </div>\r\n <div class=\"action-button-container\">\r\n <button type=\"submit\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n [disabled]=\"editForm.invalid\">{{'Save' |\r\n translate}}</button>\r\n <button type=\"button\" (click)=\"onCancel()\"\r\n class=\"btn btn-outline-primary rounded-pill action-button\">{{'Cancel' |\r\n translate}}</button>\r\n </div>\r\n </form>\r\n </div>\r\n <!--Loading-->\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n\r\n <!--Stripe-->\r\n <!-- <hr>\r\n <h5>{{'stripe.account' | translate }}</h5>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.connectedAccountStripeID\">\r\n {{'stripe.connected' | translate }}: {{org.connectedAccountStripeID.substring(0, 15) }}...</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"(isSP || myOrg) && org.stripeOnBoardingCompleted !== null\">\r\n {{'stripe.completed' | translate }}: {{org.stripeOnBoardingCompleted }}</li>\r\n </ul> -->\r\n</div>", styles: [".form-group{margin:1.5rem 0}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.logo-img{height:100px;object-fit:contain;margin:4px 10px}\n"] }]
920
+ }], ctorParameters: function () { return [{ type: i1.OrganisationService }, { type: i1$1.FormBuilder }, { type: i1.PropertyService }, { type: i1.MissionService }, { type: i3.TranslateService }]; }, propDecorators: { org: [{
904
921
  type: Input
905
922
  }], currentOrg: [{
906
923
  type: Input
@@ -911,13 +928,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
911
928
  }] } });
912
929
 
913
930
  class UserComponent {
914
- constructor(userService, missionService, domainService, organisationService, modalService, translate) {
931
+ constructor(userService, missionService, domainService, organisationService, modalService, translate, profileService) {
915
932
  this.userService = userService;
916
933
  this.missionService = missionService;
917
934
  this.domainService = domainService;
918
935
  this.organisationService = organisationService;
919
936
  this.modalService = modalService;
920
937
  this.translate = translate;
938
+ this.profileService = profileService;
921
939
  this.detailsUser = '-1';
922
940
  this.detailsOrg = '-1';
923
941
  this.query = '';
@@ -927,7 +945,6 @@ class UserComponent {
927
945
  this.createForExistingUser = false;
928
946
  this.isAddingOrg = false;
929
947
  this.isAddingToExistingOrg = false;
930
- this.isManager = false;
931
948
  this.hideList = false;
932
949
  this.orgsUsersMissions = [];
933
950
  this.isSP = false;
@@ -936,6 +953,7 @@ class UserComponent {
936
953
  this.prestataireClients = [];
937
954
  this.loading = false;
938
955
  this.destroy$ = new Subject();
956
+ this.profilesWithoutMission = [];
939
957
  }
940
958
  // @todo list my org and sub orgs
941
959
  async ngOnInit() {
@@ -995,7 +1013,6 @@ class UserComponent {
995
1013
  await waitUntil(() => this.userService.cu !== undefined);
996
1014
  this.me = this.userService.cu;
997
1015
  this.currentOrg = this.userService.currentOrganisation();
998
- this.isManager = this.userService.hasManagerRoleInAnyMission();
999
1016
  this.isSP = this.userService.isSPAdmin();
1000
1017
  this.isGuide = this.userService.isGuide();
1001
1018
  this.resetList();
@@ -1006,6 +1023,7 @@ class UserComponent {
1006
1023
  let allMissions = [];
1007
1024
  let allOrgs = [];
1008
1025
  allOrgs = await this.organisationService.listOrganisations();
1026
+ allOrgs = allOrgs.filter((o) => !o.deletedAt);
1009
1027
  await Promise.all(allOrgs.map(async (org) => {
1010
1028
  const missions = await this.missionService.getMissionsByOrganisation(org.id);
1011
1029
  allMissions = [...allMissions, ...missions];
@@ -1036,6 +1054,16 @@ class UserComponent {
1036
1054
  };
1037
1055
  results.push(object);
1038
1056
  });
1057
+ // get profiles without Missions
1058
+ let profilesWithoutMission = await this.profileService.listCurrentProfiles();
1059
+ profilesWithoutMission = profilesWithoutMission.filter((profile) => !uniqueUsers.map((p) => p.id).includes(profile.id));
1060
+ if (profilesWithoutMission.length > 0) {
1061
+ this.profilesWithoutMission = [];
1062
+ profilesWithoutMission.forEach((profile) => {
1063
+ const user = new ProfileEntity(profile);
1064
+ this.profilesWithoutMission.push(user);
1065
+ });
1066
+ }
1039
1067
  return results;
1040
1068
  }
1041
1069
  // eslint-disable-next-line class-methods-use-this
@@ -1214,12 +1242,12 @@ class UserComponent {
1214
1242
  return data.replace(/\s/g, '');
1215
1243
  }
1216
1244
  }
1217
- UserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: UserComponent, deps: [{ token: i1.BaseUserService }, { token: i1.MissionService }, { token: i1.DomainService }, { token: i1.OrganisationService }, { token: i4.NgbModal }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
1218
- UserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: UserComponent, selector: "lib-user", ngImport: i0, template: "<div class=\"dashboard-tab\">\r\n <div class=\"header-dashboard-tab\">\r\n <h3>{{'Users' | translate}}</h3>\r\n <!-- <app-search-bar *ngIf=\"!hideList\" [searchable]=\"orgsUsersMissions\" objectType=\"USER\"\r\n (searchEvent)=\"applyResultsSearchBar($event)\">\r\n </app-search-bar> -->\r\n <hr>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-8 col-lg-6\">\r\n <div class=\"row ml-0 mb-2\" *ngIf=\"!hideList\">\r\n <button class=\"btn btn-outline-primary rounded-pill add-button\" *ngIf=\"isManager && !isGuide\" (click)=\"onAddOrg()\">\r\n {{'Add user to new organisation' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n <div *ngIf=\"!hideList\">\r\n <ul class=\"list-group list-group-flush\" *ngIf=\"filteredOrgsUsersMissions\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let o of filteredOrgsUsersMissions\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details and users\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg(o.org.id, o.org)\">\r\n {{o.org.name}} <small *ngIf=\"o.org.id == currentOrg.id\">({{'My organisation' | translate}})</small>\r\n <small *ngIf=\"isSP && clientsSP.includes(o.org.id)\">({{'Client of SmarterPlan' | translate}})</small>\r\n <small *ngIf=\"isSP && getOrderedOrg(o.org.id)\">({{'Client of ' | translate}}\r\n {{getOrderedOrg(o.org.id)}})</small>\r\n <lib-chevron [conditionShowing]=\"detailsOrg==o.org.id\" [ngClass]=\"[getStringNoSpace(o.org.name)]\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg==o.org.id\">\r\n <div class='d-flex'>\r\n <button data-testid=\"user-new-btn\" class=\"btn btn-outline-primary rounded-pill mt-3 mb-3\" (click)=\"onAdd(o.org)\">{{'Add user' |\r\n translate}}</button>\r\n </div>\r\n\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-user-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let a of o.users\"\r\n (click)=\"onToggleDetailUser(a.user.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{a.user.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==a.user.id\" [ngClass]=\"[getStringNoSpace(a.user.displayName)]\"></lib-chevron>\r\n </div>\r\n\r\n <div *ngIf=\"detailsUser==a.user.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{a.user.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(o.org, a.user)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" (click)=\"onClearToken(a)\">\r\n {{'Clear Token' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(a.user)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{ a.missions.length > 0 ? ('Current Missions' | translate) : ('No missions' | translate)}}\r\n </div>\r\n </div>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item\" *ngFor=\"let mis of a.missions\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.description\">\r\n {{'Description' | translate}}: {{mis.description}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.templateMissionID\">\r\n {{'Attendee of tour' | translate}}: {{mis.templateMission.title}}</li>\r\n\r\n <li class=\"list-group-item bg-transparent\">{{'Role' | translate}}: {{ mis.role }}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.hashtags && mis.hashtags.length> 0\">\r\n {{'Hashtags' | translate}}: <ul class=\"keywordsDisplay no-border\">\r\n <div class=\"keywordsdisplayContainer\">\r\n <li class=\"keywordsItem\" *ngFor=\"let hashtag of mis.hashtags\">\r\n {{ hashtag | hashtagFromID | async }}</li>\r\n </div>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'Language' | translate }}: {{\r\n mis.locale ? mis.locale : ('Not applicable' | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Access level' | translate }}: {{\r\n mis.level}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Ordered by' | translate }}: {{\r\n mis.orderedOrganisation.name}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.domains\">{{'Domains' | translate }}:\r\n {{mis.domains ?\r\n domainIdsToStringForMission(mis) : (\"No data\" | translate) }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized location' | translate }}:\r\n {{ mis.space ? mis.space.name : \"No location\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized zone' | translate }}:\r\n {{ mis.zone ? mis.zone.name : \"All zones allowed\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Starts' | translate }}:\r\n {{ mis.startDateTime ? (mis.startDateTime | timeDateString: \"day_time_zone\" | async) :\r\n \"No data\" | translate}}, {{'Ends' | translate}}: {{ mis.endDateTime\r\n ? (mis.endDateTime | timeDateString: \"day_time_zone\" | async)\r\n : \"No data\" | translate}}.\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\" >\r\n <button type=\"button\" data-testid=\"edit-mission-btn\" class=\"btn btn-outline-primary rounded-pill mr-2 action-button\"\r\n (click)=\"onEdit(mis)\">{{'Edit' |\r\n translate}}</button>\r\n <button type=\"button\" *ngIf=\"mis.role === 'VISITOR' || mis.role === 'VISITOR_MUSEUM'\"\r\n class=\"btn btn-outline-primary rounded-pill mr-2 action-button share-visitor-button\"\r\n (click)=\"onSetForShareableLink(a.user, mis)\">{{'Generate Shareable Link' |\r\n translate}}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n (click)=\"onDeleteMission(mis)\">{{'Delete' | translate}}</button>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n\r\n <div *ngIf=\"create\">\r\n <lib-user-mission-form [addToOrganisation]=\"addToOrg\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (added)=\"userAdded($event)\">\r\n </lib-user-mission-form>\r\n </div>\r\n <div *ngIf=\"edit\">\r\n <lib-form-mission [missionToEdit]=\"missionToEdit\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n (addedMissionInput)=\"onMissionEdited($event)\"></lib-form-mission>\r\n </div>\r\n <div *ngIf=\"createForExistingUser\">\r\n <lib-form-mission [organisationForMission]=\"addToOrg\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n [userForMissionID]=\"userForAddingMission.id\" (addedMissionInput)=\"onMissionCreated($event)\">\r\n </lib-form-mission>\r\n </div>\r\n <div *ngIf=\"isAddingOrg || isAddingToExistingOrg\">\r\n <lib-form-organisation [currentOrg]=\"currentOrg\" [currentUser]=\"me\" [existing]=\"isAddingToExistingOrg\"\r\n (added)=\"orgAdded($event)\"></lib-form-organisation>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-4 col-lg-6\" *ngIf=\"orgSelectedDetails && !isGuide\">\r\n <lib-detail-organisation [org]=\"orgSelectedDetails\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (orgChanged)='orgAdded($event)'></lib-detail-organisation>\r\n </div>\r\n </div>\r\n</div>", styles: [".add-button{width:-moz-fit-content;width:fit-content;margin-left:.5rem}li.ml-4{margin-left:3rem}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.action-button-container .share-visitor-button{width:-moz-fit-content;width:fit-content}\n"], components: [{ type: i1.LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { type: ChevronComponent, selector: "lib-chevron", inputs: ["conditionShowing"] }, { type: UserMissionFormComponent, selector: "lib-user-mission-form", inputs: ["addToOrganisation", "isSP", "createForExistingUser", "currentOrg"], outputs: ["added"] }, { type: FormMissionComponent, selector: "lib-form-mission", inputs: ["missionToEdit", "organisationForMission", "isSP", "userForMissionID", "currentUserOrganisation"], outputs: ["addedMissionInput"] }, { type: FormOrganisationComponent, selector: "lib-form-organisation", inputs: ["currentOrg", "currentUser", "existing"], outputs: ["added"] }, { type: DetailOrganisationComponent, selector: "lib-detail-organisation", inputs: ["org", "currentOrg", "isSP"], outputs: ["orgChanged"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "async": i5.AsyncPipe, "hashtagFromID": i1.HashtagFromIdPipe, "timeDateString": i1.TimeDateToLocalStringPipe } });
1245
+ UserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: UserComponent, deps: [{ token: i1.BaseUserService }, { token: i1.MissionService }, { token: i1.DomainService }, { token: i1.OrganisationService }, { token: i4.NgbModal }, { token: i3.TranslateService }, { token: i1.ProfileService }], target: i0.ɵɵFactoryTarget.Component });
1246
+ UserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: UserComponent, selector: "lib-user", ngImport: i0, template: "<div class=\"dashboard-tab\">\r\n <div class=\"header-dashboard-tab\">\r\n <h3>{{'Users' | translate}}</h3>\r\n <!-- <app-search-bar *ngIf=\"!hideList\" [searchable]=\"orgsUsersMissions\" objectType=\"USER\"\r\n (searchEvent)=\"applyResultsSearchBar($event)\">\r\n </app-search-bar> -->\r\n <hr>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-8 col-lg-6\">\r\n <div class=\"row ml-0 mb-2\" *ngIf=\"!hideList\">\r\n <button class=\"btn btn-outline-primary rounded-pill add-button\" *ngIf=\"!isGuide\" (click)=\"onAddOrg()\">\r\n {{'Add user to new organisation' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n <div *ngIf=\"!hideList\">\r\n <ul class=\"list-group list-group-flush\" *ngIf=\"filteredOrgsUsersMissions\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let o of filteredOrgsUsersMissions\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details and users\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg(o.org.id, o.org)\">\r\n {{o.org.name}} <small *ngIf=\"o.org.id == currentOrg.id\">({{'My organisation' | translate}})</small>\r\n <small *ngIf=\"isSP && clientsSP.includes(o.org.id)\">({{'Client of SmarterPlan' | translate}})</small>\r\n <small *ngIf=\"isSP && getOrderedOrg(o.org.id)\">({{'Client of ' | translate}}\r\n {{getOrderedOrg(o.org.id)}})</small>\r\n <lib-chevron [conditionShowing]=\"detailsOrg==o.org.id\" [ngClass]=\"[getStringNoSpace(o.org.name)]\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg==o.org.id\">\r\n <div class='d-flex'>\r\n <button data-testid=\"user-new-btn\" class=\"btn btn-outline-primary rounded-pill mt-3 mb-3\" (click)=\"onAdd(o.org)\">{{'Add user' |\r\n translate}}</button>\r\n </div>\r\n\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-user-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let a of o.users\"\r\n (click)=\"onToggleDetailUser(a.user.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{a.user.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==a.user.id\" [ngClass]=\"[getStringNoSpace(a.user.displayName)]\"></lib-chevron>\r\n </div>\r\n\r\n <div *ngIf=\"detailsUser==a.user.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{a.user.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(o.org, a.user)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" (click)=\"onClearToken(a)\">\r\n {{'Clear Token' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(a.user)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{ a.missions.length > 0 ? ('Current Missions' | translate) : ('No missions' | translate)}}\r\n </div>\r\n </div>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item\" *ngFor=\"let mis of a.missions\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.description\">\r\n {{'Description' | translate}}: {{mis.description}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.templateMissionID\">\r\n {{'Attendee of tour' | translate}}: {{mis.templateMission.title}}</li>\r\n\r\n <li class=\"list-group-item bg-transparent\">{{'Role' | translate}}: {{ mis.role }}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.hashtags && mis.hashtags.length> 0\">\r\n {{'Hashtags' | translate}}: <ul class=\"keywordsDisplay no-border\">\r\n <div class=\"keywordsdisplayContainer\">\r\n <li class=\"keywordsItem\" *ngFor=\"let hashtag of mis.hashtags\">\r\n {{ hashtag | hashtagFromID | async }}</li>\r\n </div>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'Language' | translate }}: {{\r\n mis.locale ? mis.locale : ('Not applicable' | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Access level' | translate }}: {{\r\n mis.level}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Ordered by' | translate }}: {{\r\n mis.orderedOrganisation.name}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.domains\">{{'Domains' | translate }}:\r\n {{mis.domains ?\r\n domainIdsToStringForMission(mis) : (\"No data\" | translate) }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized location' | translate }}:\r\n {{ mis.space ? mis.space.name : \"No location\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized zone' | translate }}:\r\n {{ mis.zone ? mis.zone.name : \"All zones allowed\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Starts' | translate }}:\r\n {{ mis.startDateTime ? (mis.startDateTime | timeDateString: \"day_time_zone\" | async) :\r\n \"No data\" | translate}}, {{'Ends' | translate}}: {{ mis.endDateTime\r\n ? (mis.endDateTime | timeDateString: \"day_time_zone\" | async)\r\n : \"No data\" | translate}}.\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\" >\r\n <button type=\"button\" data-testid=\"edit-mission-btn\" class=\"btn btn-outline-primary rounded-pill mr-2 action-button\"\r\n (click)=\"onEdit(mis)\">{{'Edit' |\r\n translate}}</button>\r\n <button type=\"button\" *ngIf=\"mis.role === 'VISITOR' || mis.role === 'VISITOR_MUSEUM'\"\r\n class=\"btn btn-outline-primary rounded-pill mr-2 action-button share-visitor-button\"\r\n (click)=\"onSetForShareableLink(a.user, mis)\">{{'Generate Shareable Link' |\r\n translate}}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n (click)=\"onDeleteMission(mis)\">{{'Delete' | translate}}</button>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item list-group-item-action\" *ngIf=\"profilesWithoutMission && profilesWithoutMission.length > 0\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg('-2', null)\">\r\n {{\"Users without missions\" | translate}}\r\n <lib-chevron [conditionShowing]=\"detailsOrg=='-2'\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg=='-2'\">\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let profile of profilesWithoutMission\" \r\n (click)=\"onToggleDetailUser(profile.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{profile.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==profile.id\" [ngClass]=\"[getStringNoSpace(profile.displayName)]\"></lib-chevron>\r\n </div>\r\n <div *ngIf=\"detailsUser==profile.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{profile.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(currentOrg, profile)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(profile)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n\r\n <div *ngIf=\"create\">\r\n <lib-user-mission-form [addToOrganisation]=\"addToOrg\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (added)=\"userAdded($event)\">\r\n </lib-user-mission-form>\r\n </div>\r\n <div *ngIf=\"edit\">\r\n <lib-form-mission [missionToEdit]=\"missionToEdit\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n (addedMissionInput)=\"onMissionEdited($event)\"></lib-form-mission>\r\n </div>\r\n <div *ngIf=\"createForExistingUser\">\r\n <lib-form-mission [organisationForMission]=\"addToOrg\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n [userForMissionID]=\"userForAddingMission.id\" (addedMissionInput)=\"onMissionCreated($event)\">\r\n </lib-form-mission>\r\n </div>\r\n <div *ngIf=\"isAddingOrg || isAddingToExistingOrg\">\r\n <lib-form-organisation [currentOrg]=\"currentOrg\" [currentUser]=\"me\" [existing]=\"isAddingToExistingOrg\"\r\n (added)=\"orgAdded($event)\"></lib-form-organisation>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-4 col-lg-6\" *ngIf=\"orgSelectedDetails && !isGuide\">\r\n <lib-detail-organisation [org]=\"orgSelectedDetails\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (orgChanged)='orgAdded($event)'></lib-detail-organisation>\r\n </div>\r\n </div>\r\n</div>", styles: [".add-button{width:-moz-fit-content;width:fit-content;margin-left:.5rem}li.ml-4{margin-left:3rem}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.action-button-container .share-visitor-button{width:-moz-fit-content;width:fit-content}\n"], components: [{ type: i1.LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { type: ChevronComponent, selector: "lib-chevron", inputs: ["conditionShowing"] }, { type: UserMissionFormComponent, selector: "lib-user-mission-form", inputs: ["addToOrganisation", "isSP", "createForExistingUser", "currentOrg"], outputs: ["added"] }, { type: FormMissionComponent, selector: "lib-form-mission", inputs: ["missionToEdit", "organisationForMission", "isSP", "userForMissionID", "currentUserOrganisation"], outputs: ["addedMissionInput"] }, { type: FormOrganisationComponent, selector: "lib-form-organisation", inputs: ["currentOrg", "currentUser", "existing"], outputs: ["added"] }, { type: DetailOrganisationComponent, selector: "lib-detail-organisation", inputs: ["org", "currentOrg", "isSP"], outputs: ["orgChanged"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgbTooltip, selector: "[ngbTooltip]", inputs: ["animation", "autoClose", "placement", "triggers", "container", "disableTooltip", "tooltipClass", "openDelay", "closeDelay", "ngbTooltip"], outputs: ["shown", "hidden"], exportAs: ["ngbTooltip"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "translate": i3.TranslatePipe, "async": i5.AsyncPipe, "hashtagFromID": i1.HashtagFromIdPipe, "timeDateString": i1.TimeDateToLocalStringPipe } });
1219
1247
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: UserComponent, decorators: [{
1220
1248
  type: Component,
1221
- args: [{ selector: 'lib-user', template: "<div class=\"dashboard-tab\">\r\n <div class=\"header-dashboard-tab\">\r\n <h3>{{'Users' | translate}}</h3>\r\n <!-- <app-search-bar *ngIf=\"!hideList\" [searchable]=\"orgsUsersMissions\" objectType=\"USER\"\r\n (searchEvent)=\"applyResultsSearchBar($event)\">\r\n </app-search-bar> -->\r\n <hr>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-8 col-lg-6\">\r\n <div class=\"row ml-0 mb-2\" *ngIf=\"!hideList\">\r\n <button class=\"btn btn-outline-primary rounded-pill add-button\" *ngIf=\"isManager && !isGuide\" (click)=\"onAddOrg()\">\r\n {{'Add user to new organisation' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n <div *ngIf=\"!hideList\">\r\n <ul class=\"list-group list-group-flush\" *ngIf=\"filteredOrgsUsersMissions\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let o of filteredOrgsUsersMissions\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details and users\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg(o.org.id, o.org)\">\r\n {{o.org.name}} <small *ngIf=\"o.org.id == currentOrg.id\">({{'My organisation' | translate}})</small>\r\n <small *ngIf=\"isSP && clientsSP.includes(o.org.id)\">({{'Client of SmarterPlan' | translate}})</small>\r\n <small *ngIf=\"isSP && getOrderedOrg(o.org.id)\">({{'Client of ' | translate}}\r\n {{getOrderedOrg(o.org.id)}})</small>\r\n <lib-chevron [conditionShowing]=\"detailsOrg==o.org.id\" [ngClass]=\"[getStringNoSpace(o.org.name)]\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg==o.org.id\">\r\n <div class='d-flex'>\r\n <button data-testid=\"user-new-btn\" class=\"btn btn-outline-primary rounded-pill mt-3 mb-3\" (click)=\"onAdd(o.org)\">{{'Add user' |\r\n translate}}</button>\r\n </div>\r\n\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-user-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let a of o.users\"\r\n (click)=\"onToggleDetailUser(a.user.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{a.user.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==a.user.id\" [ngClass]=\"[getStringNoSpace(a.user.displayName)]\"></lib-chevron>\r\n </div>\r\n\r\n <div *ngIf=\"detailsUser==a.user.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{a.user.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(o.org, a.user)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" (click)=\"onClearToken(a)\">\r\n {{'Clear Token' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(a.user)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{ a.missions.length > 0 ? ('Current Missions' | translate) : ('No missions' | translate)}}\r\n </div>\r\n </div>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item\" *ngFor=\"let mis of a.missions\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.description\">\r\n {{'Description' | translate}}: {{mis.description}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.templateMissionID\">\r\n {{'Attendee of tour' | translate}}: {{mis.templateMission.title}}</li>\r\n\r\n <li class=\"list-group-item bg-transparent\">{{'Role' | translate}}: {{ mis.role }}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.hashtags && mis.hashtags.length> 0\">\r\n {{'Hashtags' | translate}}: <ul class=\"keywordsDisplay no-border\">\r\n <div class=\"keywordsdisplayContainer\">\r\n <li class=\"keywordsItem\" *ngFor=\"let hashtag of mis.hashtags\">\r\n {{ hashtag | hashtagFromID | async }}</li>\r\n </div>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'Language' | translate }}: {{\r\n mis.locale ? mis.locale : ('Not applicable' | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Access level' | translate }}: {{\r\n mis.level}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Ordered by' | translate }}: {{\r\n mis.orderedOrganisation.name}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.domains\">{{'Domains' | translate }}:\r\n {{mis.domains ?\r\n domainIdsToStringForMission(mis) : (\"No data\" | translate) }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized location' | translate }}:\r\n {{ mis.space ? mis.space.name : \"No location\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized zone' | translate }}:\r\n {{ mis.zone ? mis.zone.name : \"All zones allowed\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Starts' | translate }}:\r\n {{ mis.startDateTime ? (mis.startDateTime | timeDateString: \"day_time_zone\" | async) :\r\n \"No data\" | translate}}, {{'Ends' | translate}}: {{ mis.endDateTime\r\n ? (mis.endDateTime | timeDateString: \"day_time_zone\" | async)\r\n : \"No data\" | translate}}.\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\" >\r\n <button type=\"button\" data-testid=\"edit-mission-btn\" class=\"btn btn-outline-primary rounded-pill mr-2 action-button\"\r\n (click)=\"onEdit(mis)\">{{'Edit' |\r\n translate}}</button>\r\n <button type=\"button\" *ngIf=\"mis.role === 'VISITOR' || mis.role === 'VISITOR_MUSEUM'\"\r\n class=\"btn btn-outline-primary rounded-pill mr-2 action-button share-visitor-button\"\r\n (click)=\"onSetForShareableLink(a.user, mis)\">{{'Generate Shareable Link' |\r\n translate}}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n (click)=\"onDeleteMission(mis)\">{{'Delete' | translate}}</button>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n\r\n <div *ngIf=\"create\">\r\n <lib-user-mission-form [addToOrganisation]=\"addToOrg\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (added)=\"userAdded($event)\">\r\n </lib-user-mission-form>\r\n </div>\r\n <div *ngIf=\"edit\">\r\n <lib-form-mission [missionToEdit]=\"missionToEdit\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n (addedMissionInput)=\"onMissionEdited($event)\"></lib-form-mission>\r\n </div>\r\n <div *ngIf=\"createForExistingUser\">\r\n <lib-form-mission [organisationForMission]=\"addToOrg\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n [userForMissionID]=\"userForAddingMission.id\" (addedMissionInput)=\"onMissionCreated($event)\">\r\n </lib-form-mission>\r\n </div>\r\n <div *ngIf=\"isAddingOrg || isAddingToExistingOrg\">\r\n <lib-form-organisation [currentOrg]=\"currentOrg\" [currentUser]=\"me\" [existing]=\"isAddingToExistingOrg\"\r\n (added)=\"orgAdded($event)\"></lib-form-organisation>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-4 col-lg-6\" *ngIf=\"orgSelectedDetails && !isGuide\">\r\n <lib-detail-organisation [org]=\"orgSelectedDetails\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (orgChanged)='orgAdded($event)'></lib-detail-organisation>\r\n </div>\r\n </div>\r\n</div>", styles: [".add-button{width:-moz-fit-content;width:fit-content;margin-left:.5rem}li.ml-4{margin-left:3rem}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.action-button-container .share-visitor-button{width:-moz-fit-content;width:fit-content}\n"] }]
1222
- }], ctorParameters: function () { return [{ type: i1.BaseUserService }, { type: i1.MissionService }, { type: i1.DomainService }, { type: i1.OrganisationService }, { type: i4.NgbModal }, { type: i3.TranslateService }]; } });
1249
+ args: [{ selector: 'lib-user', template: "<div class=\"dashboard-tab\">\r\n <div class=\"header-dashboard-tab\">\r\n <h3>{{'Users' | translate}}</h3>\r\n <!-- <app-search-bar *ngIf=\"!hideList\" [searchable]=\"orgsUsersMissions\" objectType=\"USER\"\r\n (searchEvent)=\"applyResultsSearchBar($event)\">\r\n </app-search-bar> -->\r\n <hr>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-md-8 col-lg-6\">\r\n <div class=\"row ml-0 mb-2\" *ngIf=\"!hideList\">\r\n <button class=\"btn btn-outline-primary rounded-pill add-button\" *ngIf=\"!isGuide\" (click)=\"onAddOrg()\">\r\n {{'Add user to new organisation' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-center\" *ngIf=\"loading\">\r\n <lib-loader></lib-loader>\r\n </div>\r\n <div *ngIf=\"!hideList\">\r\n <ul class=\"list-group list-group-flush\" *ngIf=\"filteredOrgsUsersMissions\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let o of filteredOrgsUsersMissions\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details and users\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg(o.org.id, o.org)\">\r\n {{o.org.name}} <small *ngIf=\"o.org.id == currentOrg.id\">({{'My organisation' | translate}})</small>\r\n <small *ngIf=\"isSP && clientsSP.includes(o.org.id)\">({{'Client of SmarterPlan' | translate}})</small>\r\n <small *ngIf=\"isSP && getOrderedOrg(o.org.id)\">({{'Client of ' | translate}}\r\n {{getOrderedOrg(o.org.id)}})</small>\r\n <lib-chevron [conditionShowing]=\"detailsOrg==o.org.id\" [ngClass]=\"[getStringNoSpace(o.org.name)]\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg==o.org.id\">\r\n <div class='d-flex'>\r\n <button data-testid=\"user-new-btn\" class=\"btn btn-outline-primary rounded-pill mt-3 mb-3\" (click)=\"onAdd(o.org)\">{{'Add user' |\r\n translate}}</button>\r\n </div>\r\n\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-user-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let a of o.users\"\r\n (click)=\"onToggleDetailUser(a.user.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{a.user.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==a.user.id\" [ngClass]=\"[getStringNoSpace(a.user.displayName)]\"></lib-chevron>\r\n </div>\r\n\r\n <div *ngIf=\"detailsUser==a.user.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{a.user.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(o.org, a.user)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" (click)=\"onClearToken(a)\">\r\n {{'Clear Token' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(a.user)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{ a.missions.length > 0 ? ('Current Missions' | translate) : ('No missions' | translate)}}\r\n </div>\r\n </div>\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item\" *ngFor=\"let mis of a.missions\">\r\n <ul class=\"list-group list-group-flush\">\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.description\">\r\n {{'Description' | translate}}: {{mis.description}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.templateMissionID\">\r\n {{'Attendee of tour' | translate}}: {{mis.templateMission.title}}</li>\r\n\r\n <li class=\"list-group-item bg-transparent\">{{'Role' | translate}}: {{ mis.role }}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.hashtags && mis.hashtags.length> 0\">\r\n {{'Hashtags' | translate}}: <ul class=\"keywordsDisplay no-border\">\r\n <div class=\"keywordsdisplayContainer\">\r\n <li class=\"keywordsItem\" *ngFor=\"let hashtag of mis.hashtags\">\r\n {{ hashtag | hashtagFromID | async }}</li>\r\n </div>\r\n </ul>\r\n </li>\r\n <li class=\"list-group-item bg-transparent\">{{'Language' | translate }}: {{\r\n mis.locale ? mis.locale : ('Not applicable' | translate)}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Access level' | translate }}: {{\r\n mis.level}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Ordered by' | translate }}: {{\r\n mis.orderedOrganisation.name}}</li>\r\n <li class=\"list-group-item bg-transparent\" *ngIf=\"mis.domains\">{{'Domains' | translate }}:\r\n {{mis.domains ?\r\n domainIdsToStringForMission(mis) : (\"No data\" | translate) }}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized location' | translate }}:\r\n {{ mis.space ? mis.space.name : \"No location\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Authorized zone' | translate }}:\r\n {{ mis.zone ? mis.zone.name : \"All zones allowed\" | translate}}</li>\r\n <li class=\"list-group-item bg-transparent\">{{'Starts' | translate }}:\r\n {{ mis.startDateTime ? (mis.startDateTime | timeDateString: \"day_time_zone\" | async) :\r\n \"No data\" | translate}}, {{'Ends' | translate}}: {{ mis.endDateTime\r\n ? (mis.endDateTime | timeDateString: \"day_time_zone\" | async)\r\n : \"No data\" | translate}}.\r\n </li>\r\n </ul>\r\n <div class=\"action-button-container\" >\r\n <button type=\"button\" data-testid=\"edit-mission-btn\" class=\"btn btn-outline-primary rounded-pill mr-2 action-button\"\r\n (click)=\"onEdit(mis)\">{{'Edit' |\r\n translate}}</button>\r\n <button type=\"button\" *ngIf=\"mis.role === 'VISITOR' || mis.role === 'VISITOR_MUSEUM'\"\r\n class=\"btn btn-outline-primary rounded-pill mr-2 action-button share-visitor-button\"\r\n (click)=\"onSetForShareableLink(a.user, mis)\">{{'Generate Shareable Link' |\r\n translate}}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill action-button\"\r\n (click)=\"onDeleteMission(mis)\">{{'Delete' | translate}}</button>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n <li class=\"list-group-item list-group-item-action\" *ngIf=\"profilesWithoutMission && profilesWithoutMission.length > 0\">\r\n <div class=\"d-flex justify-content-between align-items-center font-weight-bold\"\r\n ngbTooltip=\"See details\" style=\"cursor: pointer;\" (click)=\"onToggleDetailOrg('-2', null)\">\r\n {{\"Users without missions\" | translate}}\r\n <lib-chevron [conditionShowing]=\"detailsOrg=='-2'\"></lib-chevron>\r\n </div>\r\n <div class=\"missions\" *ngIf=\"detailsOrg=='-2'\">\r\n <ul class=\"list-group list-group-flush\" data-testid=\"mission-organisation-list\">\r\n <li class=\"list-group-item list-group-item-action\" *ngFor=\"let profile of profilesWithoutMission\" \r\n (click)=\"onToggleDetailUser(profile.id)\">\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n {{profile.displayName}}\r\n <lib-chevron [conditionShowing]=\"detailsUser==profile.id\" [ngClass]=\"[getStringNoSpace(profile.displayName)]\"></lib-chevron>\r\n </div>\r\n <div *ngIf=\"detailsUser==profile.id\">\r\n <div class=\"ml-3\">\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n {{'Email' | translate}}: {{profile.email }}\r\n </div>\r\n <div class=\"d-flex justify-content-between align-items-center mt-3\">\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\" data-testid=\"mission-new-btn\"\r\n (click)=\"onAddForUser(currentOrg, profile)\">{{'Add new mission' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-primary rounded-pill\"\r\n (click)=\"onDeleteUser(profile)\">{{'Delete user' | translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n\r\n <div *ngIf=\"create\">\r\n <lib-user-mission-form [addToOrganisation]=\"addToOrg\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (added)=\"userAdded($event)\">\r\n </lib-user-mission-form>\r\n </div>\r\n <div *ngIf=\"edit\">\r\n <lib-form-mission [missionToEdit]=\"missionToEdit\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n (addedMissionInput)=\"onMissionEdited($event)\"></lib-form-mission>\r\n </div>\r\n <div *ngIf=\"createForExistingUser\">\r\n <lib-form-mission [organisationForMission]=\"addToOrg\" [currentUserOrganisation]=\"currentOrg\" [isSP]=\"isSP\"\r\n [userForMissionID]=\"userForAddingMission.id\" (addedMissionInput)=\"onMissionCreated($event)\">\r\n </lib-form-mission>\r\n </div>\r\n <div *ngIf=\"isAddingOrg || isAddingToExistingOrg\">\r\n <lib-form-organisation [currentOrg]=\"currentOrg\" [currentUser]=\"me\" [existing]=\"isAddingToExistingOrg\"\r\n (added)=\"orgAdded($event)\"></lib-form-organisation>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-md-4 col-lg-6\" *ngIf=\"orgSelectedDetails && !isGuide\">\r\n <lib-detail-organisation [org]=\"orgSelectedDetails\" [currentOrg]=\"currentOrg\" [isSP]=\"isSP\"\r\n (orgChanged)='orgAdded($event)'></lib-detail-organisation>\r\n </div>\r\n </div>\r\n</div>", styles: [".add-button{width:-moz-fit-content;width:fit-content;margin-left:.5rem}li.ml-4{margin-left:3rem}.action-button-container{display:flex;justify-content:space-evenly}.action-button-container .action-button{width:145px}.action-button-container .share-visitor-button{width:-moz-fit-content;width:fit-content}\n"] }]
1250
+ }], ctorParameters: function () { return [{ type: i1.BaseUserService }, { type: i1.MissionService }, { type: i1.DomainService }, { type: i1.OrganisationService }, { type: i4.NgbModal }, { type: i3.TranslateService }, { type: i1.ProfileService }]; } });
1223
1251
 
1224
1252
  function stringDateToMillis(dateString) {
1225
1253
  const timestamp = DateTime.fromFormat(dateString);