@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.
- package/README.md +24 -24
- package/esm2020/lib/chevron/chevron.component.mjs +1 -1
- package/esm2020/lib/ngx-smarterplan-admin.service.mjs +1 -1
- package/esm2020/lib/organisation/organisation.component.mjs +1 -1
- package/esm2020/lib/user/detail-organisation/detail-organisation.component.mjs +37 -22
- package/esm2020/lib/user/user.component.mjs +19 -8
- package/esm2020/public-api.mjs +1 -1
- package/fesm2015/smarterplan-ngx-smarterplan-admin.mjs +54 -26
- package/fesm2015/smarterplan-ngx-smarterplan-admin.mjs.map +1 -1
- package/fesm2020/smarterplan-ngx-smarterplan-admin.mjs +52 -24
- package/fesm2020/smarterplan-ngx-smarterplan-admin.mjs.map +1 -1
- package/lib/user/detail-organisation/detail-organisation.component.d.ts +10 -3
- package/lib/user/user.component.d.ts +4 -3
- package/package.json +4 -3
|
@@ -16,7 +16,6 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
|
|
16
16
|
import * as i4$1 from 'ngx-clipboard';
|
|
17
17
|
import { ClipboardModule } from 'ngx-clipboard';
|
|
18
18
|
import { DateTime } from 'luxon';
|
|
19
|
-
import { v4 } from 'uuid';
|
|
20
19
|
import * as i2 from '@angular/router';
|
|
21
20
|
import { RouterModule } from '@angular/router';
|
|
22
21
|
import * as Papa from 'papaparse';
|
|
@@ -788,9 +787,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
788
787
|
class DetailOrganisationComponent {
|
|
789
788
|
constructor(organisationService,
|
|
790
789
|
// private localStripe: StripeService,
|
|
791
|
-
formBuilder) {
|
|
790
|
+
formBuilder, propertyService, missionService, translate) {
|
|
792
791
|
this.organisationService = organisationService;
|
|
793
792
|
this.formBuilder = formBuilder;
|
|
793
|
+
this.propertyService = propertyService;
|
|
794
|
+
this.missionService = missionService;
|
|
795
|
+
this.translate = translate;
|
|
794
796
|
this.orgChanged = new EventEmitter();
|
|
795
797
|
this.loading = false;
|
|
796
798
|
this.connectingStripe = false;
|
|
@@ -809,19 +811,20 @@ class DetailOrganisationComponent {
|
|
|
809
811
|
ngOnChanges() {
|
|
810
812
|
this.myOrg = this.currentOrg.id === this.org.id;
|
|
811
813
|
}
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
814
|
+
/**
|
|
815
|
+
* 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.
|
|
816
|
+
*/
|
|
817
|
+
// async onToken() {
|
|
818
|
+
// const token = uuidv4();
|
|
819
|
+
// const expires = new Date();
|
|
820
|
+
// expires.setDate(expires.getDate() + 7); // 7 days expiration
|
|
821
|
+
// this.org = await this.organisationService.updateOrganisation({
|
|
822
|
+
// id: this.org.id,
|
|
823
|
+
// shareToken: token,
|
|
824
|
+
// tokenExpiresAt: expires.getTime(),
|
|
825
|
+
// });
|
|
826
|
+
// this.orgChanged.emit(true);
|
|
827
|
+
// }
|
|
825
828
|
prettifyToken() {
|
|
826
829
|
const expirationDate = new Date(this.org.tokenExpiresAt);
|
|
827
830
|
const diffTime = expirationDate.getTime() - Date.now();
|
|
@@ -941,13 +944,27 @@ class DetailOrganisationComponent {
|
|
|
941
944
|
const target = event.target;
|
|
942
945
|
this.fileToUpload = target.files.item(0);
|
|
943
946
|
}
|
|
947
|
+
onDelete() {
|
|
948
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
949
|
+
const message = this.translate.instant("confirm.deleteOrganisation");
|
|
950
|
+
if (window.confirm(message) && this.org.id !== "6e28201f-4679-4c29-9d2d-8a325f57cee9") {
|
|
951
|
+
const propertiesToDelete = yield this.propertyService.getPropertiesForOrganisation(this.org.id);
|
|
952
|
+
yield this.organisationService.softDeteleOrg(this.org.id);
|
|
953
|
+
(yield this.missionService.getMissionsByOrganisation(this.org.id)).map((m) => this.missionService.softDeleteMission(m.id));
|
|
954
|
+
yield Promise.all(propertiesToDelete.map((property) => __awaiter(this, void 0, void 0, function* () {
|
|
955
|
+
yield this.propertyService.deleteProperty(property.id);
|
|
956
|
+
})));
|
|
957
|
+
this.orgChanged.emit(true);
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
}
|
|
944
961
|
}
|
|
945
|
-
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 });
|
|
946
|
-
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
|
|
962
|
+
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 });
|
|
963
|
+
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 } });
|
|
947
964
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: DetailOrganisationComponent, decorators: [{
|
|
948
965
|
type: Component,
|
|
949
|
-
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
|
|
950
|
-
}], ctorParameters: function () { return [{ type: i1.OrganisationService }, { type: i1$1.FormBuilder }]; }, propDecorators: { org: [{
|
|
966
|
+
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"] }]
|
|
967
|
+
}], ctorParameters: function () { return [{ type: i1.OrganisationService }, { type: i1$1.FormBuilder }, { type: i1.PropertyService }, { type: i1.MissionService }, { type: i3.TranslateService }]; }, propDecorators: { org: [{
|
|
951
968
|
type: Input
|
|
952
969
|
}], currentOrg: [{
|
|
953
970
|
type: Input
|
|
@@ -958,13 +975,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
958
975
|
}] } });
|
|
959
976
|
|
|
960
977
|
class UserComponent {
|
|
961
|
-
constructor(userService, missionService, domainService, organisationService, modalService, translate) {
|
|
978
|
+
constructor(userService, missionService, domainService, organisationService, modalService, translate, profileService) {
|
|
962
979
|
this.userService = userService;
|
|
963
980
|
this.missionService = missionService;
|
|
964
981
|
this.domainService = domainService;
|
|
965
982
|
this.organisationService = organisationService;
|
|
966
983
|
this.modalService = modalService;
|
|
967
984
|
this.translate = translate;
|
|
985
|
+
this.profileService = profileService;
|
|
968
986
|
this.detailsUser = '-1';
|
|
969
987
|
this.detailsOrg = '-1';
|
|
970
988
|
this.query = '';
|
|
@@ -974,7 +992,6 @@ class UserComponent {
|
|
|
974
992
|
this.createForExistingUser = false;
|
|
975
993
|
this.isAddingOrg = false;
|
|
976
994
|
this.isAddingToExistingOrg = false;
|
|
977
|
-
this.isManager = false;
|
|
978
995
|
this.hideList = false;
|
|
979
996
|
this.orgsUsersMissions = [];
|
|
980
997
|
this.isSP = false;
|
|
@@ -983,6 +1000,7 @@ class UserComponent {
|
|
|
983
1000
|
this.prestataireClients = [];
|
|
984
1001
|
this.loading = false;
|
|
985
1002
|
this.destroy$ = new Subject();
|
|
1003
|
+
this.profilesWithoutMission = [];
|
|
986
1004
|
}
|
|
987
1005
|
// @todo list my org and sub orgs
|
|
988
1006
|
ngOnInit() {
|
|
@@ -1047,7 +1065,6 @@ class UserComponent {
|
|
|
1047
1065
|
yield waitUntil(() => this.userService.cu !== undefined);
|
|
1048
1066
|
this.me = this.userService.cu;
|
|
1049
1067
|
this.currentOrg = this.userService.currentOrganisation();
|
|
1050
|
-
this.isManager = this.userService.hasManagerRoleInAnyMission();
|
|
1051
1068
|
this.isSP = this.userService.isSPAdmin();
|
|
1052
1069
|
this.isGuide = this.userService.isGuide();
|
|
1053
1070
|
this.resetList();
|
|
@@ -1060,6 +1077,7 @@ class UserComponent {
|
|
|
1060
1077
|
let allMissions = [];
|
|
1061
1078
|
let allOrgs = [];
|
|
1062
1079
|
allOrgs = yield this.organisationService.listOrganisations();
|
|
1080
|
+
allOrgs = allOrgs.filter((o) => !o.deletedAt);
|
|
1063
1081
|
yield Promise.all(allOrgs.map((org) => __awaiter(this, void 0, void 0, function* () {
|
|
1064
1082
|
const missions = yield this.missionService.getMissionsByOrganisation(org.id);
|
|
1065
1083
|
allMissions = [...allMissions, ...missions];
|
|
@@ -1090,6 +1108,16 @@ class UserComponent {
|
|
|
1090
1108
|
};
|
|
1091
1109
|
results.push(object);
|
|
1092
1110
|
});
|
|
1111
|
+
// get profiles without Missions
|
|
1112
|
+
let profilesWithoutMission = yield this.profileService.listCurrentProfiles();
|
|
1113
|
+
profilesWithoutMission = profilesWithoutMission.filter((profile) => !uniqueUsers.map((p) => p.id).includes(profile.id));
|
|
1114
|
+
if (profilesWithoutMission.length > 0) {
|
|
1115
|
+
this.profilesWithoutMission = [];
|
|
1116
|
+
profilesWithoutMission.forEach((profile) => {
|
|
1117
|
+
const user = new ProfileEntity(profile);
|
|
1118
|
+
this.profilesWithoutMission.push(user);
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1093
1121
|
return results;
|
|
1094
1122
|
});
|
|
1095
1123
|
}
|
|
@@ -1285,12 +1313,12 @@ class UserComponent {
|
|
|
1285
1313
|
return data.replace(/\s/g, '');
|
|
1286
1314
|
}
|
|
1287
1315
|
}
|
|
1288
|
-
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 });
|
|
1289
|
-
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 } });
|
|
1316
|
+
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 });
|
|
1317
|
+
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 } });
|
|
1290
1318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: UserComponent, decorators: [{
|
|
1291
1319
|
type: Component,
|
|
1292
|
-
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"] }]
|
|
1293
|
-
}], ctorParameters: function () { return [{ type: i1.BaseUserService }, { type: i1.MissionService }, { type: i1.DomainService }, { type: i1.OrganisationService }, { type: i4.NgbModal }, { type: i3.TranslateService }]; } });
|
|
1320
|
+
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"] }]
|
|
1321
|
+
}], ctorParameters: function () { return [{ type: i1.BaseUserService }, { type: i1.MissionService }, { type: i1.DomainService }, { type: i1.OrganisationService }, { type: i4.NgbModal }, { type: i3.TranslateService }, { type: i1.ProfileService }]; } });
|
|
1294
1322
|
|
|
1295
1323
|
function stringDateToMillis(dateString) {
|
|
1296
1324
|
const timestamp = DateTime.fromFormat(dateString);
|