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

Allow automatically generated lanes to be renamed. #74

Merged
merged 3 commits into from
Feb 14, 2023

Conversation

ray-lee
Copy link
Contributor

@ray-lee ray-lee commented Feb 10, 2023

Description

This allows automatically generated lanes to be renamed.

  • In the Lanes sidebar, every lane now has an edit button, whether it's custom or automatically generated.
  • In the lane editor, automatically generated lanes can only be renamed and made visible/invisible. Other functions are not available: deleting, adding/removing lists, and inheriting restrictons from the parent.

The included tests contain examples of using Jest mocks with React Testing Library to achieve something similar to Enzyme's shallow rendering, which allows isolating tests to a single component.

Motivation and Context

Libraries have requested the ability to rename the automatically generated lanes. Notion: https://www.notion.so/lyrasis/Admin-UI-Add-ability-to-rename-a-default-lane-name-in-the-CM-4b42fd3a308947a7907442d176447de2

How Has This Been Tested?

  • Run using cerberus as a back end: npm run dev-server -- --env=backend=https://cerberus.staging.palaceproject.io
  • Select Cerberus Test Library 1, and click Lanes
  • In the sidebar, click the Edit button on an automatically generated lane (e.g. Fiction, Nonfiction, Young Adult Fiction, etc.)
    The lane editor should open. There should be an Edit Name button, a Hide/Show lane button, and a Save button. There should not be a Delete button. There should not be an Available Lists list, nor a Lists in This Lane list. If this is a sublane, there should not be an "Inherit restrictions from parent lane" checkbox.
  • Change the name of the list and save.
    The new list name should appear in the sidebar, and in the lane editor.
  • Navigate to the catalog, and browse to the lane. It should appear with the new name. (It sometimes takes a while for the change to appear on the catalog, which I assume is some kind of caching in the CM).

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@ray-lee ray-lee marked this pull request as ready for review February 10, 2023 02:27
@ray-lee ray-lee requested a review from a team February 10, 2023 02:27
Copy link
Contributor

@RishiDiwanTT RishiDiwanTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good and functions as described.
Two little feedback points

  • There is a flicker while the lanes load after a save under the loading bar, where the edit columns are seen and then disappear once the load is done, maybe default to have hidden edit columns that appear after the load?
  • The user has no information as to why they cannot edit these lanes, maybe have a little info panel detailing the special treatment for these lanes inside the RHS panel?

These are subjective feedback points, so I am approving it anyways, they can be implemented or left as is, they do not affect functionality.

Also add an explanation that lists can't be edited in automatically generated lanes.
@ray-lee
Copy link
Contributor Author

ray-lee commented Feb 13, 2023

@RishiDiwanTT, Those are good suggestions. I've added an explanation to the lane editor to say that the contents of automatically generated lanes can't be edited. I've also made it so that nothing is displayed in the list editor area while a lane is being loaded for editing, which should resolve the flicker.

Copy link
Contributor

@RishiDiwanTT RishiDiwanTT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@ray-lee ray-lee merged commit 75b99a5 into main Feb 14, 2023
@ray-lee ray-lee deleted the feature/rename-auto-lane branch February 14, 2023 14:39
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.

2 participants