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

Select different layouts for multiple and single entry (per-context switcher) #1996

Conversation

doekenorg
Copy link
Contributor

@doekenorg doekenorg commented Feb 26, 2024

Things to test:

  • Saving existing Views shouldn't change anything
    • Edit an existing View
    • Don't do anything
    • Save the View
    • Check to make sure the previous single/multiple entries layouts don't change
  • Updating a View works
    • Edit an existing View
    • Change the layout type
    • Save the View
    • Confirm that the layouts are correct for single & multiple layouts
  • Confirm that the View type change dialog occurs when switching from Table/DataTables to other layouts
  • Confirm that when changing layout types and the fields are cleared, only the current tab is affected

Testing different states

  • Unlicensed or license doesn't support layouts
  • Has license but layout is not installed
    • Should look like design
    • Clicking the Install Now button should install and activate the layout plugin
    • The layout should then appear clickable
    • Clicking the newly-installed layout should activate it
  • Has license and layout is installed, but not activated
    • Clicking Activate should activate the layout plugin
    • The layout should then appear clickable
    • Clicking the newly-installed layout should activate it

Browser test

Check appearance, confirm functionality in:

  • Chrome
  • Firefox
  • Safari

This PR addresses #1177.

It adds a new dropdown solution with support for icons and descriptions. It also adds a new variable that contains a separate template for the single entry. There is backwards compatibility as the value of the new variable has a fallback to the "old" variable, that is now solely for the multiple entries.

pr-preview

Todo:

  • It needs a design (and fixes) for inactive items like the regular selection now has.
  • It needs icons for native templates, otherwise fallback to the image it now has.

In the meantime this can be tested and reviewed for what we have now.

image

💾 Build file (1861324).

@doekenorg doekenorg self-assigned this Feb 28, 2024
@zackkatz
Copy link
Member

zackkatz commented Feb 29, 2024

Hey @doekenorg, I had a chance to review. I encountered a few issues:

  • As we discussed, please only show layouts, not presets, in the dropdown
  • There are some strange CSS issues going on for me, including inner scrollbars and modals not being visible. I imagine these are just a matter of scoping the dropdown toggle. Please check out the video. Video two shows that it's not the _view-dropdown.scss file?
  • When the dropdown is open, clicking outside of it should close the dropdown

Thanks 👍

@doekenorg doekenorg force-pushed the feature/1177-allow-different-layouts-for-multiple-entries-and-single-entry branch from dea25cc to 5df9a05 Compare March 5, 2024 09:40
@doekenorg
Copy link
Contributor Author

@zackkatz I looked into your issues with the CSS, but I cannot reproduce this in any browser. It all just works properly.

The only way I can reproduce is to manually set an overflow: hidden of auto on the box that holds your popup. This makes me believe you might have a piece of custom css that I don't have. Whenever possible I'd like to look at it together so we can pinpoint where that comes from. Let me know when you are available.

Fixed the other two things.

@zackkatz
Copy link
Member

zackkatz commented Apr 9, 2024

@doekenorg Hey, can you please update to the new designs?

@doekenorg doekenorg force-pushed the feature/1177-allow-different-layouts-for-multiple-entries-and-single-entry branch from 630f4e7 to a011572 Compare April 22, 2024 07:19
@doekenorg
Copy link
Contributor Author

