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

Globals tweaks #1659

Merged
merged 9 commits into from Apr 10, 2020
Merged

Globals tweaks #1659

merged 9 commits into from Apr 10, 2020

Conversation

jasonvarga
Copy link
Member

Globals no longer need IDs.

  • Technically they still have ids, but they alias the handle.
  • IDs were introduced to let you rename the handles without breaking things. But if you change the handle you'd need to do some manually work anyway (templates, etc). The ID just made things uglier. Not enough benefit.

Better separates editing of the global set itself, and its variables.

  • Think of the global set like a collection, and its variables like an entry.
  • The create global set screen now uses a consistent mini-wizard view.
  • The edit global set screen is now its own route/form instead of a stack while editing the variables.
  • Separate globals and variables into different controllers.

Multisite behavior is more intuitive.

  • Behaves more like navs. If there's a file in a site subdirectory, then it exists for that site.
  • You no longer need to define which sites it should be available in on the set level. The sites array is no longer needed.
  • When editing a global set, you can select which sites its available in, and which site each should use as its origin. Hitting save will create and/or delete the appropriate files.

And more

  • SiteSelector.vue (the top level CP one) is renamed to GlobalSiteSelector.vue.
  • The site selector used on the nav view is moved up a level, not specific to structures, and now shared by globals.
  • Some other related tidying up.

- Props want objects, but when json encoding empty arrays they become arrays.
- Prevent rendering of the form when its empty anyway
- Rename the global site selector
- Remove extra li elements, fix dropdown positioning.
- Move the structure site selector up a level. It's generic enough. The global set publish form will use it.
- Remove ID from globals. Having the handle is nicer in most cases. The ID was there so if you rename the handle things wouldnt break. Things will break anyway if you're renaming the handle.
- Global sets id method is now just a getter (like collections). It aliases the handle.
- Adjust global routes and controllers. The variables controller handles the publish form. The globals controller now deals with global sets themselves.
- Dedicated configure/edit form instead of a stack. That doesn't happen anywhere else anymore.
- Moved controllers into namespace
- Multisite fixes. Some things were applied to the entry publish form but not carried over to the globals
- Scrap the localization logic. It will work like navs. When you configure the global, it will create the appropriate localized files. Rather than being created on the fly when you use the switcher. (The creation step hasn't been done yet.)

ps. sorry for megacommit
…r that site. Doesn't need to be defined on the set level.
@jasonvarga jasonvarga marked this pull request as draft April 10, 2020 15:43
@jasonvarga jasonvarga marked this pull request as ready for review April 10, 2020 15:44
@jasonvarga jasonvarga merged commit f8069a2 into master Apr 10, 2020
@jasonvarga jasonvarga deleted the feature/globals branch April 10, 2020 16:07
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.

None yet

1 participant