Skip to content

UI: introduce secondary prompt content - #11987

Open
schmitz-ilias wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
schmitz-ilias:12_ks_secondary_prompt_content
Open

UI: introduce secondary prompt content#11987
schmitz-ilias wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
schmitz-ilias:12_ks_secondary_prompt_content

Conversation

@schmitz-ilias

Copy link
Copy Markdown
Contributor

As discussed in #11105, this PR is a proposal for introducing secondary content to the show state of prompts. Secondary content is rendered in the prompt below the primary content. The primary content alone determines title and actions of the prompt. Further, ScaleBar is tagged isPromptContent, and the implementation of the "Publish Button" in MetaData is changed accordingly to not use a roundtrip modal as prompt content anymore.

I also included a small fix in the js of prompts, I kept getting an "getElementsByTagName(...).forEach not a function" error. Not sure why this isn't an issue in 11.

In contrast to what was suggested in #11105, I decided to discard actions contributed by secondary content: It should never be necessary to distribute the actions one wants to appear in the prompt over multiple components, and I also wanted to discourage doing silly things like adding multiple forms to the same prompt. If we want to be more strict about this, a bespoke interface isSecondaryPromptContent/isNonInteractivePromptContent could be a way to go.

In the future, I could see demand for being able to also display secondary content above the primary content. Instead of being explicit about this in the signature of Prompt\State\Factory::show, I think it would be best to decide the position of secondary content dynamically based on the component, so e.g. MessageBox always goes on top. In any case, this didn't seem essential for a first implementation, so for now all secondary content goes on the bottom.

I would have added unit tests for this feature, but there don't seem to be any unit tests for prompts at all so far. I also haven't added a KS example. As far as I understood from the discussion in #11105, you don't want to encourage the use of ScaleBar as prompt content, and other combinations of primary above secondary content with the available isPromptContent components also didn't seem suited for an example.

Let me know what you think!

Best, Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement kitchen sink php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants