typo3-typescript-sources 14.3.6 → 14.3.8
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/.last-synced-tag +1 -1
- package/README-TYPO3.md +1 -1
- package/README.md +1 -1
- package/backend/column-selector-button.ts +5 -2
- package/backend/drag-uploader.ts +78 -86
- package/backend/element/contextual-record-edit-trigger.ts +9 -1
- package/backend/form-engine/element/extra/select-box-filter.ts +8 -5
- package/backend/form-engine/element/online-media-form-element.ts +3 -3
- package/backend/form-engine/element/select-tree.ts +16 -2
- package/backend/form-engine/field-control/add-record.ts +27 -1
- package/backend/form-engine.ts +88 -13
- package/backend/layout-module/column-restriction.ts +61 -0
- package/backend/layout-module/drag-drop.ts +12 -0
- package/backend/layout-module/paste.ts +7 -0
- package/backend/localization/localization-wizard.ts +3 -0
- package/backend/localization/steps/handler-selection-step.ts +12 -17
- package/backend/localization/steps/mode-step.ts +9 -14
- package/backend/localization/steps/source-language-step.ts +8 -13
- package/backend/localization/steps/target-language-step.ts +12 -17
- package/backend/login-refresh.ts +1 -9
- package/backend/modal.ts +162 -6
- package/backend/notification.ts +90 -6
- package/backend/online-media.ts +1 -3
- package/backend/record-download-button.ts +4 -5
- package/backend/recordlist.ts +5 -0
- package/backend/tests/fixtures/modal-autofocus.html +1 -0
- package/backend/tests/form-engine/element/extra/select-box-filter-test.ts +215 -0
- package/backend/tests/form-engine/element/select-tree-test.ts +121 -0
- package/backend/tests/modal-test.ts +91 -0
- package/backend/tests/notification-test.ts +176 -0
- package/backend/tree/page-tree-element.ts +8 -1
- package/backend/wizard/steps/finisher-step.ts +2 -2
- package/backend/wizard/wizard.ts +11 -4
- package/core/ajax/ajax-request.ts +18 -0
- package/core/tests/ajax/ajax-request-test.ts +1 -1
- package/core/tests/utility/text-normalizer-test.ts +138 -0
- package/core/utility/text-normalizer.ts +98 -0
- package/dashboard/dashboard.ts +3 -8
- package/filelist/file-list-rename-handler.ts +3 -6
- package/filelist/file-list-replace-handler.ts +3 -6
- package/filelist/file-list.ts +3 -4
- package/form/backend/form-editor/modals-component.ts +114 -5
- package/form/backend/form-editor/view-model.ts +1 -1
- package/form/backend/form-wizard/steps/settings-step.ts +6 -3
- package/package.json +2 -2
- package/rte-ckeditor/legacy/ckeditor5-bundle.ts +0 -1
- package/rte-ckeditor/plugin/typo3-link.ts +7 -9
- package/rte-ckeditor/rte-link-browser.ts +1 -1
- package/scheduler/scheduler-add-group.ts +4 -12
- package/workspaces/backend.ts +7 -2
- package/workspaces/preview.ts +39 -0
- package/workspaces/renderable/comment-view.ts +4 -2
- package/workspaces/renderable/record-table.ts +134 -80
- package/workspaces/workspaces.ts +65 -12
|
@@ -54,6 +54,13 @@ const defaultConfiguration: Partial<HelperConfiguration> = {
|
|
|
54
54
|
rowItem: 'rowItem',
|
|
55
55
|
rowLink: 'rowLink',
|
|
56
56
|
rowsContainer: 'rowsContainer',
|
|
57
|
+
elementIdentifier: 'elementIdentifier',
|
|
58
|
+
elementType: 'elementType',
|
|
59
|
+
validationErrors: 'validationErrors',
|
|
60
|
+
validationErrorGroup: 'validationErrorGroup',
|
|
61
|
+
validationErrorGroupLabel: 'validationErrorGroupLabel',
|
|
62
|
+
validationErrorGroupItems: 'validationErrorGroupItems',
|
|
63
|
+
validationError: 'validationError',
|
|
57
64
|
templateInsertElements: 'Modal-InsertElements',
|
|
58
65
|
templateInsertPages: 'Modal-InsertPages',
|
|
59
66
|
templateValidationErrors: 'Modal-ValidationErrors'
|
|
@@ -206,7 +213,7 @@ function _validationErrorsModalSetup(
|
|
|
206
213
|
modalContent: DocumentFragment,
|
|
207
214
|
validationResults: ValidationResultsRecursive
|
|
208
215
|
): void {
|
|
209
|
-
let formElement, newRowItem;
|
|
216
|
+
let formElement: FormElement, newRowItem: HTMLElement | null;
|
|
210
217
|
|
|
211
218
|
assert(
|
|
212
219
|
Array.isArray(validationResults),
|
|
@@ -235,13 +242,70 @@ function _validationErrorsModalSetup(
|
|
|
235
242
|
formElement = getFormEditorApp()
|
|
236
243
|
.getFormElementByIdentifierPath(validationResults[i].formElementIdentifierPath);
|
|
237
244
|
newRowItem = rowItemTemplate?.cloneNode(true) as HTMLElement | null;
|
|
238
|
-
|
|
239
|
-
|
|
245
|
+
if (newRowItem) {
|
|
246
|
+
const rowLink = newRowItem;
|
|
240
247
|
rowLink.setAttribute(
|
|
241
248
|
getHelper().getDomElementDataAttribute('elementIdentifier'),
|
|
242
249
|
validationResults[i].formElementIdentifierPath
|
|
243
250
|
);
|
|
244
|
-
rowLink.
|
|
251
|
+
const rowLinkTitle = rowLink.querySelector('.form-editor-validation-error-title');
|
|
252
|
+
rowLinkTitle?.replaceChildren(_buildTitleByFormElement(formElement));
|
|
253
|
+
rowLink.querySelector(
|
|
254
|
+
getHelper().getDomElementDataIdentifierSelector('elementIdentifier')
|
|
255
|
+
)?.replaceChildren(document.createTextNode(formElement.get('identifier')));
|
|
256
|
+
rowLink.querySelector(
|
|
257
|
+
getHelper().getDomElementDataIdentifierSelector('elementType')
|
|
258
|
+
)?.replaceChildren(document.createTextNode(
|
|
259
|
+
getFormElementDefinition(formElement, 'label') || formElement.get('type')
|
|
260
|
+
));
|
|
261
|
+
const validationErrors = rowLink.querySelector(
|
|
262
|
+
getHelper().getDomElementDataIdentifierSelector('validationErrors')
|
|
263
|
+
);
|
|
264
|
+
const validationErrorGroupTemplate = validationErrors?.querySelector(
|
|
265
|
+
getHelper().getDomElementDataIdentifierSelector('validationErrorGroup')
|
|
266
|
+
);
|
|
267
|
+
const validationErrorTemplate = validationErrors?.querySelector(
|
|
268
|
+
getHelper().getDomElementDataIdentifierSelector('validationError')
|
|
269
|
+
);
|
|
270
|
+
validationErrors?.replaceChildren();
|
|
271
|
+
const validationErrorGroups = new Map<string, HTMLElement>();
|
|
272
|
+
validationResults[i].validationResults.forEach((propertyValidationResult) => {
|
|
273
|
+
const propertyLabel = _getPropertyLabelByPath(formElement, propertyValidationResult.propertyPath);
|
|
274
|
+
const finisherIndex = _getFinisherIndexByPropertyPath(propertyValidationResult.propertyPath);
|
|
275
|
+
const validatorIdentifier = _getValidatorIdentifierByPropertyPath(formElement, propertyValidationResult.propertyPath);
|
|
276
|
+
const groupLabel = finisherIndex
|
|
277
|
+
? _getFinisherLabelByIdentifier(formElement, finisherIndex)
|
|
278
|
+
: validatorIdentifier;
|
|
279
|
+
const groupKey = finisherIndex
|
|
280
|
+
? `finisher-${finisherIndex}`
|
|
281
|
+
: `validator-${validatorIdentifier}`;
|
|
282
|
+
const validationMessage = propertyValidationResult.validationResults.join(' ');
|
|
283
|
+
if (groupLabel && validationErrorGroupTemplate) {
|
|
284
|
+
let validationErrorGroup = validationErrorGroups.get(groupKey);
|
|
285
|
+
if (!validationErrorGroup) {
|
|
286
|
+
validationErrorGroup = validationErrorGroupTemplate.cloneNode(true) as HTMLElement;
|
|
287
|
+
validationErrorGroup.querySelector(
|
|
288
|
+
getHelper().getDomElementDataIdentifierSelector('validationErrorGroupLabel')
|
|
289
|
+
)?.replaceChildren(document.createTextNode(groupLabel));
|
|
290
|
+
validationErrorGroup.querySelector(
|
|
291
|
+
getHelper().getDomElementDataIdentifierSelector('validationErrorGroupItems')
|
|
292
|
+
)?.replaceChildren();
|
|
293
|
+
validationErrorGroups.set(groupKey, validationErrorGroup);
|
|
294
|
+
validationErrors?.append(validationErrorGroup);
|
|
295
|
+
}
|
|
296
|
+
const validationError = validationErrorTemplate?.cloneNode() as HTMLElement | undefined;
|
|
297
|
+
validationError?.replaceChildren(document.createTextNode(
|
|
298
|
+
propertyLabel ? `${propertyLabel}: ${validationMessage}` : validationMessage
|
|
299
|
+
));
|
|
300
|
+
validationErrorGroup.querySelector(
|
|
301
|
+
getHelper().getDomElementDataIdentifierSelector('validationErrorGroupItems')
|
|
302
|
+
)?.append(validationError);
|
|
303
|
+
} else {
|
|
304
|
+
const validationError = validationErrorTemplate?.cloneNode() as HTMLElement | undefined;
|
|
305
|
+
validationError?.replaceChildren(document.createTextNode(propertyLabel ? `${propertyLabel}: ${validationMessage}` : validationMessage));
|
|
306
|
+
validationErrors?.append(validationError);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
245
309
|
}
|
|
246
310
|
const rowsContainer = modalContent.querySelector(getHelper().getDomElementDataIdentifierSelector('rowsContainer'));
|
|
247
311
|
if (rowsContainer && newRowItem) {
|
|
@@ -251,7 +315,8 @@ function _validationErrorsModalSetup(
|
|
|
251
315
|
}
|
|
252
316
|
|
|
253
317
|
modalContent.querySelectorAll<HTMLAnchorElement>('a').forEach((a) => {
|
|
254
|
-
a.addEventListener('click', function() {
|
|
318
|
+
a.addEventListener('click', function(event: MouseEvent) {
|
|
319
|
+
event.preventDefault();
|
|
255
320
|
getPublisherSubscriber().publish('view/modal/validationErrors/element/clicked', [
|
|
256
321
|
a.getAttribute(getHelper().getDomElementDataAttribute('elementIdentifier'))
|
|
257
322
|
]);
|
|
@@ -272,6 +337,50 @@ function _buildTitleByFormElement(formElement: FormElement): HTMLElement {
|
|
|
272
337
|
return span;
|
|
273
338
|
}
|
|
274
339
|
|
|
340
|
+
function _getPropertyLabelByPath(formElement: FormElement, propertyPath: string): string {
|
|
341
|
+
return _getEditorConfigurationByPropertyPath(formElement, propertyPath)?.label || '';
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function _getValidatorIdentifierByPropertyPath(formElement: FormElement, propertyPath: string): string {
|
|
345
|
+
const editorConfiguration = _getEditorConfigurationByPropertyPath(formElement, propertyPath);
|
|
346
|
+
const validatorIdentifier = editorConfiguration?.propertyValidators?.find((identifier) => identifier !== 'NotEmpty');
|
|
347
|
+
return validatorIdentifier || '';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function _getEditorConfigurationByPropertyPath(
|
|
351
|
+
formElement: FormElement,
|
|
352
|
+
propertyPath: string
|
|
353
|
+
): FormElementDefinition['editors'][number] | undefined {
|
|
354
|
+
const formElementDefinition = getFormElementDefinition(formElement, undefined) as FormElementDefinition;
|
|
355
|
+
const editors = [
|
|
356
|
+
...(formElementDefinition.editors || []),
|
|
357
|
+
...Object.values(formElementDefinition.propertyCollections || {}).flatMap((collection) =>
|
|
358
|
+
collection.flatMap((collectionElement) => collectionElement.editors || [])
|
|
359
|
+
)
|
|
360
|
+
];
|
|
361
|
+
return editors.find((editorConfiguration) =>
|
|
362
|
+
editorConfiguration.propertyPath === propertyPath
|
|
363
|
+
|| propertyPath.endsWith(`.${editorConfiguration.propertyPath}`)
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function _getFinisherIndexByPropertyPath(propertyPath: string): string {
|
|
368
|
+
const match = propertyPath.match(/^finishers\.(\d+)\./);
|
|
369
|
+
if (!match) {
|
|
370
|
+
return '';
|
|
371
|
+
}
|
|
372
|
+
return match[1];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function _getFinisherLabelByIdentifier(formElement: FormElement, finisherIndex: string): string {
|
|
376
|
+
const finishers = formElement.get('finishers') as Array<{ identifier: string }> | undefined;
|
|
377
|
+
const finisherIdentifier = finishers?.[Number(finisherIndex)]?.identifier;
|
|
378
|
+
if (!finisherIdentifier) {
|
|
379
|
+
return '';
|
|
380
|
+
}
|
|
381
|
+
return getFormEditorApp().getFormEditorDefinition('finishers', finisherIdentifier)?.label || '';
|
|
382
|
+
}
|
|
383
|
+
|
|
275
384
|
/* *************************************************************
|
|
276
385
|
* Public Methods
|
|
277
386
|
* ************************************************************/
|
|
@@ -802,7 +802,7 @@ export function addAbstractViewValidationResults(): void {
|
|
|
802
802
|
const validationElement = getStage().getAbstractViewFormElementDomElement(validationResults[i].formElementIdentifierPath);
|
|
803
803
|
|
|
804
804
|
// Set invalid property on Lit web component (FormElementStageItem)
|
|
805
|
-
const stageItem = validationElement
|
|
805
|
+
const stageItem = validationElement?.querySelector('typo3-form-form-element-stage-item') as HTMLElement | null;
|
|
806
806
|
if (stageItem && 'invalid' in stageItem) {
|
|
807
807
|
(stageItem as any).invalid = true;
|
|
808
808
|
}
|
|
@@ -184,6 +184,11 @@ export class SettingsStep implements WizardStepInterface, WizardStepValueInterfa
|
|
|
184
184
|
|
|
185
185
|
let templatesFormGroup: TemplateResult | typeof nothing = nothing;
|
|
186
186
|
if (templates.length > 0) {
|
|
187
|
+
// Auto-select first template if none selected yet
|
|
188
|
+
if (!this.data.template) {
|
|
189
|
+
this.setValue({ template: templates[0].value });
|
|
190
|
+
}
|
|
191
|
+
|
|
187
192
|
templatesFormGroup = html `
|
|
188
193
|
<div class="form-group">
|
|
189
194
|
<label class="form-label" for="new-form-template">${formManagerLabels.get('formManager.form_template')}</label>
|
|
@@ -226,11 +231,9 @@ export class SettingsStep implements WizardStepInterface, WizardStepValueInterfa
|
|
|
226
231
|
}
|
|
227
232
|
|
|
228
233
|
private setPrototype(currentPrototype: string ): void {
|
|
229
|
-
const currentTemplates = this.context.formManager.getTemplatesForPrototype(currentPrototype);
|
|
230
|
-
|
|
231
234
|
this.setValue({
|
|
232
235
|
prototype: currentPrototype,
|
|
233
|
-
template:
|
|
236
|
+
template: ''
|
|
234
237
|
});
|
|
235
238
|
}
|
|
236
239
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typo3-typescript-sources",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.8",
|
|
4
4
|
"description": "TYPO3 Core TypeScript Sources - Extracted from TYPO3/typo3 repository",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"typo3": {
|
|
30
30
|
"sourceRepository": "https://github.com/TYPO3/typo3",
|
|
31
|
-
"sourceTag": "v14.3.
|
|
31
|
+
"sourceTag": "v14.3.8",
|
|
32
32
|
"sourcePath": "Build/Sources/TypeScript"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -12,6 +12,5 @@ export * as Widget from '@ckeditor/ckeditor5-widget';
|
|
|
12
12
|
|
|
13
13
|
// single or prefixed exports
|
|
14
14
|
export { WordCount } from '@ckeditor/ckeditor5-word-count';
|
|
15
|
-
export { LinkUtils } from '@ckeditor/ckeditor5-link';
|
|
16
15
|
|
|
17
16
|
console.warn('The module "@typo3/ckeditor5-bundle.js" has been marked as deprecated. Please use "@ckeditor/ckeditor5-*" modules directly.');
|
|
@@ -5,11 +5,9 @@ import * as Typing from '@ckeditor/ckeditor5-typing';
|
|
|
5
5
|
import * as Widget from '@ckeditor/ckeditor5-widget';
|
|
6
6
|
import * as Utils from '@ckeditor/ckeditor5-utils';
|
|
7
7
|
import * as Link from '@ckeditor/ckeditor5-link';
|
|
8
|
-
import { LinkUtils } from '@ckeditor/ckeditor5-link';
|
|
9
8
|
import { default as modalObject, type ModalElement } from '@typo3/backend/modal';
|
|
10
9
|
import type { ViewAttributeElement, ViewElement, ModelSchema, ModelWriter } from '@ckeditor/ckeditor5-engine';
|
|
11
|
-
import type { GeneralHtmlSupport, DataFilter } from '@ckeditor/ckeditor5-html-support';
|
|
12
|
-
import type { GHSViewAttributes } from '@ckeditor/ckeditor5-html-support/src/utils';
|
|
10
|
+
import type { GeneralHtmlSupport, DataFilter, GHSViewAttributes } from '@ckeditor/ckeditor5-html-support';
|
|
13
11
|
import { IconLink, IconPencil, IconUnlink } from '@ckeditor/ckeditor5-icons';
|
|
14
12
|
|
|
15
13
|
export const LINK_ALLOWED_ATTRIBUTES = ['href', 'title', 'class', 'target', 'rel', 'download'];
|
|
@@ -54,7 +52,7 @@ export class Typo3LinkCommand extends Core.Command {
|
|
|
54
52
|
|
|
55
53
|
// A check for any integration that allows linking elements (e.g. `LinkImage`).
|
|
56
54
|
// Currently, the selection reads attributes from text nodes only. See #7429 and #7465.
|
|
57
|
-
const sourceSelection =
|
|
55
|
+
const sourceSelection = Link.isLinkableElement(selectedElement, model.schema) ? selectedElement : selection;
|
|
58
56
|
if (sourceSelection === selectedElement) {
|
|
59
57
|
this.value = selectedElement.getAttribute('linkHref') as string;
|
|
60
58
|
this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');
|
|
@@ -227,7 +225,7 @@ export class Typo3UnlinkCommand extends Core.Command {
|
|
|
227
225
|
const selection = model.document.selection;
|
|
228
226
|
const selectedElement = selection.getSelectedElement();
|
|
229
227
|
|
|
230
|
-
if (
|
|
228
|
+
if (Link.isLinkableElement(selectedElement, model.schema)) {
|
|
231
229
|
this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');
|
|
232
230
|
} else {
|
|
233
231
|
this.isEnabled = model.schema.checkAttributeInSelection(selection, 'linkHref');
|
|
@@ -457,7 +455,7 @@ export class Typo3LinkUI extends Core.Plugin {
|
|
|
457
455
|
const t = editor.t;
|
|
458
456
|
|
|
459
457
|
// Handle the `Ctrl+K` keystroke and show the panel.
|
|
460
|
-
editor.keystrokes.set(
|
|
458
|
+
editor.keystrokes.set(Link._LINK_KEYSTROKE, (keyEvtData, cancel) => {
|
|
461
459
|
// Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
|
|
462
460
|
cancel();
|
|
463
461
|
if (linkCommand.isEnabled) {
|
|
@@ -471,7 +469,7 @@ export class Typo3LinkUI extends Core.Plugin {
|
|
|
471
469
|
linkButton.isEnabled = true;
|
|
472
470
|
linkButton.label = t('Link');
|
|
473
471
|
linkButton.icon = IconLink;
|
|
474
|
-
linkButton.keystroke =
|
|
472
|
+
linkButton.keystroke = Link._LINK_KEYSTROKE;
|
|
475
473
|
linkButton.tooltip = true;
|
|
476
474
|
linkButton.isToggleable = true;
|
|
477
475
|
linkButton.bind('isEnabled').to(linkCommand, 'isEnabled');
|
|
@@ -486,7 +484,7 @@ export class Typo3LinkUI extends Core.Plugin {
|
|
|
486
484
|
const linkCommand = editor.commands.get('link');
|
|
487
485
|
button.bind('isEnabled').to(linkCommand, 'value', href => !!href);
|
|
488
486
|
button.bind('href').to(linkCommand, 'value', href => {
|
|
489
|
-
return href &&
|
|
487
|
+
return href && Link._ensureSafeLinkUrl(href, allowedProtocols);
|
|
490
488
|
});
|
|
491
489
|
|
|
492
490
|
button.icon = undefined;
|
|
@@ -753,7 +751,7 @@ export class Typo3LinkUI extends Core.Plugin {
|
|
|
753
751
|
}
|
|
754
752
|
|
|
755
753
|
private findLinkElementAncestor(position: any) {
|
|
756
|
-
return position.getAncestors().find((ancestor: any) =>
|
|
754
|
+
return position.getAncestors().find((ancestor: any) => Link.isLinkElement(ancestor));
|
|
757
755
|
}
|
|
758
756
|
|
|
759
757
|
/**
|
|
@@ -16,7 +16,7 @@ import Modal from '@typo3/backend/modal';
|
|
|
16
16
|
import RegularEvent from '@typo3/core/event/regular-event';
|
|
17
17
|
import { type Typo3LinkDict, LINK_ALLOWED_ATTRIBUTES, addLinkPrefix } from '@typo3/rte-ckeditor/plugin/typo3-link';
|
|
18
18
|
import type * as Core from '@ckeditor/ckeditor5-core';
|
|
19
|
-
import type { ModelPosition } from '@ckeditor/ckeditor5-engine
|
|
19
|
+
import type { ModelPosition } from '@ckeditor/ckeditor5-engine';
|
|
20
20
|
import '@typo3/backend/element/combobox-element';
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -37,7 +37,7 @@ class SchedulerAddGroups {
|
|
|
37
37
|
element.addEventListener('click', (button: MouseEvent) => {
|
|
38
38
|
button.preventDefault();
|
|
39
39
|
const content: TemplateResult = html`
|
|
40
|
-
<form name="scheduler-create-group" @submit=${this.createGroup}>
|
|
40
|
+
<form id="scheduler-create-group" name="scheduler-create-group" @submit=${this.createGroup}>
|
|
41
41
|
<label class="form-label" for="actionCreateGroup">Group name</label>
|
|
42
42
|
<input class="form-control" id="actionCreateGroup" required="" name="action[createGroup]" autofocus type="text">
|
|
43
43
|
<div class="form-text mt-3">
|
|
@@ -46,7 +46,7 @@ class SchedulerAddGroups {
|
|
|
46
46
|
</form>
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Modal.advanced({
|
|
50
50
|
content: content,
|
|
51
51
|
title: labels.get('function.group.add'),
|
|
52
52
|
size: Modal.sizes.small,
|
|
@@ -57,21 +57,13 @@ class SchedulerAddGroups {
|
|
|
57
57
|
btnClass: 'btn-default',
|
|
58
58
|
name: 'cancel'
|
|
59
59
|
},{
|
|
60
|
-
trigger: (): void => {
|
|
61
|
-
const form: HTMLFormElement = Modal.currentModal.querySelector('form[name="scheduler-create-group"]');
|
|
62
|
-
form.requestSubmit();
|
|
63
|
-
},
|
|
64
60
|
text: labels.get('button.group.modalOk'),
|
|
65
61
|
btnClass: 'btn-primary',
|
|
66
|
-
name: 'ok'
|
|
62
|
+
name: 'ok',
|
|
63
|
+
form: 'scheduler-create-group'
|
|
67
64
|
}
|
|
68
65
|
]
|
|
69
66
|
});
|
|
70
|
-
|
|
71
|
-
modal.addEventListener('typo3-modal-shown', (): void => {
|
|
72
|
-
const input: HTMLInputElement = Modal.currentModal.querySelector('input[name="action[createGroup]"]');
|
|
73
|
-
input.focus();
|
|
74
|
-
});
|
|
75
67
|
});
|
|
76
68
|
}
|
|
77
69
|
}
|
package/workspaces/backend.ts
CHANGED
|
@@ -469,6 +469,7 @@ class Backend extends Workspaces {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
const workspacesRecordTable = document.querySelector('typo3-workspaces-record-table');
|
|
472
|
+
workspacesRecordTable.additionalColumns = result.additionalColumns ?? {};
|
|
472
473
|
workspacesRecordTable.results = result.data;
|
|
473
474
|
}
|
|
474
475
|
|
|
@@ -517,9 +518,13 @@ class Backend extends Workspaces {
|
|
|
517
518
|
filterFields: true
|
|
518
519
|
}),
|
|
519
520
|
).then(async (response: AjaxResponse): Promise<void> => {
|
|
520
|
-
const
|
|
521
|
-
const
|
|
521
|
+
const details = await response.resolve();
|
|
522
|
+
const item = details[0]?.result.data[0];
|
|
523
|
+
if (item === undefined) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
522
526
|
|
|
527
|
+
const modalButtons = [];
|
|
523
528
|
const content = document.createElement('typo3-workspaces-record-information');
|
|
524
529
|
content.record = item;
|
|
525
530
|
|
package/workspaces/preview.ts
CHANGED
|
@@ -30,6 +30,7 @@ enum Identifiers {
|
|
|
30
30
|
workspaceView = '.t3js-workspace-view-workspace',
|
|
31
31
|
sendToStageAction = '[data-action="send-to-stage"]',
|
|
32
32
|
discardAction = '[data-action="discard"]',
|
|
33
|
+
publishAction = '[data-action="publish"]',
|
|
33
34
|
stageButtonsContainer = '.t3js-stage-buttons',
|
|
34
35
|
previewModeContainer = '.t3js-preview-mode',
|
|
35
36
|
activePreviewMode = '.t3js-active-preview-mode',
|
|
@@ -78,6 +79,7 @@ class Preview extends Workspaces {
|
|
|
78
79
|
this.resizeViews();
|
|
79
80
|
}, 50).bindTo(window);
|
|
80
81
|
new RegularEvent('click', this.renderDiscardWindow.bind(this)).delegateTo(document, Identifiers.discardAction);
|
|
82
|
+
new RegularEvent('click', this.renderPublishWindow.bind(this)).delegateTo(document, Identifiers.publishAction);
|
|
81
83
|
new RegularEvent('click', this.renderSendPageToStageWindow.bind(this)).delegateTo(document, Identifiers.sendToStageAction);
|
|
82
84
|
new RegularEvent('click', () => {
|
|
83
85
|
window.top.document.querySelectorAll('.t3js-workspace-recipient:not([disabled])').forEach((element: HTMLInputElement) => {
|
|
@@ -166,6 +168,43 @@ class Preview extends Workspaces {
|
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
170
|
|
|
171
|
+
private renderPublishWindow(): void {
|
|
172
|
+
const modal = Modal.confirm(
|
|
173
|
+
labels.get('window.publishAll.title'),
|
|
174
|
+
labels.get('window.publishAll.message'),
|
|
175
|
+
SeverityEnum.warning,
|
|
176
|
+
[
|
|
177
|
+
{
|
|
178
|
+
text: labels.get('cancel'),
|
|
179
|
+
active: true,
|
|
180
|
+
btnClass: 'btn-default',
|
|
181
|
+
name: 'cancel',
|
|
182
|
+
trigger: (): void => {
|
|
183
|
+
modal.hideModal();
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
text: labels.get('ok'),
|
|
188
|
+
btnClass: 'btn-warning',
|
|
189
|
+
name: 'ok',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
);
|
|
193
|
+
modal.addEventListener('button.clicked', (e: Event): void => {
|
|
194
|
+
if ((e.target as HTMLButtonElement).name === 'ok') {
|
|
195
|
+
this.sendRemoteRequest([
|
|
196
|
+
this.generateRemotePayloadBody('publishPageDirectly', [TYPO3.settings.Workspaces.id]),
|
|
197
|
+
this.generateRemotePayloadBody('updateStageChangeButtons', [TYPO3.settings.Workspaces.id]),
|
|
198
|
+
], Identifiers.topbar).then(async (response: AjaxResponse): Promise<void> => {
|
|
199
|
+
modal.hideModal();
|
|
200
|
+
this.renderStageButtons((await response.resolve())[1].result);
|
|
201
|
+
// Reloading live view IFRAME
|
|
202
|
+
this.elements.workspaceView.setAttribute('src', this.elements.workspaceView.getAttribute('src'));
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
169
208
|
/**
|
|
170
209
|
* Renders the "send page to stage" window
|
|
171
210
|
*/
|
|
@@ -16,12 +16,13 @@ import { html, LitElement, nothing, type TemplateResult } from 'lit';
|
|
|
16
16
|
import { repeat } from 'lit/directives/repeat.js';
|
|
17
17
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
18
18
|
import { nl2br } from '@typo3/core/directive/nl2br';
|
|
19
|
+
import labels from '~labels/workspaces.messages';
|
|
19
20
|
|
|
20
21
|
type Comment = {
|
|
21
22
|
user_comment: string;
|
|
22
23
|
previous_stage_title: string;
|
|
23
24
|
stage_title: string;
|
|
24
|
-
tstamp:
|
|
25
|
+
tstamp: string;
|
|
25
26
|
user_username: string;
|
|
26
27
|
user_avatar: string
|
|
27
28
|
};
|
|
@@ -64,7 +65,8 @@ export class CommentViewElement extends LitElement {
|
|
|
64
65
|
${comment.previous_stage_title} ⇾ ${comment.stage_title}
|
|
65
66
|
</span>
|
|
66
67
|
<span class="badge badge-info">
|
|
67
|
-
${comment.tstamp}
|
|
68
|
+
${comment.tstamp ? labels.get('comment.tstamp.value', { tstamp: new Date(comment.tstamp) }) : nothing}
|
|
69
|
+
</span>
|
|
68
70
|
</div>
|
|
69
71
|
</div>
|
|
70
72
|
</div>
|