Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip modal to create record #642

Closed

Conversation

mazeeblanke
Copy link
Contributor

@mazeeblanke mazeeblanke commented May 3, 2020

This update adds an option for skipping the modal to create a record this allows developers support complex form fields when creating a record such as blocks, repeaters etc.

To use set skipCreateModal to true in the $indexOption of the admin Module Controller

   protected $indexOptions = [
      'skipCreateModal' => true
   ];

A new route is added to a module for showing the create form i.e /module/create.
If a user visits /module/create when skipCreateModal is set to false, the user is redirected to the listing page with the openCreate=1

@CLAassistant
Copy link

CLAassistant commented May 3, 2020

CLA assistant check
All committers have signed the CLA.

@adam-jones-net
Copy link

adam-jones-net commented May 25, 2020

@ifox any chance this can get approved to make the next release? It would really make Twill a lot more flexible to not have this initial popup forced at users always for certain kinds of data entry.

@ifox ifox closed this in 571cc1e Jul 15, 2020
@marinaglancy
Copy link
Contributor

marinaglancy commented Jul 18, 2020

This change has broke settings forms. I found that if I add this to the settings.blade.php it works again:

window['{{ config('twill.js_namespace') }}'].STORE.publication.createWithoutModal = false

I created #701 about it

@jrusinowicz
Copy link

I see another problem with this change. When I'm setting skipCreateModal to true, I'm redirected to /create route but on this route modal is opening and i'm not able to close it...

@ifox
Copy link
Member

ifox commented Aug 27, 2020

You're not supposed to be able to until you provide a title. The difference is that instead of creating a record it closes the modal and let's you fill in the rest of the form before creating anything in database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants