@sumaris-net/ngx-components 2.6.11 → 2.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/app/admin/users/users.mjs +6 -21
- package/esm2020/src/app/core/form/entity/entity-metadata.component.mjs +3 -3
- package/esm2020/src/app/social/message/message.form.mjs +3 -3
- package/esm2020/src/app/social/message/message.service.mjs +29 -8
- package/fesm2015/sumaris-net.ngx-components.mjs +37 -29
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +35 -29
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/entity/entity-metadata.component.d.ts +1 -1
- package/src/app/social/message/message.service.d.ts +8 -3
- package/src/assets/manifest.json +1 -1
|
@@ -3,23 +3,28 @@ import { gql } from '@apollo/client/core';
|
|
|
3
3
|
import { SocialErrorCodes } from '../social.errors';
|
|
4
4
|
import { BaseGraphqlService } from '../../core/services/base-graphql-service.class';
|
|
5
5
|
import { ENVIRONMENT } from '../../../environments/environment.class';
|
|
6
|
+
import { Message } from './message.model';
|
|
6
7
|
import { MINIFY_ENTITY_FOR_POD } from '../../core/services/model/referential.model';
|
|
7
8
|
import { Toasts } from '../../shared/toast/toasts';
|
|
9
|
+
import { MessageModal } from './message.modal';
|
|
8
10
|
import * as i0 from "@angular/core";
|
|
9
11
|
import * as i1 from "../../core/graphql/graphql.service";
|
|
10
12
|
import * as i2 from "@ngx-translate/core";
|
|
11
13
|
import * as i3 from "@ionic/angular";
|
|
12
14
|
import * as i4 from "../../../environments/environment.class";
|
|
13
15
|
const Mutations = {
|
|
14
|
-
send: gql `
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
send: gql `
|
|
17
|
+
mutation SendMessage($data: MessageVOInput) {
|
|
18
|
+
done: sendMessage(message: $data)
|
|
19
|
+
}
|
|
20
|
+
`,
|
|
17
21
|
};
|
|
18
22
|
export class MessageService extends BaseGraphqlService {
|
|
19
|
-
constructor(graphql, translate, toastController, environment) {
|
|
23
|
+
constructor(graphql, translate, modalCtrl, toastController, environment) {
|
|
20
24
|
super(graphql, environment);
|
|
21
25
|
this.graphql = graphql;
|
|
22
26
|
this.translate = translate;
|
|
27
|
+
this.modalCtrl = modalCtrl;
|
|
23
28
|
this.toastController = toastController;
|
|
24
29
|
this.environment = environment;
|
|
25
30
|
// For DEV only
|
|
@@ -36,7 +41,7 @@ export class MessageService extends BaseGraphqlService {
|
|
|
36
41
|
const data = entity.asObject(MINIFY_ENTITY_FOR_POD);
|
|
37
42
|
const now = Date.now();
|
|
38
43
|
if (this._debug)
|
|
39
|
-
console.debug(`[message-service]
|
|
44
|
+
console.debug(`[message-service] Sending message...`);
|
|
40
45
|
try {
|
|
41
46
|
const { done } = await this.graphql.mutate({
|
|
42
47
|
mutation: Mutations.send,
|
|
@@ -61,6 +66,22 @@ export class MessageService extends BaseGraphqlService {
|
|
|
61
66
|
return false;
|
|
62
67
|
}
|
|
63
68
|
}
|
|
69
|
+
async openComposeModal(options) {
|
|
70
|
+
const hasTopModal = !!(await this.modalCtrl.getTop());
|
|
71
|
+
const modal = await this.modalCtrl.create({
|
|
72
|
+
component: MessageModal,
|
|
73
|
+
componentProps: options,
|
|
74
|
+
cssClass: hasTopModal && 'stack-modal',
|
|
75
|
+
});
|
|
76
|
+
// Open the modal
|
|
77
|
+
await modal.present();
|
|
78
|
+
// On dismiss
|
|
79
|
+
const { data } = await modal.onDidDismiss();
|
|
80
|
+
if (!data || !(data instanceof Message))
|
|
81
|
+
return; // CANCELLED
|
|
82
|
+
// Send message
|
|
83
|
+
await this.send(data, { showToast: options?.showToast });
|
|
84
|
+
}
|
|
64
85
|
/* -- protected methods -- */
|
|
65
86
|
async showToast(opts) {
|
|
66
87
|
return Toasts.show(this.toastController, this.translate, {
|
|
@@ -70,15 +91,15 @@ export class MessageService extends BaseGraphqlService {
|
|
|
70
91
|
});
|
|
71
92
|
}
|
|
72
93
|
}
|
|
73
|
-
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: i1.GraphqlService }, { token: i2.TranslateService }, { token: i3.ToastController }, { token: ENVIRONMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
94
|
+
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: i1.GraphqlService }, { token: i2.TranslateService }, { token: i3.ModalController }, { token: i3.ToastController }, { token: ENVIRONMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
74
95
|
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, providedIn: 'root' });
|
|
75
96
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, decorators: [{
|
|
76
97
|
type: Injectable,
|
|
77
98
|
args: [{ providedIn: 'root' }]
|
|
78
|
-
}], ctorParameters: function () { return [{ type: i1.GraphqlService }, { type: i2.TranslateService }, { type: i3.ToastController }, { type: i4.Environment, decorators: [{
|
|
99
|
+
}], ctorParameters: function () { return [{ type: i1.GraphqlService }, { type: i2.TranslateService }, { type: i3.ModalController }, { type: i3.ToastController }, { type: i4.Environment, decorators: [{
|
|
79
100
|
type: Optional
|
|
80
101
|
}, {
|
|
81
102
|
type: Inject,
|
|
82
103
|
args: [ENVIRONMENT]
|
|
83
104
|
}] }]; } });
|
|
84
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
105
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2FwcC9zb2NpYWwvbWVzc2FnZS9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b2xsZXIsIHRoaXMudHJhbnNsYXRlLCB7XG4gICAgICB0eXBlOiAnaW5mbycsXG4gICAgICBtZXNzYWdlOiAnU09DSUFMLklORk8uTUVTU0FHRV9TRU5UJyxcbiAgICAgIC4uLm9wdHNcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -30712,10 +30712,10 @@ class EntityMetadataComponent {
|
|
|
30712
30712
|
}
|
|
30713
30713
|
}
|
|
30714
30714
|
EntityMetadataComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EntityMetadataComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30715
|
-
EntityMetadataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: EntityMetadataComponent, selector: "app-entity-metadata", inputs: { value: "value", showRecorder: "showRecorder" }, ngImport: i0, template: "<ng-container *ngIf=\"value && value.id\">\n <ion-card @fadeInAnimation>\n\n <!-- recorder -->\n <ion-item color=\"light\"\n *ngIf=\"showRecorder && value &&
|
|
30715
|
+
EntityMetadataComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: EntityMetadataComponent, selector: "app-entity-metadata", inputs: { value: "value", showRecorder: "showRecorder" }, ngImport: i0, template: "<ng-container *ngIf=\"value && value.id\">\n <ion-card @fadeInAnimation>\n\n <!-- recorder -->\n <ion-item color=\"light\"\n *ngIf=\"showRecorder && value && (value.recorderDepartment || value.recorderPerson)\">\n\n <!-- recorder avatar -->\n <ion-avatar slot=\"start\" *ngIf=\"value.recorderPerson; let recorderPerson\">\n <img *ngIf=\"recorderPerson.avatar; else generateAvatar\"\n src=\"{{ recorderPerson.avatar }}\">\n <ng-template #generateAvatar>\n <svg *ngIf=\"recorderPerson.id; let personId\"\n width=\"38\" height=\"38\" [data-jdenticon-value]=\"personId\"></svg>\n </ng-template>\n </ion-avatar>\n\n <!-- recorder name -->\n <ion-label>\n <ion-card-subtitle translate>COMMON.RECORDER</ion-card-subtitle>\n <ion-card-title>{{value.recorderPerson?.firstName}} {{value.recorderPerson?.lastName}}</ion-card-title>\n <ion-card-subtitle>{{value.recorderDepartment?.label}}</ion-card-subtitle>\n </ion-label>\n\n <ng-content select=\"[recorderSuffix]\"></ng-content>\n </ion-item>\n\n <ion-card-content>\n <ion-label class=\"ion-text-wrap status\">\n <!-- creation date -->\n <ion-text *ngIf=\"value.creationDate\">\n <ion-icon name=\"calendar\"></ion-icon> \n <span translate>COMMON.CREATED_ON</span>\n <span> <b>{{ value.creationDate | dateFormat: {time: true} }}</b></span>\n </ion-text>\n\n <!-- update date -->\n <ion-text *ngIf=\"value.updateDate && value.updateDate != value.creationDate\">\n <br *ngIf=\"value.creationDate\"/>\n <ion-label>\n <ion-icon name=\"time-outline\"></ion-icon> \n <span translate>COMMON.UPDATED_ON</span>\n <span> {{ value.updateDate | dateFormat: {time: true, seconds: true} }}</span>\n </ion-label>\n </ion-text>\n\n </ion-label>\n\n <ng-content></ng-content>\n\n </ion-card-content>\n </ion-card>\n</ng-container>\n", styles: ["ion-card ion-avatar{height:40px;width:40px}ion-card ion-avatar img,ion-card ion-avatar svg{border:solid 1px rgba(0,0,0,.2)}ion-card ion-avatar img{background-color:var(--ion-color-secondary)!important}ion-card ion-avatar svg{border-radius:20px;height:38px;width:38px}ion-card ion-card-content{background-color:var(--ion-color-light-tint)}ion-card ion-card-content ion-label.status,ion-card ion-card-content * ion-label.status{font-size:12px!important;color:var(--ion-color-step-850)}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.IonAvatar, selector: "ion-avatar" }, { kind: "component", type: i2$1.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: i2$1.IonCardContent, selector: "ion-card-content", inputs: ["mode"] }, { kind: "component", type: i2$1.IonCardSubtitle, selector: "ion-card-subtitle", inputs: ["color", "mode"] }, { kind: "component", type: i2$1.IonCardTitle, selector: "ion-card-title", inputs: ["color", "mode"] }, { kind: "component", type: i2$1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2$1.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2$1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i4$3.SvgJdenticonDirective, selector: "svg[data-jdenticon-hash],svg[data-jdenticon-value]", inputs: ["data-jdenticon-hash", "data-jdenticon-value", "width", "height"] }, { kind: "pipe", type: DateFormatPipe, name: "dateFormat" }], animations: [fadeInAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
30716
30716
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EntityMetadataComponent, decorators: [{
|
|
30717
30717
|
type: Component,
|
|
30718
|
-
args: [{ selector: 'app-entity-metadata', animations: [fadeInAnimation], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"value && value.id\">\n <ion-card @fadeInAnimation>\n\n <!-- recorder -->\n <ion-item color=\"light\"\n *ngIf=\"showRecorder && value &&
|
|
30718
|
+
args: [{ selector: 'app-entity-metadata', animations: [fadeInAnimation], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"value && value.id\">\n <ion-card @fadeInAnimation>\n\n <!-- recorder -->\n <ion-item color=\"light\"\n *ngIf=\"showRecorder && value && (value.recorderDepartment || value.recorderPerson)\">\n\n <!-- recorder avatar -->\n <ion-avatar slot=\"start\" *ngIf=\"value.recorderPerson; let recorderPerson\">\n <img *ngIf=\"recorderPerson.avatar; else generateAvatar\"\n src=\"{{ recorderPerson.avatar }}\">\n <ng-template #generateAvatar>\n <svg *ngIf=\"recorderPerson.id; let personId\"\n width=\"38\" height=\"38\" [data-jdenticon-value]=\"personId\"></svg>\n </ng-template>\n </ion-avatar>\n\n <!-- recorder name -->\n <ion-label>\n <ion-card-subtitle translate>COMMON.RECORDER</ion-card-subtitle>\n <ion-card-title>{{value.recorderPerson?.firstName}} {{value.recorderPerson?.lastName}}</ion-card-title>\n <ion-card-subtitle>{{value.recorderDepartment?.label}}</ion-card-subtitle>\n </ion-label>\n\n <ng-content select=\"[recorderSuffix]\"></ng-content>\n </ion-item>\n\n <ion-card-content>\n <ion-label class=\"ion-text-wrap status\">\n <!-- creation date -->\n <ion-text *ngIf=\"value.creationDate\">\n <ion-icon name=\"calendar\"></ion-icon> \n <span translate>COMMON.CREATED_ON</span>\n <span> <b>{{ value.creationDate | dateFormat: {time: true} }}</b></span>\n </ion-text>\n\n <!-- update date -->\n <ion-text *ngIf=\"value.updateDate && value.updateDate != value.creationDate\">\n <br *ngIf=\"value.creationDate\"/>\n <ion-label>\n <ion-icon name=\"time-outline\"></ion-icon> \n <span translate>COMMON.UPDATED_ON</span>\n <span> {{ value.updateDate | dateFormat: {time: true, seconds: true} }}</span>\n </ion-label>\n </ion-text>\n\n </ion-label>\n\n <ng-content></ng-content>\n\n </ion-card-content>\n </ion-card>\n</ng-container>\n", styles: ["ion-card ion-avatar{height:40px;width:40px}ion-card ion-avatar img,ion-card ion-avatar svg{border:solid 1px rgba(0,0,0,.2)}ion-card ion-avatar img{background-color:var(--ion-color-secondary)!important}ion-card ion-avatar svg{border-radius:20px;height:38px;width:38px}ion-card ion-card-content{background-color:var(--ion-color-light-tint)}ion-card ion-card-content ion-label.status,ion-card ion-card-content * ion-label.status{font-size:12px!important;color:var(--ion-color-step-850)}\n"] }]
|
|
30719
30719
|
}], propDecorators: { value: [{
|
|
30720
30720
|
type: Input
|
|
30721
30721
|
}], showRecorder: [{
|
|
@@ -36679,10 +36679,10 @@ class MessageForm extends AppForm {
|
|
|
36679
36679
|
}
|
|
36680
36680
|
}
|
|
36681
36681
|
MessageForm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageForm, deps: [{ token: i0.Injector }, { token: i1$2.UntypedFormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
36682
|
-
MessageForm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MessageForm, selector: "app-message-form", inputs: { suggestFn: "suggestFn", subjectMinLength: "subjectMinLength", subjectMaxLength: "subjectMaxLength", bodyMaxLength: "bodyMaxLength", bodyAutoHeight: "bodyAutoHeight", canSelectType: "canSelectType" }, usesInheritance: true, ngImport: i0, template: "\n\n<form [formGroup]=\"form\" class=\"form-container\">\n\n <!-- type -->\n <mat-form-field *ngIf=\"canSelectType\">\n <mat-select formControlName=\"type\" [placeholder]=\"'SOCIAL.MESSAGE.TYPE'|translate\">\n <mat-option *ngFor=\"let item of types\" [value]=\"item.id\">\n <ion-icon [name]=\"item.icon\"></ion-icon>\n {{ item.label |translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <!-- Recipients -->\n <mat-chips-field *ngIf=\"(form.controls.type.valueChanges|async) !== 'FEED'\"\n formControlName=\"recipients\"\n [placeholder]=\"'SOCIAL.MESSAGE.RECIPIENTS'|translate\"\n [config]=\"autocompleteFields.recipients\"\n [equals]=\"isSamePerson\">\n </mat-chips-field>\n\n <!-- Subject -->\n <mat-form-field>\n <input matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.SUBJECT'|translate\"\n formControlName=\"subject\"\n autocomplete=\"off\"\n required>\n <mat-error *ngIf=\"form.controls.subject.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('minlength')\">\n {{ 'ERROR.FIELD_MIN_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-hint *ngIf=\"subjectMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.subject.value?.length || 0, max: subjectMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n <!-- Body -->\n <mat-form-field floatLabel=\"never\">\n <textarea matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.BODY_HELP'|translate\"\n formControlName=\"body\"\n [class.fixed-height]=\"!bodyAutoHeight\"\n [cdkTextareaAutosize]=\"bodyAutoHeight\"\n (keydown.control.enter)=\"doSubmit($event)\"\n >\n </textarea>\n <mat-error *ngIf=\"form.controls.body.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: form.controls.body.errors.maxlength }}\n </mat-error>\n <mat-hint *ngIf=\"bodyMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.body.value?.length || 0, max: bodyMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n</form>\n", styles: ["textarea.fixed-height{height:11.5em}textarea{min-height:11.5em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i6$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i12.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: MatChipsField, selector: "mat-chips-field", inputs: ["equals", "logPrefix", "formControl", "formControlName", "floatLabel", "appearance", "placeholder", "suggestFn", "required", "mobile", "readonly", "clearable", "debounceTime", "displayWith", "displayAttributes", "displayColumnSizes", "displayColumnNames", "highlightAccent", "showAllOnFocus", "showPanelOnFocus", "autofocus", "config", "i18nPrefix", "noResultMessage", "class", "panelWidth", "matAutocompletePosition", "itemSize", "fetchMoreThreshold", "suggestLengthThreshold", "showLoadingSpinner", "chipColor", "debug", "filter", "tabindex", "items"], outputs: ["click", "blur", "focus", "dropButtonClick", "keydown.escape", "keyup.enter"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
36682
|
+
MessageForm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MessageForm, selector: "app-message-form", inputs: { suggestFn: "suggestFn", subjectMinLength: "subjectMinLength", subjectMaxLength: "subjectMaxLength", bodyMaxLength: "bodyMaxLength", bodyAutoHeight: "bodyAutoHeight", canSelectType: "canSelectType" }, usesInheritance: true, ngImport: i0, template: "\n\n<form [formGroup]=\"form\" class=\"form-container\">\n\n <!-- type -->\n <mat-form-field *ngIf=\"canSelectType\">\n <mat-select formControlName=\"type\" [placeholder]=\"'SOCIAL.MESSAGE.TYPE'|translate\">\n <mat-option *ngFor=\"let item of types\" [value]=\"item.id\">\n <ion-icon [name]=\"item.icon\"></ion-icon>\n {{ item.label |translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <!-- Recipients -->\n <mat-chips-field *ngIf=\"(form.controls.type.valueChanges|async) !== 'FEED'\"\n formControlName=\"recipients\"\n chipColor=\"accent\"\n [placeholder]=\"'SOCIAL.MESSAGE.RECIPIENTS'|translate\"\n [config]=\"autocompleteFields.recipients\"\n [equals]=\"isSamePerson\">\n </mat-chips-field>\n\n <!-- Subject -->\n <mat-form-field>\n <input matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.SUBJECT'|translate\"\n formControlName=\"subject\"\n autocomplete=\"off\"\n required>\n <mat-error *ngIf=\"form.controls.subject.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('minlength')\">\n {{ 'ERROR.FIELD_MIN_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-hint *ngIf=\"subjectMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.subject.value?.length || 0, max: subjectMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n <!-- Body -->\n <mat-form-field floatLabel=\"never\">\n <textarea matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.BODY_HELP'|translate\"\n formControlName=\"body\"\n [class.fixed-height]=\"!bodyAutoHeight\"\n [cdkTextareaAutosize]=\"bodyAutoHeight\"\n (keydown.control.enter)=\"doSubmit($event)\"\n >\n </textarea>\n <mat-error *ngIf=\"form.controls.body.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: form.controls.body.errors.maxlength }}\n </mat-error>\n <mat-hint *ngIf=\"bodyMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.body.value?.length || 0, max: bodyMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n</form>\n", styles: ["textarea.fixed-height{height:11.5em}textarea{min-height:11.5em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i6$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6$1.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i12.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i2$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: MatChipsField, selector: "mat-chips-field", inputs: ["equals", "logPrefix", "formControl", "formControlName", "floatLabel", "appearance", "placeholder", "suggestFn", "required", "mobile", "readonly", "clearable", "debounceTime", "displayWith", "displayAttributes", "displayColumnSizes", "displayColumnNames", "highlightAccent", "showAllOnFocus", "showPanelOnFocus", "autofocus", "config", "i18nPrefix", "noResultMessage", "class", "panelWidth", "matAutocompletePosition", "itemSize", "fetchMoreThreshold", "suggestLengthThreshold", "showLoadingSpinner", "chipColor", "debug", "filter", "tabindex", "items"], outputs: ["click", "blur", "focus", "dropButtonClick", "keydown.escape", "keyup.enter"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
36683
36683
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageForm, decorators: [{
|
|
36684
36684
|
type: Component,
|
|
36685
|
-
args: [{ selector: 'app-message-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<form [formGroup]=\"form\" class=\"form-container\">\n\n <!-- type -->\n <mat-form-field *ngIf=\"canSelectType\">\n <mat-select formControlName=\"type\" [placeholder]=\"'SOCIAL.MESSAGE.TYPE'|translate\">\n <mat-option *ngFor=\"let item of types\" [value]=\"item.id\">\n <ion-icon [name]=\"item.icon\"></ion-icon>\n {{ item.label |translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <!-- Recipients -->\n <mat-chips-field *ngIf=\"(form.controls.type.valueChanges|async) !== 'FEED'\"\n formControlName=\"recipients\"\n [placeholder]=\"'SOCIAL.MESSAGE.RECIPIENTS'|translate\"\n [config]=\"autocompleteFields.recipients\"\n [equals]=\"isSamePerson\">\n </mat-chips-field>\n\n <!-- Subject -->\n <mat-form-field>\n <input matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.SUBJECT'|translate\"\n formControlName=\"subject\"\n autocomplete=\"off\"\n required>\n <mat-error *ngIf=\"form.controls.subject.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('minlength')\">\n {{ 'ERROR.FIELD_MIN_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-hint *ngIf=\"subjectMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.subject.value?.length || 0, max: subjectMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n <!-- Body -->\n <mat-form-field floatLabel=\"never\">\n <textarea matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.BODY_HELP'|translate\"\n formControlName=\"body\"\n [class.fixed-height]=\"!bodyAutoHeight\"\n [cdkTextareaAutosize]=\"bodyAutoHeight\"\n (keydown.control.enter)=\"doSubmit($event)\"\n >\n </textarea>\n <mat-error *ngIf=\"form.controls.body.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: form.controls.body.errors.maxlength }}\n </mat-error>\n <mat-hint *ngIf=\"bodyMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.body.value?.length || 0, max: bodyMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n</form>\n", styles: ["textarea.fixed-height{height:11.5em}textarea{min-height:11.5em}\n"] }]
|
|
36685
|
+
args: [{ selector: 'app-message-form', changeDetection: ChangeDetectionStrategy.OnPush, template: "\n\n<form [formGroup]=\"form\" class=\"form-container\">\n\n <!-- type -->\n <mat-form-field *ngIf=\"canSelectType\">\n <mat-select formControlName=\"type\" [placeholder]=\"'SOCIAL.MESSAGE.TYPE'|translate\">\n <mat-option *ngFor=\"let item of types\" [value]=\"item.id\">\n <ion-icon [name]=\"item.icon\"></ion-icon>\n {{ item.label |translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <!-- Recipients -->\n <mat-chips-field *ngIf=\"(form.controls.type.valueChanges|async) !== 'FEED'\"\n formControlName=\"recipients\"\n chipColor=\"accent\"\n [placeholder]=\"'SOCIAL.MESSAGE.RECIPIENTS'|translate\"\n [config]=\"autocompleteFields.recipients\"\n [equals]=\"isSamePerson\">\n </mat-chips-field>\n\n <!-- Subject -->\n <mat-form-field>\n <input matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.SUBJECT'|translate\"\n formControlName=\"subject\"\n autocomplete=\"off\"\n required>\n <mat-error *ngIf=\"form.controls.subject.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('minlength')\">\n {{ 'ERROR.FIELD_MIN_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-error *ngIf=\"form.controls.subject.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH_COMPACT'|translate }}\n </mat-error>\n <mat-hint *ngIf=\"subjectMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.subject.value?.length || 0, max: subjectMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n <!-- Body -->\n <mat-form-field floatLabel=\"never\">\n <textarea matInput type=\"text\"\n [placeholder]=\"'SOCIAL.MESSAGE.BODY_HELP'|translate\"\n formControlName=\"body\"\n [class.fixed-height]=\"!bodyAutoHeight\"\n [cdkTextareaAutosize]=\"bodyAutoHeight\"\n (keydown.control.enter)=\"doSubmit($event)\"\n >\n </textarea>\n <mat-error *ngIf=\"form.controls.body.hasError('maxlength')\">\n {{ 'ERROR.FIELD_MAX_LENGTH' | translate: form.controls.body.errors.maxlength }}\n </mat-error>\n <mat-hint *ngIf=\"bodyMaxLength\" align=\"end\">\n {{ 'INFO.TEXT_PROGRESS' | translate: { current: form.controls.body.value?.length || 0, max: bodyMaxLength } }}\n </mat-hint>\n </mat-form-field>\n\n</form>\n", styles: ["textarea.fixed-height{height:11.5em}textarea{min-height:11.5em}\n"] }]
|
|
36686
36686
|
}], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$2.UntypedFormBuilder }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { suggestFn: [{
|
|
36687
36687
|
type: Input
|
|
36688
36688
|
}], subjectMinLength: [{
|
|
@@ -37223,15 +37223,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
37223
37223
|
}] });
|
|
37224
37224
|
|
|
37225
37225
|
const Mutations = {
|
|
37226
|
-
send: gql `
|
|
37227
|
-
|
|
37228
|
-
|
|
37226
|
+
send: gql `
|
|
37227
|
+
mutation SendMessage($data: MessageVOInput) {
|
|
37228
|
+
done: sendMessage(message: $data)
|
|
37229
|
+
}
|
|
37230
|
+
`,
|
|
37229
37231
|
};
|
|
37230
37232
|
class MessageService extends BaseGraphqlService {
|
|
37231
|
-
constructor(graphql, translate, toastController, environment) {
|
|
37233
|
+
constructor(graphql, translate, modalCtrl, toastController, environment) {
|
|
37232
37234
|
super(graphql, environment);
|
|
37233
37235
|
this.graphql = graphql;
|
|
37234
37236
|
this.translate = translate;
|
|
37237
|
+
this.modalCtrl = modalCtrl;
|
|
37235
37238
|
this.toastController = toastController;
|
|
37236
37239
|
this.environment = environment;
|
|
37237
37240
|
// For DEV only
|
|
@@ -37249,7 +37252,7 @@ class MessageService extends BaseGraphqlService {
|
|
|
37249
37252
|
const data = entity.asObject(MINIFY_ENTITY_FOR_POD);
|
|
37250
37253
|
const now = Date.now();
|
|
37251
37254
|
if (this._debug)
|
|
37252
|
-
console.debug(`[message-service]
|
|
37255
|
+
console.debug(`[message-service] Sending message...`);
|
|
37253
37256
|
try {
|
|
37254
37257
|
const { done } = yield this.graphql.mutate({
|
|
37255
37258
|
mutation: Mutations.send,
|
|
@@ -37275,6 +37278,24 @@ class MessageService extends BaseGraphqlService {
|
|
|
37275
37278
|
}
|
|
37276
37279
|
});
|
|
37277
37280
|
}
|
|
37281
|
+
openComposeModal(options) {
|
|
37282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37283
|
+
const hasTopModal = !!(yield this.modalCtrl.getTop());
|
|
37284
|
+
const modal = yield this.modalCtrl.create({
|
|
37285
|
+
component: MessageModal,
|
|
37286
|
+
componentProps: options,
|
|
37287
|
+
cssClass: hasTopModal && 'stack-modal',
|
|
37288
|
+
});
|
|
37289
|
+
// Open the modal
|
|
37290
|
+
yield modal.present();
|
|
37291
|
+
// On dismiss
|
|
37292
|
+
const { data } = yield modal.onDidDismiss();
|
|
37293
|
+
if (!data || !(data instanceof Message))
|
|
37294
|
+
return; // CANCELLED
|
|
37295
|
+
// Send message
|
|
37296
|
+
yield this.send(data, { showToast: options === null || options === void 0 ? void 0 : options.showToast });
|
|
37297
|
+
});
|
|
37298
|
+
}
|
|
37278
37299
|
/* -- protected methods -- */
|
|
37279
37300
|
showToast(opts) {
|
|
37280
37301
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37282,13 +37303,13 @@ class MessageService extends BaseGraphqlService {
|
|
|
37282
37303
|
});
|
|
37283
37304
|
}
|
|
37284
37305
|
}
|
|
37285
|
-
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: GraphqlService }, { token: i1$1.TranslateService }, { token: i2$1.ToastController }, { token: ENVIRONMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37306
|
+
MessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, deps: [{ token: GraphqlService }, { token: i1$1.TranslateService }, { token: i2$1.ModalController }, { token: i2$1.ToastController }, { token: ENVIRONMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37286
37307
|
MessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, providedIn: 'root' });
|
|
37287
37308
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageService, decorators: [{
|
|
37288
37309
|
type: Injectable,
|
|
37289
37310
|
args: [{ providedIn: 'root' }]
|
|
37290
37311
|
}], ctorParameters: function () {
|
|
37291
|
-
return [{ type: GraphqlService }, { type: i1$1.TranslateService }, { type: i2$1.ToastController }, { type: Environment, decorators: [{
|
|
37312
|
+
return [{ type: GraphqlService }, { type: i1$1.TranslateService }, { type: i2$1.ModalController }, { type: i2$1.ToastController }, { type: Environment, decorators: [{
|
|
37292
37313
|
type: Optional
|
|
37293
37314
|
}, {
|
|
37294
37315
|
type: Inject,
|
|
@@ -37675,7 +37696,7 @@ class UsersPage extends AppTable {
|
|
|
37675
37696
|
}
|
|
37676
37697
|
openComposeMessageModal(event) {
|
|
37677
37698
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37678
|
-
//
|
|
37699
|
+
// Compute recipients
|
|
37679
37700
|
const recipients = (this.selection.selected || [])
|
|
37680
37701
|
.map((row) => row.currentData)
|
|
37681
37702
|
.map(Person.fromObject)
|
|
@@ -37685,25 +37706,12 @@ class UsersPage extends AppTable {
|
|
|
37685
37706
|
target.department = (_a = p.department) === null || _a === void 0 ? void 0 : _a.asObject();
|
|
37686
37707
|
return target;
|
|
37687
37708
|
});
|
|
37688
|
-
|
|
37689
|
-
|
|
37690
|
-
|
|
37691
|
-
|
|
37692
|
-
suggestFn: (value, filter, sortBy, sortDirection) => this.dataService.suggest(value, filter, sortBy, sortDirection),
|
|
37693
|
-
data: {
|
|
37694
|
-
recipients,
|
|
37695
|
-
},
|
|
37709
|
+
return this.messageService.openComposeModal({
|
|
37710
|
+
suggestFn: (value, filter, sortBy, sortDirection) => this.dataService.suggest(value, filter, sortBy, sortDirection),
|
|
37711
|
+
data: {
|
|
37712
|
+
recipients,
|
|
37696
37713
|
},
|
|
37697
|
-
cssClass: hasTopModal && 'stack-modal',
|
|
37698
37714
|
});
|
|
37699
|
-
// Open the modal
|
|
37700
|
-
yield modal.present();
|
|
37701
|
-
// On dismiss
|
|
37702
|
-
const { data } = yield modal.onDidDismiss();
|
|
37703
|
-
if (!data || !(data instanceof Message))
|
|
37704
|
-
return; // CANCELLED
|
|
37705
|
-
console.info('[users] received message to send: ', data);
|
|
37706
|
-
yield this.messageService.send(data);
|
|
37707
37715
|
});
|
|
37708
37716
|
}
|
|
37709
37717
|
/* -- protected methods -- */
|