@posiwise/resource-module 0.0.205 → 0.0.207
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/fesm2022/{posiwise-resource-module-base-top-banner.component-BwujN_up.mjs → posiwise-resource-module-base-top-banner.component-DvZKkqPA.mjs} +4 -4
- package/fesm2022/posiwise-resource-module-base-top-banner.component-DvZKkqPA.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-blogs.module-C_sTQ0w2.mjs → posiwise-resource-module-resource-blogs.module-LKr-SjAo.mjs} +3 -3
- package/fesm2022/{posiwise-resource-module-resource-blogs.module-C_sTQ0w2.mjs.map → posiwise-resource-module-resource-blogs.module-LKr-SjAo.mjs.map} +1 -1
- package/fesm2022/{posiwise-resource-module-resource-cards.module-BSJpkk9V.mjs → posiwise-resource-module-resource-cards.module-DOpH-f0N.mjs} +15 -15
- package/fesm2022/posiwise-resource-module-resource-cards.module-DOpH-f0N.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-case-studies.module-D1hCU5_H.mjs → posiwise-resource-module-resource-case-studies.module-CzB9wtnf.mjs} +4 -4
- package/fesm2022/posiwise-resource-module-resource-case-studies.module-CzB9wtnf.mjs.map +1 -0
- package/fesm2022/posiwise-resource-module-resource-edit-card.component-d9cDJUJf.mjs +632 -0
- package/fesm2022/posiwise-resource-module-resource-edit-card.component-d9cDJUJf.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-events.module-D7yC0Sqt.mjs → posiwise-resource-module-resource-events.module-BO9CcIFp.mjs} +5 -5
- package/fesm2022/posiwise-resource-module-resource-events.module-BO9CcIFp.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-hub.module-alVvQLvR.mjs → posiwise-resource-module-resource-hub.module-B3EZao2L.mjs} +10 -10
- package/fesm2022/posiwise-resource-module-resource-hub.module-B3EZao2L.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-integrations.module-G4XvMMYf.mjs → posiwise-resource-module-resource-integrations.module-Djkoz9EF.mjs} +16 -13
- package/fesm2022/posiwise-resource-module-resource-integrations.module-Djkoz9EF.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-jobs.module-DOdaBrZi.mjs → posiwise-resource-module-resource-jobs.module-Dw-7KbET.mjs} +4 -4
- package/fesm2022/{posiwise-resource-module-resource-jobs.module-DOdaBrZi.mjs.map → posiwise-resource-module-resource-jobs.module-Dw-7KbET.mjs.map} +1 -1
- package/fesm2022/{posiwise-resource-module-resource-post.module-CGxj27dN.mjs → posiwise-resource-module-resource-post.module-C343zv-t.mjs} +13 -13
- package/fesm2022/posiwise-resource-module-resource-post.module-C343zv-t.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-release-notes.module-CLry1QNC.mjs → posiwise-resource-module-resource-release-notes.module-CE21Yiss.mjs} +9 -6
- package/fesm2022/{posiwise-resource-module-resource-release-notes.module-CLry1QNC.mjs.map → posiwise-resource-module-resource-release-notes.module-CE21Yiss.mjs.map} +1 -1
- package/fesm2022/{posiwise-resource-module-resource-root.module-x4TYntdq.mjs → posiwise-resource-module-resource-root.module-BzvAo30C.mjs} +12 -9
- package/fesm2022/posiwise-resource-module-resource-root.module-BzvAo30C.mjs.map +1 -0
- package/fesm2022/{posiwise-resource-module-resource-videos.module-2ugtK7wA.mjs → posiwise-resource-module-resource-videos.module-OJpXslFg.mjs} +3 -3
- package/fesm2022/{posiwise-resource-module-resource-videos.module-2ugtK7wA.mjs.map → posiwise-resource-module-resource-videos.module-OJpXslFg.mjs.map} +1 -1
- package/fesm2022/{posiwise-resource-module-resource-white-papers.module-pn6rtDc3.mjs → posiwise-resource-module-resource-white-papers.module-rr8wWULi.mjs} +3 -3
- package/fesm2022/{posiwise-resource-module-resource-white-papers.module-pn6rtDc3.mjs.map → posiwise-resource-module-resource-white-papers.module-rr8wWULi.mjs.map} +1 -1
- package/fesm2022/{posiwise-resource-module-resource.service-DAXsq-WG.mjs → posiwise-resource-module-resource.service-BBvcVvWN.mjs} +10 -10
- package/fesm2022/posiwise-resource-module-resource.service-BBvcVvWN.mjs.map +1 -0
- package/fesm2022/posiwise-resource-module.mjs +24 -734
- package/fesm2022/posiwise-resource-module.mjs.map +1 -1
- package/package.json +1 -1
- package/types/posiwise-resource-module.d.ts +25 -144
- package/fesm2022/posiwise-resource-module-base-top-banner.component-BwujN_up.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-cards.module-BSJpkk9V.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-case-studies.module-D1hCU5_H.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-events.module-D7yC0Sqt.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-hub.module-alVvQLvR.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-integrations.module-G4XvMMYf.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-post.module-CGxj27dN.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource-root.module-x4TYntdq.mjs.map +0 -1
- package/fesm2022/posiwise-resource-module-resource.service-DAXsq-WG.mjs.map +0 -1
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { t as ResourceService } from "./posiwise-resource-module-resource.service-BBvcVvWN.mjs";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, inject } from "@angular/core";
|
|
4
|
+
import { AuthService, TagService } from "@posiwise/common-services";
|
|
5
|
+
import { HelperService } from "@posiwise/helper-service";
|
|
6
|
+
import { NgClass } from "@angular/common";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
import { FormBuilder, FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
9
|
+
import { ButtonBusyDirective, LazyImgDirective } from "@posiwise/directives";
|
|
10
|
+
import { InputContainerComponent } from "@posiwise/shared-components";
|
|
11
|
+
import { TranslocoPipe } from "@jsverse/transloco";
|
|
12
|
+
import { AppBaseComponent } from "@posiwise/app-base-component";
|
|
13
|
+
import { Bind } from "primeng/bind";
|
|
14
|
+
import { ProfileImageCropperComponent } from "@posiwise/utils";
|
|
15
|
+
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
|
16
|
+
import { QuillHelper, editorImageUpload } from "@posiwise/utils/quill";
|
|
17
|
+
import { QuillEditorComponent } from "ngx-quill";
|
|
18
|
+
import * as i2 from "ngx-ui-switch";
|
|
19
|
+
import { UiSwitchModule } from "ngx-ui-switch";
|
|
20
|
+
import { AutoComplete } from "primeng/autocomplete";
|
|
21
|
+
import { DatePicker } from "primeng/datepicker";
|
|
22
|
+
import moment from "moment";
|
|
23
|
+
var ResourceEditCardImages = class ResourceEditCardImages extends AppBaseComponent {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.modalService = inject(NgbModal);
|
|
27
|
+
this.image = "";
|
|
28
|
+
this.rectangularImage = "";
|
|
29
|
+
this.file = null;
|
|
30
|
+
this.rectangularFile = null;
|
|
31
|
+
}
|
|
32
|
+
openImageModal(modalTemplate) {
|
|
33
|
+
this.imageModalRef = this.modalService.open(modalTemplate, {
|
|
34
|
+
centered: true,
|
|
35
|
+
size: "md"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
openRectModal(content) {
|
|
39
|
+
this.imageModalRef = this.modalService.open(content, {
|
|
40
|
+
centered: true,
|
|
41
|
+
windowClass: "modal-holder"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
onImageSelected(base64) {
|
|
45
|
+
this.image = base64;
|
|
46
|
+
this.file = HelperService.convertBase64ToFile(base64);
|
|
47
|
+
this.imageModalRef?.close();
|
|
48
|
+
}
|
|
49
|
+
onRectangularImageSelection(base64) {
|
|
50
|
+
this.rectangularImage = base64;
|
|
51
|
+
this.rectangularFile = HelperService.convertBase64ToFile(base64);
|
|
52
|
+
this.imageModalRef?.close();
|
|
53
|
+
}
|
|
54
|
+
removeImage() {
|
|
55
|
+
this.image = null;
|
|
56
|
+
this.file = null;
|
|
57
|
+
}
|
|
58
|
+
deleteRectangularImage() {
|
|
59
|
+
this.rectangularImage = null;
|
|
60
|
+
this.rectangularFile = null;
|
|
61
|
+
}
|
|
62
|
+
handleImageError(event, fallbackPath) {
|
|
63
|
+
HelperService.handleImageFallbackPath(event, fallbackPath);
|
|
64
|
+
}
|
|
65
|
+
static {
|
|
66
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
67
|
+
minVersion: "12.0.0",
|
|
68
|
+
version: "22.2.3",
|
|
69
|
+
ngImport: i0,
|
|
70
|
+
type: ResourceEditCardImages,
|
|
71
|
+
deps: null,
|
|
72
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static {
|
|
76
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
77
|
+
minVersion: "14.0.0",
|
|
78
|
+
version: "22.2.3",
|
|
79
|
+
type: ResourceEditCardImages,
|
|
80
|
+
isStandalone: true,
|
|
81
|
+
selector: "ng-component",
|
|
82
|
+
usesInheritance: true,
|
|
83
|
+
ngImport: i0,
|
|
84
|
+
template: "",
|
|
85
|
+
isInline: true
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
90
|
+
minVersion: "12.0.0",
|
|
91
|
+
version: "22.2.3",
|
|
92
|
+
ngImport: i0,
|
|
93
|
+
type: ResourceEditCardImages,
|
|
94
|
+
decorators: [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{ template: "" }]
|
|
97
|
+
}]
|
|
98
|
+
});
|
|
99
|
+
function resourceEditForm(fb) {
|
|
100
|
+
return fb.group({
|
|
101
|
+
title: [""],
|
|
102
|
+
external_url: [""],
|
|
103
|
+
cta_text: [""],
|
|
104
|
+
when: [""],
|
|
105
|
+
showcase: [false],
|
|
106
|
+
published_at: [false],
|
|
107
|
+
accepted_at: [false],
|
|
108
|
+
body: [""]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function resourceFormValue(resource) {
|
|
112
|
+
return {
|
|
113
|
+
title: resource.title ?? "",
|
|
114
|
+
external_url: resource.external_url ?? "",
|
|
115
|
+
cta_text: resource.cta_text ?? "",
|
|
116
|
+
when: resource.when ? new Date(resource.when) : "",
|
|
117
|
+
showcase: !!resource.showcase,
|
|
118
|
+
published_at: !!resource.published_at,
|
|
119
|
+
accepted_at: !!resource.accepted_at,
|
|
120
|
+
body: resource.body
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function buildResourcePayload(form, subscriptionId, images) {
|
|
124
|
+
const data = {
|
|
125
|
+
...form.value,
|
|
126
|
+
subscription_id: subscriptionId
|
|
127
|
+
};
|
|
128
|
+
setFile(data, "picture", images.file);
|
|
129
|
+
setFile(data, "rectangular_picture", images.rectangularFile);
|
|
130
|
+
setToggledDate(form, data, "published_at");
|
|
131
|
+
setToggledDate(form, data, "accepted_at");
|
|
132
|
+
if (!form.get("when")?.value) data.when = "";
|
|
133
|
+
if (!form.get("showcase")?.value) data.showcase = "";
|
|
134
|
+
if (!images.file && !images.image) data.remove_picture = true;
|
|
135
|
+
if (!images.rectangularFile && !images.rectangularImage) data.remove_rectangular_picture = true;
|
|
136
|
+
return data;
|
|
137
|
+
}
|
|
138
|
+
function setFile(data, key, file) {
|
|
139
|
+
if (file) data[key] = file;
|
|
140
|
+
else delete data[key];
|
|
141
|
+
}
|
|
142
|
+
function setToggledDate(form, data, key) {
|
|
143
|
+
const control = form.get(key);
|
|
144
|
+
if (control?.dirty) data[key] = control.value ? moment().format("DD-MMM-YYYY") : "";
|
|
145
|
+
else delete data[key];
|
|
146
|
+
}
|
|
147
|
+
function filterTags(tags, query) {
|
|
148
|
+
if (!query) return [...tags];
|
|
149
|
+
const needle = query.toLowerCase();
|
|
150
|
+
return tags.filter((tag) => tag.name.toLowerCase().includes(needle));
|
|
151
|
+
}
|
|
152
|
+
function postTagsPayload(tags, postId) {
|
|
153
|
+
return {
|
|
154
|
+
entity_tags: tags.map((tag) => ({ tag_id: tag.id })),
|
|
155
|
+
slug: postId,
|
|
156
|
+
tag_entity: "Post"
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
var ResourceEditCardComponent = class ResourceEditCardComponent extends ResourceEditCardImages {
|
|
160
|
+
constructor() {
|
|
161
|
+
super();
|
|
162
|
+
this.fb = inject(FormBuilder);
|
|
163
|
+
this.resourceService = inject(ResourceService);
|
|
164
|
+
this.authService = inject(AuthService);
|
|
165
|
+
this.tagService = inject(TagService);
|
|
166
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
167
|
+
this.updated = new EventEmitter();
|
|
168
|
+
this.selectedTags = [];
|
|
169
|
+
this.allTags = [];
|
|
170
|
+
this.tagsSuggestion = [];
|
|
171
|
+
this.buttonBusy = false;
|
|
172
|
+
this.editorConfig = QuillHelper.getEditorConfig([], editorImageUpload(() => this.subscriptionId));
|
|
173
|
+
QuillHelper.init();
|
|
174
|
+
this.editForm = resourceEditForm(this.fb);
|
|
175
|
+
}
|
|
176
|
+
ngOnInit() {
|
|
177
|
+
this.authService.getToken$().subscribe((res) => {
|
|
178
|
+
this.userLoggedIn = !!res;
|
|
179
|
+
if (this.userLoggedIn) this.localStorage.getItem$("product").subscribe((res) => {
|
|
180
|
+
const data = res ? JSON.parse(res) : null;
|
|
181
|
+
this.subscriptionId = data?.subscriptionId;
|
|
182
|
+
this.cdr.markForCheck();
|
|
183
|
+
});
|
|
184
|
+
this.cdr.markForCheck();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
navigateToResourceEdit() {
|
|
188
|
+
const basePath = `/admin/resources/${this.resourceData?.slug}`;
|
|
189
|
+
const fullUrl = `${location.origin}${basePath}`;
|
|
190
|
+
window.open(fullUrl, "_blank");
|
|
191
|
+
}
|
|
192
|
+
openModal(modalTemplate) {
|
|
193
|
+
if (this.resourceData) {
|
|
194
|
+
this.editForm.setValue(resourceFormValue(this.resourceData));
|
|
195
|
+
this.image = this.resourceData.picture?.url ?? "";
|
|
196
|
+
this.selectedTags = this.resourceData?.tags?.length ? [...this.resourceData.tags] : [];
|
|
197
|
+
this.rectangularImage = this.resourceData.rectangular_picture?.url ?? "";
|
|
198
|
+
}
|
|
199
|
+
this.modalService.open(modalTemplate, {
|
|
200
|
+
centered: true,
|
|
201
|
+
size: "lg"
|
|
202
|
+
});
|
|
203
|
+
this.getPostTags();
|
|
204
|
+
}
|
|
205
|
+
search(event) {
|
|
206
|
+
this.tagsSuggestion = filterTags(this.allTags, event.query);
|
|
207
|
+
}
|
|
208
|
+
getPostTags() {
|
|
209
|
+
this.tagService.getTagsByType("post_categories", {}, this.subscriptionId).subscribe((response) => {
|
|
210
|
+
this.allTags = response.result;
|
|
211
|
+
this.cdr.markForCheck();
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
saveResource() {
|
|
215
|
+
this.buttonBusy = true;
|
|
216
|
+
this.saveTags(this.id);
|
|
217
|
+
const payload = buildResourcePayload(this.editForm, this.subscriptionId, this);
|
|
218
|
+
this.resourceService.updatePost(payload, this.id).subscribe({
|
|
219
|
+
next: () => this.settleSave(() => {
|
|
220
|
+
this.toast.success("Blog Post Updated");
|
|
221
|
+
this.updated.emit();
|
|
222
|
+
this.modalService.dismissAll();
|
|
223
|
+
}),
|
|
224
|
+
error: () => this.settleSave()
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
settleSave(afterSuccess) {
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
this.buttonBusy = false;
|
|
230
|
+
this.cdr.markForCheck();
|
|
231
|
+
if (afterSuccess) setTimeout(() => {
|
|
232
|
+
afterSuccess();
|
|
233
|
+
this.cdr.markForCheck();
|
|
234
|
+
}, 0);
|
|
235
|
+
}, 0);
|
|
236
|
+
}
|
|
237
|
+
saveTags(id) {
|
|
238
|
+
if (this.selectedTags.length) {
|
|
239
|
+
const data = postTagsPayload(this.selectedTags, id);
|
|
240
|
+
this.tagService.addTags(data, this.subscriptionId).subscribe(() => {
|
|
241
|
+
this.cdr.markForCheck();
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
static {
|
|
246
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
247
|
+
minVersion: "12.0.0",
|
|
248
|
+
version: "22.2.3",
|
|
249
|
+
ngImport: i0,
|
|
250
|
+
type: ResourceEditCardComponent,
|
|
251
|
+
deps: [],
|
|
252
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
static {
|
|
256
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
257
|
+
minVersion: "17.0.0",
|
|
258
|
+
version: "22.2.3",
|
|
259
|
+
type: ResourceEditCardComponent,
|
|
260
|
+
isStandalone: true,
|
|
261
|
+
selector: "pw-resource-edit-card",
|
|
262
|
+
inputs: {
|
|
263
|
+
id: "id",
|
|
264
|
+
resourceData: "resourceData"
|
|
265
|
+
},
|
|
266
|
+
outputs: { updated: "updated" },
|
|
267
|
+
usesInheritance: true,
|
|
268
|
+
ngImport: i0,
|
|
269
|
+
template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center mb-2\"\n (click)=\"openModal(editResourceModal)\"\n (keydown.enter)=\"openModal(editResourceModal)\"\n (keydown.space)=\"openModal(editResourceModal)\"\n title=\"Edit Resource\"></i>\n</div>\n\n<ng-template #editResourceModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Resource</h5>\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center ms-3\"\n (click)=\"navigateToResourceEdit()\"\n (keydown.enter)=\"navigateToResourceEdit()\"\n (keydown.space)=\"navigateToResourceEdit()\"\n title=\"Go to the main edit page\"></i>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"editForm\">\n <div class=\"row\">\n\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"\n aria-label=\"Title\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <pw-input-container label=\"CTA Text\" name=\"cta_text\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"cta_text\" id=\"input_cta_text_2\" name=\"input_cta_text_2\"\n aria-label=\"Cta Text\"/>\n </pw-input-container>\n\n <pw-input-container label=\"External URL\" name=\"external_url\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.ExternalUrl' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"external_url\" id=\"input_external_url_3\" name=\"input_external_url_3\"\n [attr.aria-label]=\"'Resource.Posts.Body' | transloco\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container\n [label]=\"'Resource.Posts.Body' | transloco\"\n name=\"body\"\n errorMsg=\"Resource.Posts.Validation.Body\">\n <quill-editor\n [styles]=\"{ height: '300px' }\"\n class=\"quillEditor\"\n [modules]=\"editorConfig\"\n formControlName=\"body\"\n [ngClass]=\"{\n 'w-100': true,\n 'quill-container': true,\n 'is-invalid': submitted && f['body'].errors\n }\">\n </quill-editor>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-3 col-sm-6\">\n <pw-input-container\n [label]=\"'Resource.Posts.When' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.When' | transloco\"\n name=\"when\">\n <p-datepicker inputId=\"resource-edit-card-when\" formControlName=\"when\"\n [ariaLabel]=\"'Resource.Posts.When' | transloco\"\n [showIcon]=\"true\"\n dateFormat=\"dd-M-yy\"\n [placeholder]=\"'Select Date'\"\n [ngClass]=\"{ 'is-invalid': submitted && f['when'].errors }\">\n </p-datepicker>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-8\">\n <pw-input-container\n [label]=\"'Resource.Posts.Tags' | transloco\"\n class=\"ui-fluid skills-modal tags\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\"\n name=\"cta_text\">\n <p-auto-complete appendTo=\"body\" [(ngModel)]=\"selectedTags\"\n [ariaLabel]=\"'Resource.Posts.Tags' | transloco\"\n class=\"body-bg w-100\"\n [suggestions]=\"tagsSuggestion\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [dropdown]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n placeholder=\"Tags\"\n [multiple]=\"true\">\n </p-auto-complete>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'SHOWCASE'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Mark as showcase post'\"\n name=\"showcase\">\n <ui-switch formControlName=\"showcase\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'PUBLISHED'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Set to publish the post'\"\n name=\"published_at\">\n <ui-switch formControlName=\"published_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'ACCEPTED BY ADMIN'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Indicates approval by admin'\"\n name=\"accepted_at\">\n <ui-switch formControlName=\"accepted_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-cover-picture-label\" class=\"pw-label-style\">{{ 'Resource.Posts.CoverPicture' | transloco }}</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(image && !image.includes('default-photo.jpg')) ? image : 'assets/img/resource/blog.png'\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Modal\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <button type=\"button\" class=\"btn btn-link p-0 d-inline-block\" (click)=\"openImageModal(imageCropContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </button>\n @if (image && !image.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"removeImage()\"\n (keydown.enter)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-rectangular-picture-label\" class=\"pw-label-style\">Rectangular Picture</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(rectangularImage && !rectangularImage.includes('default-photo.jpg')) ? rectangularImage : 'assets/img/resource/blog.png'\"\n (click)=\"openRectModal(rectContent)\"\n (keydown.enter)=\"openRectModal(rectContent)\"\n class=\"image w-100\"\n alt=\"Uploaded rectangular media preview\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <button type=\"button\" class=\"btn btn-link p-0 d-inline-block\" (click)=\"openRectModal(rectContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </button>\n @if (rectangularImage && !rectangularImage.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"deleteRectangularImage()\"\n (keydown.enter)=\"deleteRectangularImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"saveResource()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'Common.Close' | transloco\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"modal.close()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n\n<ng-template #rectContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n #profile\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onRectangularImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n",
|
|
270
|
+
styles: ["::ng-deep .modal-content{margin-top:5rem!important}\n"],
|
|
271
|
+
dependencies: [
|
|
272
|
+
{
|
|
273
|
+
kind: "ngmodule",
|
|
274
|
+
type: FormsModule
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
kind: "directive",
|
|
278
|
+
type: i1.ɵNgNoValidate,
|
|
279
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
kind: "directive",
|
|
283
|
+
type: i1.DefaultValueAccessor,
|
|
284
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
kind: "directive",
|
|
288
|
+
type: i1.NgControlStatus,
|
|
289
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
kind: "directive",
|
|
293
|
+
type: i1.NgControlStatusGroup,
|
|
294
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
kind: "directive",
|
|
298
|
+
type: i1.MaxLengthValidator,
|
|
299
|
+
selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
|
|
300
|
+
inputs: ["maxlength"]
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
kind: "directive",
|
|
304
|
+
type: i1.NgModel,
|
|
305
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
306
|
+
inputs: [
|
|
307
|
+
"name",
|
|
308
|
+
"disabled",
|
|
309
|
+
"ngModel",
|
|
310
|
+
"ngModelOptions"
|
|
311
|
+
],
|
|
312
|
+
outputs: ["ngModelChange"],
|
|
313
|
+
exportAs: ["ngModel"]
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
kind: "ngmodule",
|
|
317
|
+
type: ReactiveFormsModule
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
kind: "directive",
|
|
321
|
+
type: i1.FormGroupDirective,
|
|
322
|
+
selector: "[formGroup]",
|
|
323
|
+
inputs: ["formGroup"],
|
|
324
|
+
outputs: ["ngSubmit"],
|
|
325
|
+
exportAs: ["ngForm"]
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
kind: "directive",
|
|
329
|
+
type: i1.FormControlName,
|
|
330
|
+
selector: "[formControlName]",
|
|
331
|
+
inputs: [
|
|
332
|
+
"formControlName",
|
|
333
|
+
"disabled",
|
|
334
|
+
"ngModel"
|
|
335
|
+
],
|
|
336
|
+
outputs: ["ngModelChange"]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
kind: "component",
|
|
340
|
+
type: InputContainerComponent,
|
|
341
|
+
selector: "pw-input-container",
|
|
342
|
+
inputs: [
|
|
343
|
+
"name",
|
|
344
|
+
"controlId",
|
|
345
|
+
"useAriaLabelledbyOnly",
|
|
346
|
+
"label",
|
|
347
|
+
"labelClass",
|
|
348
|
+
"tooltipPosition",
|
|
349
|
+
"required",
|
|
350
|
+
"errorMsg",
|
|
351
|
+
"isReadOnly",
|
|
352
|
+
"showTooltip",
|
|
353
|
+
"tooltipText",
|
|
354
|
+
"showTriangle",
|
|
355
|
+
"afterLabel",
|
|
356
|
+
"showAfterLabel",
|
|
357
|
+
"showTriangleText",
|
|
358
|
+
"isLeftTooltip"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
kind: "component",
|
|
363
|
+
type: QuillEditorComponent,
|
|
364
|
+
selector: "quill-editor"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
kind: "directive",
|
|
368
|
+
type: NgClass,
|
|
369
|
+
selector: "[ngClass]",
|
|
370
|
+
inputs: ["class", "ngClass"]
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
kind: "component",
|
|
374
|
+
type: DatePicker,
|
|
375
|
+
selector: "p-datepicker, p-date-picker",
|
|
376
|
+
inputs: [
|
|
377
|
+
"iconDisplay",
|
|
378
|
+
"inputStyle",
|
|
379
|
+
"inputId",
|
|
380
|
+
"inputStyleClass",
|
|
381
|
+
"placeholder",
|
|
382
|
+
"ariaLabelledBy",
|
|
383
|
+
"ariaLabel",
|
|
384
|
+
"iconAriaLabel",
|
|
385
|
+
"dateFormat",
|
|
386
|
+
"multipleSeparator",
|
|
387
|
+
"rangeSeparator",
|
|
388
|
+
"inline",
|
|
389
|
+
"showOtherMonths",
|
|
390
|
+
"selectOtherMonths",
|
|
391
|
+
"showIcon",
|
|
392
|
+
"icon",
|
|
393
|
+
"readonlyInput",
|
|
394
|
+
"shortYearCutoff",
|
|
395
|
+
"hourFormat",
|
|
396
|
+
"timeOnly",
|
|
397
|
+
"stepHour",
|
|
398
|
+
"stepMinute",
|
|
399
|
+
"stepSecond",
|
|
400
|
+
"showSeconds",
|
|
401
|
+
"showOnFocus",
|
|
402
|
+
"showWeek",
|
|
403
|
+
"startWeekFromFirstDayOfYear",
|
|
404
|
+
"showClear",
|
|
405
|
+
"dataType",
|
|
406
|
+
"selectionMode",
|
|
407
|
+
"maxDateCount",
|
|
408
|
+
"showButtonBar",
|
|
409
|
+
"todayButtonStyleClass",
|
|
410
|
+
"clearButtonStyleClass",
|
|
411
|
+
"autofocus",
|
|
412
|
+
"autoZIndex",
|
|
413
|
+
"baseZIndex",
|
|
414
|
+
"panelStyleClass",
|
|
415
|
+
"panelStyle",
|
|
416
|
+
"keepInvalid",
|
|
417
|
+
"hideOnDateTimeSelect",
|
|
418
|
+
"touchUI",
|
|
419
|
+
"timeSeparator",
|
|
420
|
+
"focusTrap",
|
|
421
|
+
"tabindex",
|
|
422
|
+
"minDate",
|
|
423
|
+
"maxDate",
|
|
424
|
+
"disabledDates",
|
|
425
|
+
"disabledDays",
|
|
426
|
+
"showTime",
|
|
427
|
+
"responsiveOptions",
|
|
428
|
+
"numberOfMonths",
|
|
429
|
+
"firstDayOfWeek",
|
|
430
|
+
"view",
|
|
431
|
+
"defaultDate",
|
|
432
|
+
"appendTo",
|
|
433
|
+
"motionOptions"
|
|
434
|
+
],
|
|
435
|
+
outputs: [
|
|
436
|
+
"onFocus",
|
|
437
|
+
"onBlur",
|
|
438
|
+
"onClose",
|
|
439
|
+
"onSelect",
|
|
440
|
+
"onClear",
|
|
441
|
+
"onInput",
|
|
442
|
+
"onTodayClick",
|
|
443
|
+
"onClearClick",
|
|
444
|
+
"onMonthChange",
|
|
445
|
+
"onYearChange",
|
|
446
|
+
"onClickOutside",
|
|
447
|
+
"onShow"
|
|
448
|
+
]
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
kind: "component",
|
|
452
|
+
type: AutoComplete,
|
|
453
|
+
selector: "p-autocomplete, p-auto-complete",
|
|
454
|
+
inputs: [
|
|
455
|
+
"minQueryLength",
|
|
456
|
+
"delay",
|
|
457
|
+
"panelStyle",
|
|
458
|
+
"panelStyleClass",
|
|
459
|
+
"inputStyle",
|
|
460
|
+
"inputId",
|
|
461
|
+
"inputStyleClass",
|
|
462
|
+
"placeholder",
|
|
463
|
+
"readonly",
|
|
464
|
+
"scrollHeight",
|
|
465
|
+
"lazy",
|
|
466
|
+
"virtualScroll",
|
|
467
|
+
"virtualScrollItemSize",
|
|
468
|
+
"virtualScrollOptions",
|
|
469
|
+
"autoHighlight",
|
|
470
|
+
"forceSelection",
|
|
471
|
+
"type",
|
|
472
|
+
"autoZIndex",
|
|
473
|
+
"baseZIndex",
|
|
474
|
+
"ariaLabel",
|
|
475
|
+
"dropdownAriaLabel",
|
|
476
|
+
"ariaLabelledBy",
|
|
477
|
+
"dropdownIcon",
|
|
478
|
+
"unique",
|
|
479
|
+
"group",
|
|
480
|
+
"completeOnFocus",
|
|
481
|
+
"showClear",
|
|
482
|
+
"dropdown",
|
|
483
|
+
"showEmptyMessage",
|
|
484
|
+
"dropdownMode",
|
|
485
|
+
"multiple",
|
|
486
|
+
"addOnTab",
|
|
487
|
+
"tabindex",
|
|
488
|
+
"dataKey",
|
|
489
|
+
"emptyMessage",
|
|
490
|
+
"autofocus",
|
|
491
|
+
"autocomplete",
|
|
492
|
+
"optionGroupChildren",
|
|
493
|
+
"optionGroupLabel",
|
|
494
|
+
"overlayOptions",
|
|
495
|
+
"suggestions",
|
|
496
|
+
"optionLabel",
|
|
497
|
+
"optionValue",
|
|
498
|
+
"id",
|
|
499
|
+
"searchMessage",
|
|
500
|
+
"emptySelectionMessage",
|
|
501
|
+
"selectionMessage",
|
|
502
|
+
"autoOptionFocus",
|
|
503
|
+
"selectOnFocus",
|
|
504
|
+
"searchLocale",
|
|
505
|
+
"optionDisabled",
|
|
506
|
+
"focusOnHover",
|
|
507
|
+
"typeahead",
|
|
508
|
+
"addOnBlur",
|
|
509
|
+
"separator",
|
|
510
|
+
"appendTo",
|
|
511
|
+
"motionOptions"
|
|
512
|
+
],
|
|
513
|
+
outputs: [
|
|
514
|
+
"completeMethod",
|
|
515
|
+
"onSelect",
|
|
516
|
+
"onUnselect",
|
|
517
|
+
"onAdd",
|
|
518
|
+
"onFocus",
|
|
519
|
+
"onBlur",
|
|
520
|
+
"onDropdownClick",
|
|
521
|
+
"onClear",
|
|
522
|
+
"onInputKeydown",
|
|
523
|
+
"onKeyUp",
|
|
524
|
+
"onShow",
|
|
525
|
+
"onHide",
|
|
526
|
+
"onLazyLoad"
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
kind: "ngmodule",
|
|
531
|
+
type: UiSwitchModule
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
kind: "component",
|
|
535
|
+
type: i2.UiSwitchComponent,
|
|
536
|
+
selector: "ui-switch",
|
|
537
|
+
inputs: [
|
|
538
|
+
"size",
|
|
539
|
+
"color",
|
|
540
|
+
"switchOffColor",
|
|
541
|
+
"switchColor",
|
|
542
|
+
"defaultBgColor",
|
|
543
|
+
"defaultBoColor",
|
|
544
|
+
"checkedLabel",
|
|
545
|
+
"uncheckedLabel",
|
|
546
|
+
"checkedTextColor",
|
|
547
|
+
"uncheckedTextColor",
|
|
548
|
+
"beforeChange",
|
|
549
|
+
"ariaLabel",
|
|
550
|
+
"checked",
|
|
551
|
+
"disabled",
|
|
552
|
+
"reverse",
|
|
553
|
+
"loading"
|
|
554
|
+
],
|
|
555
|
+
outputs: [
|
|
556
|
+
"change",
|
|
557
|
+
"changeEvent",
|
|
558
|
+
"valueChange"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
kind: "directive",
|
|
563
|
+
type: LazyImgDirective,
|
|
564
|
+
selector: "img"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
kind: "directive",
|
|
568
|
+
type: ButtonBusyDirective,
|
|
569
|
+
selector: "[buttonBusy]",
|
|
570
|
+
inputs: ["buttonBusy", "busyText"]
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
kind: "component",
|
|
574
|
+
type: ProfileImageCropperComponent,
|
|
575
|
+
selector: "pw-image-cropper",
|
|
576
|
+
inputs: ["aspectRatio", "dynamicData"],
|
|
577
|
+
outputs: [
|
|
578
|
+
"imageSelectionEvent",
|
|
579
|
+
"closeEvent",
|
|
580
|
+
"fileChangeEvent"
|
|
581
|
+
]
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
kind: "pipe",
|
|
585
|
+
type: TranslocoPipe,
|
|
586
|
+
name: "transloco"
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
594
|
+
minVersion: "12.0.0",
|
|
595
|
+
version: "22.2.3",
|
|
596
|
+
ngImport: i0,
|
|
597
|
+
type: ResourceEditCardComponent,
|
|
598
|
+
decorators: [{
|
|
599
|
+
type: Component,
|
|
600
|
+
args: [{
|
|
601
|
+
selector: "pw-resource-edit-card",
|
|
602
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
603
|
+
imports: [
|
|
604
|
+
FormsModule,
|
|
605
|
+
ReactiveFormsModule,
|
|
606
|
+
InputContainerComponent,
|
|
607
|
+
QuillEditorComponent,
|
|
608
|
+
NgClass,
|
|
609
|
+
Bind,
|
|
610
|
+
DatePicker,
|
|
611
|
+
AutoComplete,
|
|
612
|
+
UiSwitchModule,
|
|
613
|
+
LazyImgDirective,
|
|
614
|
+
ButtonBusyDirective,
|
|
615
|
+
ProfileImageCropperComponent,
|
|
616
|
+
TranslocoPipe
|
|
617
|
+
],
|
|
618
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
619
|
+
template: "<div class=\"edit-card\">\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center mb-2\"\n (click)=\"openModal(editResourceModal)\"\n (keydown.enter)=\"openModal(editResourceModal)\"\n (keydown.space)=\"openModal(editResourceModal)\"\n title=\"Edit Resource\"></i>\n</div>\n\n<ng-template #editResourceModal let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Resource</h5>\n <i class=\"fa fa-edit cursor-pointer text-dark in-page-edit-icon d-flex justify-content-center ms-3\"\n (click)=\"navigateToResourceEdit()\"\n (keydown.enter)=\"navigateToResourceEdit()\"\n (keydown.space)=\"navigateToResourceEdit()\"\n title=\"Go to the main edit page\"></i>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <form [formGroup]=\"editForm\">\n <div class=\"row\">\n\n\n <div class=\"col-12\">\n <pw-input-container label=\"Title\" name=\"title\">\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" id=\"input_title_1\" name=\"input_title_1\"\n aria-label=\"Title\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <pw-input-container label=\"CTA Text\" name=\"cta_text\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"cta_text\" id=\"input_cta_text_2\" name=\"input_cta_text_2\"\n aria-label=\"Cta Text\"/>\n </pw-input-container>\n\n <pw-input-container label=\"External URL\" name=\"external_url\" class=\"col-md-6\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.ExternalUrl' | transloco\">\n <input type=\"text\" class=\"form-control\" formControlName=\"external_url\" id=\"input_external_url_3\" name=\"input_external_url_3\"\n [attr.aria-label]=\"'Resource.Posts.Body' | transloco\"/>\n </pw-input-container>\n </div>\n\n <div class=\"col-12\">\n <pw-input-container\n [label]=\"'Resource.Posts.Body' | transloco\"\n name=\"body\"\n errorMsg=\"Resource.Posts.Validation.Body\">\n <quill-editor\n [styles]=\"{ height: '300px' }\"\n class=\"quillEditor\"\n [modules]=\"editorConfig\"\n formControlName=\"body\"\n [ngClass]=\"{\n 'w-100': true,\n 'quill-container': true,\n 'is-invalid': submitted && f['body'].errors\n }\">\n </quill-editor>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-3 col-sm-6\">\n <pw-input-container\n [label]=\"'Resource.Posts.When' | transloco\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.When' | transloco\"\n name=\"when\">\n <p-datepicker inputId=\"resource-edit-card-when\" formControlName=\"when\"\n [ariaLabel]=\"'Resource.Posts.When' | transloco\"\n [showIcon]=\"true\"\n dateFormat=\"dd-M-yy\"\n [placeholder]=\"'Select Date'\"\n [ngClass]=\"{ 'is-invalid': submitted && f['when'].errors }\">\n </p-datepicker>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 col-md-8\">\n <pw-input-container\n [label]=\"'Resource.Posts.Tags' | transloco\"\n class=\"ui-fluid skills-modal tags\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Resource.Posts.Tooltip.CtaText' | transloco\"\n name=\"cta_text\">\n <p-auto-complete appendTo=\"body\" [(ngModel)]=\"selectedTags\"\n [ariaLabel]=\"'Resource.Posts.Tags' | transloco\"\n class=\"body-bg w-100\"\n [suggestions]=\"tagsSuggestion\"\n dataKey=\"id\"\n optionLabel=\"name\"\n (completeMethod)=\"search($event)\"\n [minLength]=\"1\"\n [maxlength]=\"10\"\n [dropdown]=\"true\"\n [ngModelOptions]=\"{ standalone: true }\"\n placeholder=\"Tags\"\n [multiple]=\"true\">\n </p-auto-complete>\n </pw-input-container>\n </div>\n\n <div class=\"col-12 row\">\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'SHOWCASE'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Mark as showcase post'\"\n name=\"showcase\">\n <ui-switch formControlName=\"showcase\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'PUBLISHED'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Set to publish the post'\"\n name=\"published_at\">\n <ui-switch formControlName=\"published_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n\n <div class=\"col-md-4 col-sm-6\">\n <pw-input-container\n [label]=\"'ACCEPTED BY ADMIN'\"\n [showTooltip]=\"true\"\n [tooltipText]=\"'Indicates approval by admin'\"\n name=\"accepted_at\">\n <ui-switch formControlName=\"accepted_at\" class=\"d-block\"></ui-switch>\n </pw-input-container>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-cover-picture-label\" class=\"pw-label-style\">{{ 'Resource.Posts.CoverPicture' | transloco }}</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(image && !image.includes('default-photo.jpg')) ? image : 'assets/img/resource/blog.png'\"\n (click)=\"openImageModal(imageCropContent)\"\n (keydown.enter)=\"openImageModal(imageCropContent)\"\n class=\"image w-100\"\n alt=\"Modal\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <button type=\"button\" class=\"btn btn-link p-0 d-inline-block\" (click)=\"openImageModal(imageCropContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </button>\n @if (image && !image.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"removeImage()\"\n (keydown.enter)=\"removeImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"col-12 col-md-4 col-sm-4 my-4 ms-3\">\n <div class=\"text-center mb-4\">\n <span id=\"resource-edit-rectangular-picture-label\" class=\"pw-label-style\">Rectangular Picture</span>\n <div class=\"text-center d-flex flex-column align-items-center\">\n <img [src]=\"(rectangularImage && !rectangularImage.includes('default-photo.jpg')) ? rectangularImage : 'assets/img/resource/blog.png'\"\n (click)=\"openRectModal(rectContent)\"\n (keydown.enter)=\"openRectModal(rectContent)\"\n class=\"image w-100\"\n alt=\"Uploaded rectangular media preview\"\n (error)=\"handleImageError($event, 'assets/img/resource/blog.png')\" />\n <div class=\"d-flex justify-content-between align-items-center mt-2\">\n <button type=\"button\" class=\"btn btn-link p-0 d-inline-block\" (click)=\"openRectModal(rectContent)\">\n {{ slug !== 'create' ? 'Edit' : 'Add' }} Picture\n </button>\n @if (rectangularImage && !rectangularImage.includes('default-photo.jpg')) {\n <i\n class=\"fa fa-trash delete-icon text-danger ms-2 cursor-pointer\"\n title=\"Remove Image\"\n (click)=\"deleteRectangularImage()\"\n (keydown.enter)=\"deleteRectangularImage()\"></i>\n }\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </form>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"modal.dismiss()\">Cancel</button>\n <button class=\"btn btn-primary\" [buttonBusy]=\"buttonBusy\" (click)=\"saveResource()\">Save</button>\n </div>\n</ng-template>\n\n<ng-template #imageCropContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close\" [attr.aria-label]=\"'Common.Close' | transloco\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onImageSelected($event)\"\n (closeEvent)=\"modal.close()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n\n<ng-template #rectContent let-modal>\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Upload Picture</h5>\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modal.dismiss()\"></button>\n </div>\n <div class=\"modal-body\">\n <small>You can upload a JPG, GIF, or PNG file. (Do not upload pictures containing celebrities,\n nudity, artwork or copyrighted images.)</small>\n <pw-image-cropper\n #profile\n [aspectRatio]=\"'dynamic'\"\n (imageSelectionEvent)=\"onRectangularImageSelection($event)\"\n (closeEvent)=\"onClose()\">\n </pw-image-cropper>\n </div>\n</ng-template>\n",
|
|
620
|
+
styles: ["::ng-deep .modal-content{margin-top:5rem!important}\n"]
|
|
621
|
+
}]
|
|
622
|
+
}],
|
|
623
|
+
ctorParameters: () => [],
|
|
624
|
+
propDecorators: {
|
|
625
|
+
id: [{ type: Input }],
|
|
626
|
+
resourceData: [{ type: Input }],
|
|
627
|
+
updated: [{ type: Output }]
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
export { ResourceEditCardComponent };
|
|
631
|
+
|
|
632
|
+
//# sourceMappingURL=posiwise-resource-module-resource-edit-card.component-d9cDJUJf.mjs.map
|