Add project_name_editable attribute to web component#1009
Conversation
This property is only being used to decide whether to make the project name editable in the `ProjectName` component inside the `ProjectBar` component. Renaming it like this makes it more intention-revealing and thus makes the code easier to understand.
* Invert the relevant conditions in `ProjectName`. * Invert the relevant default property values. * Invert the property value set in `WebComponentProject` and in the unit test for `ProjectName`.
I think this makes the code more readable.
This state tracks whether the user is in the process of editing the project name or not and so I think the new name better reflects it's purpose. My actual motivation is that I want to more clearly distinguish `isEditable` & `setEditable` from the `projectNameEditable` property which I'm planning to rename to just `editable` in a subsequent commit.
This will allow us to make the project name editable in editor-standalone while leaving other projects using the web component and the integrated version in editor-ui unchanged.
|
project_name_editable attribute to web component
loiswells97
left a comment
There was a problem hiding this comment.
This looks great overall. My only comment is that the variable name for the boolean that determines whether the name is editable changes throughout (projectNameEditable -> nameEditable -> editable). Maybe this is intentional though?
Yes, it was intentional - I felt as if the context is different in each case - see Remove redundant prefixes from projectNameEditable, e.g. it doesn't make much sense to me to use a property called |
Okay, fair enough, I think that makes sense 👍 Let's leave it as it is in that case |
loiswells97
left a comment
There was a problem hiding this comment.
Looks great, let's get this out there! 👍
### Added - Add `project_name_editable` attribute to web component (#1009) - Fires custom event when the theme changes (#1015) - Add `output_only` attribute to web component (#1019 & originally #782) - Add `assets_identifier` attribute to web component (#1019 & originally #901) - Enhance `code` attribute on web component to override project main component content (#1019 & originally #901) - Add `runCode`, `stopCode` & `rerunCode` methods to web component (#1019 & originally #899) - Send error details in "editor-runCompleted" event (#1019 & originally #915) - Return error details to web component (#1019 & originally #915) - Add `output_panels` attribute to web component (#1019 & originally #909) ### Changed - Remove unused `/embedded/projects/:identifier` route (#1013) ### Fixed - Remove unused `REACT_APP_LOGIN_ENABLED` env var (#1006) - Fix infinite remix loop when `BYPASS_AUTH` set in `editor-api` (#1007) - Fixes for docker-compose.yml (#1008) - Fix deprecation warnings in GitHub Actions (#1011) - Removed unused `isEmbedded` param from `useProject` call in `EmbeddedViewer` (#1016) - Improvements to Cypress specs in CI (#1017) - Fix warnings and verbose output when starting Webpack Dev Server (#1018) - Add e2e spec for project remix behaviour in web component (#1020) - Fix initial value of `user` in `WebComponentLoader` (#1021) - Make `authKey` in e2e web component spec more realistic (#1022) - Remove unused `ComponentStore` (#1023)
Addresses #986 which is part of RaspberryPiFoundation/editor-standalone#16.
This will allow us to make the project name editable in
editor-standalone(see RaspberryPiFoundation/editor-standalone#125) while leaving other projects using the web component (e.g.projects-ui) and the integrated version ineditor-uiunchanged.Note that this new attribute only affects the
ProjectNamecomponent in theProjectBarand not the one in the sidebar, i.e. inProjectsPanel.