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

Improve Add and Edit Page Flows #380

Merged
merged 7 commits into from
Sep 21, 2023
Merged

Improve Add and Edit Page Flows #380

merged 7 commits into from
Sep 21, 2023

Conversation

nmanu1
Copy link
Contributor

@nmanu1 nmanu1 commented Sep 21, 2023

Update stream scope selection in the Add Page and Edit Page flows. The stream scope filters are now sourced from an account's content so only valid filters can be selected from curated dropdowns. The account is identified based on the API key present as the YEXT_STUDIO_API_KEY environment variable.

nmanu1 and others added 7 commits September 5, 2023 15:20
This PR updates the modal for specifying the stream scope in the add page flow so the inputs have a similar UI to the custom Tailwind class input. Each input will have an icon that opens a dropdown with the possible options that can be added for setting the scope. So far, the dropdowns for entity types and saved filters will be correctly populated from the store (tested with dummy data for now). The remaining subtasks will populate the store with actual account content and populate the dropdown for entities, which is more complex.

Also, make the disabled behavior for the Tailwind class prop input more robust: 1) the embed icon is no longer clickable when the input is disabled and 2) the disabled state is more visibly different from the enabled state.

J=SLAP-2905, 2910
TEST=auto, manual

Check that a new page can be created with a stream scope with zero, one, or multiple filters. Makes sure that the disabled state works correctly so that selecting one type of filter (e.g. entity type) will disable the other inputs (saved filters and entities).
This PR populates the store with the account content for saved filters, entity types, and the first 50 entities of each type. The `PillPicker` dropdown styling is also updated to be a fixed max height with scrollable content, instead of growing the dropdown to display all options.

J=SLAP-2906
TEST=auto, manual

Hard-code an API key in studio-plugin and see the stream scope modal for adding an entity page in the test site is populated with the entity types and saved filters from the Slapshot test account. Entity types with no entities are not included in the entity types dropdown.
This PR adds an entity type dropdown to the entityIds StreamScope field.
It also adds dynamic fetching of entities once the user scrolls down the
bottom of the select.

J=SLAP-2907
TEST=manual

I can specify an entity type, select entity ids, then switch entity type
and select more ids
saving the page correctly adds the entity ids to the TemplateConfig

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This PR adds the add page flow stream scope improvements to the page
edits. There is now a new edit scope button on the page panel next to
the settings button which opens up a new Stream Scope Edit modal.

The modal is pre-populated by the current stream scope config in the
page template. Since we are only allowing users to edit one stream scope
at a time, if the developer has specified a mix of stream scopes, all
editing will be disabled. Users can only submit their new selection if
changes have been made, similar to the old page settings.

If there are no entity types or saved filters, then these fields will
not be editable. In these cases, even if the developer has specified a
stream scope, it will not be displayed.

J=SLAP-2918
TEST=auto, manual
Note: the size limit needed to be updated now that we are importing the default export from `react-select`
#372)

This PR adds logic to the creation of the Studio Vite Plugin. If there
is an env var called `YEXT_STUDIO_API_KEY`, we use that to create an
instance of the `ManagementApiService`. This environment variable should
be available in all Studio CBD containers. The value of the variable is
an API Key that will give the Studio instance access to the Management
API. This is the API that powers Stream Scope Selection.

TEST=manual

Tested locally. I did not have the env var set and saw that Stream Scope
Selection was disabled. Then I set the env var and saw that the Scope
Selection dropdowns were populated correctly.
@nmanu1 nmanu1 changed the title Test Improve Add and Edit Page Flows Sep 21, 2023
@nmanu1 nmanu1 marked this pull request as ready for review September 21, 2023 18:56
@tmeyer2115 tmeyer2115 self-requested a review September 21, 2023 19:12
@nmanu1 nmanu1 merged commit 215b38d into main Sep 21, 2023
15 checks passed
@nmanu1 nmanu1 deleted the feature/add-page-improvements branch September 21, 2023 19:19
@tmeyer2115 tmeyer2115 mentioned this pull request Sep 22, 2023
tmeyer2115 added a commit that referenced this pull request Sep 22, 2023
## Features
- We've introduced the concept of Page Layouts (or Layouts) to Studio. A
Page Layout is a pre-prescribed set of Components that you can apply to
a Page. By default, Layouts live in the `src/layouts` directory. In the
UI, a Layout can be applied via the "Insert" button. (#370, #367, #375)
- There is now improved UX for creating or editing an Entity Page's
Stream Scope. Instead of being raw inputs, the fields for Entity Ids,
Entity Types, and Saved Filters are now drop-downs with the relevant
options populated from the account. (#380)

## Changes
- Repeaters and Modules have been officially deprecated and removed from
Studio. (#369)
alextaing pushed a commit that referenced this pull request Sep 22, 2023
## Features
- We've introduced the concept of Page Layouts (or Layouts) to Studio. A
Page Layout is a pre-prescribed set of Components that you can apply to
a Page. By default, Layouts live in the `src/layouts` directory. In the
UI, a Layout can be applied via the "Insert" button. (#370, #367, #375)
- There is now improved UX for creating or editing an Entity Page's
Stream Scope. Instead of being raw inputs, the fields for Entity Ids,
Entity Types, and Saved Filters are now drop-downs with the relevant
options populated from the account. (#380)

## Changes
- Repeaters and Modules have been officially deprecated and removed from
Studio. (#369)
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.

4 participants