@zackkatz the new designs are in.

  • Activate / Install logic works
  • Icons are added (also for the plugins if they don't provide the icon themselves)

I'm not sure how buy now is supposed to work. Does that exist in the current settings block. I have not seen that.

@mrcasual mrcasual added this to the 2.23.0 milestone Apr 29, 2024
@crbdev
Copy link

crbdev commented May 2, 2024

Here are my notes from testing this PR. Besides the issues highlighted below and the things not yet tested, everything else works well.

1. Updating existing Views and creating new Views

Using the combination of DataTables Table for the MEL and List for the SEL causes a warning message to appear when navigating to the SEL on the front end: "The Single Entry layout has not been configured".

Steps to reproduce:

  • Create a new View
  • Select the DataTables Table View Type
  • Go to the Single Entry Layout tab
  • Use the View switcher to change the layout to "List"
  • Add fields to the Single Entry Layout
  • Save the View and view on front-end.

*This also happens when editing an existing View
*I didn't enounter any issues with other layout combinations

2. Installing or activating layouts from inside the View switcher

To be clear, this works! I only have a suggestion. When installing or activating layouts, there is a spinner on the cursor while the layout is installed or activated. However, this spinner disappears if you hover over another layout choice. Other layouts are still clickable while this is happening. So, if you move your cursor, it's not clear that anything is actually happening. Maybe we should make it more clear that something is happening, and/or not have the other layouts clickable while this is process is occuring?

3. The Maps layout

Possibly another discussion but I wonder if we want the Maps layout available at all? After all, it is most useful as a widget. Moreover, for the Single Entry Layout, the "Maps (Default)" option is the same as the List layout as far as I can tell, so we could consider removing it as an option there?

Things not tested

  • Unlicensed or license doesn't support layouts

@zackkatz zackkatz changed the title Select different views for multiple and single entry Select different layouts for multiple and single entry (per-context switcher) May 8, 2024
@zackkatz zackkatz mentioned this pull request May 8, 2024
4 tasks
zackkatz added 2 commits May 10, 2024 16:15
We need to remove this button altogether now that we have a layout switcher.
@zackkatz
Copy link
Member

zackkatz commented May 10, 2024

@doekenorg We're getting close! Just a few more items:

  • Remove the #gv_switch_view_button button from the Data Source menu. This will take some work; it's in admin-views.js in multiple places.
  • Make sure it works with View Presets
  • Clicking the icon should open the dropdown
  • When installing a plugin, make the whole .view-dropdown-list-item div have cursor: progress;, not just the pill
  • For me to do: update the Pro Upgrade button to use the upgrade link in format of https://www.gravitykit.com/checkout/?edd_action=sl_license_upgrade&license_id=6659&upgrade_id=5

zackkatz and others added 3 commits May 13, 2024 22:03
- Improve contrast for accessibility against the background colors
- Don't have borders hitting up against each other
- Make the upgrade button look better (I think) by using a glow instead of white border
- Prevent text selection in the menu, which can happen when clicking and dragging and double-clicking
@doekenorg
Copy link
Contributor Author

doekenorg commented May 22, 2024

@zackkatz what do you mean with: Make sure it works with View Presets ?

And on the gv_switch_view_button. I understand, but I actually specifically did not touch this to avoid this whole mess of cleaning it up. Especially with the revamp the view editor coming up. I mean, I can invest the time; but it's already a hidden button right?

@rafaehlers
Copy link
Contributor

rafaehlers commented May 22, 2024

@crbdev
Copy link

crbdev commented May 23, 2024

  • Add UTM tracking links to all "Buy Now" buttons

Here's what I would propose, as an example:
/?utm_campaign=gk_upsells&utm_source=view-editor&utm_content=diy

UTM sheet for reference
https://docs.google.com/spreadsheets/d/15oBygotBeX1TT_5Q-5L9Eslmh8EyWrqU1hn-6CT1i34/edit#gid=0

@doekenorg
Copy link
Contributor Author

  • Add UTM tracking links to all "Buy Now" buttons

Here's what I would propose, as an example: /?utm_campaign=gk_upsells&utm_source=view-editor&utm_content=diy

UTM sheet for reference https://docs.google.com/spreadsheets/d/15oBygotBeX1TT_5Q-5L9Eslmh8EyWrqU1hn-6CT1i34/edit#gid=0

@crbdev I changed it to https://www.gravitykit.com/pricing/?utm_campaign=gk_upsells&utm_source=view-editor&utm_content=upgrade because the upgrades are combined into a new section with a single "upgrade" button. Is that ok?

@doekenorg
Copy link
Contributor Author

doekenorg commented May 23, 2024

Found a bug:

  • Storing the view can cause a js error that triggers a weird warning in the page.

@mrcasual mrcasual modified the milestones: 2.23.0, 2.24 May 23, 2024
@crbdev
Copy link

crbdev commented May 27, 2024

On the "Views" page, the "Template" column only shows the layout being used on the multiple entry page, should we update this to reflect the layout being used on both the multiple and single entry pages?

e.g. 👇

CleanShot 2024-05-27 at 10 30 12@2x

@doekenorg
Copy link
Contributor Author

doekenorg commented May 27, 2024

@crbdev done

If both are the same template, it will just show "Table" or "List" and not "Table / Table".

image

@zackkatz zackkatz merged commit 3bd0fa4 into develop May 27, 2024
1 check passed
@zackkatz zackkatz deleted the feature/1177-allow-different-layouts-for-multiple-entries-and-single-entry branch May 27, 2024 22:18
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