Skip to content

Commit

Permalink
[BUGFIX] Render „create new content element“ wizard in modal
Browse files Browse the repository at this point in the history
The "create new content element" wizard that may be triggered by using
the context menu now properly renders the wizard in a modal window.

Additionally, the patch streamlines the usage of Enum/Severity.

Resolves: #84046
Related: #75676
Releases: master
Change-Id: Id166fd5acbe19cbb969ff3d5cfef75119deb80b3
Reviewed-on: https://review.typo3.org/56520
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
  • Loading branch information
andreaskienast authored and NeoBlack committed Apr 4, 2018
1 parent de0dd5a commit 6871fc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Expand Up @@ -304,7 +304,8 @@ protected function getAdditionalAttributes(string $itemName): array
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$url = (string)$uriBuilder->buildUriFromRoute($moduleName, $urlParameters);
$attributes += [
'data-new-wizard-url' => htmlspecialchars($url)
'data-new-wizard-url' => htmlspecialchars($url),
'data-title' => $this->languageService->getLL('newContentElement'),
];
}
if ($itemName === 'delete') {
Expand Down
Expand Up @@ -11,11 +11,11 @@
* The TYPO3 project - inspiring people to share!
*/

import {SeverityEnum} from './Enum/Severity';
import * as $ from 'jquery';
import InfoWindow = require('./InfoWindow');
import Modal = require('./Modal');
import ModuleMenu = require('./ModuleMenu');
import Severity = require('./Severity');
import Viewport = require('./Viewport');

/**
Expand Down Expand Up @@ -84,10 +84,17 @@ class ContextMenuActions {
* @param {number} uid
*/
public static newContentWizard(table: string, uid: number): void {
let $wizardUrl = $(this).data('new-wizard-url');
const $me = $(this);
let $wizardUrl = $me.data('new-wizard-url');
if ($wizardUrl) {
$wizardUrl += '&returnUrl=' + ContextMenuActions.getReturnUrl();
Viewport.ContentContainer.setUrl($wizardUrl);
Modal.advanced({
title: $me.data('title'),
type: Modal.types.ajax,
size: Modal.sizes.medium,
content: $wizardUrl,
severity: SeverityEnum.notice
});
}
}

Expand Down Expand Up @@ -179,7 +186,7 @@ class ContextMenuActions {
const $modal = Modal.confirm(
$anchorElement.data('title'),
$anchorElement.data('message'),
Severity.warning, [
SeverityEnum.warning, [
{
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true,
Expand Down Expand Up @@ -309,7 +316,7 @@ class ContextMenuActions {
const $modal = Modal.confirm(
$anchorElement.data('title'),
$anchorElement.data('message'),
Severity.warning, [
SeverityEnum.warning, [
{
text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
active: true,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6871fc9

Please sign in to comment.