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

[full-ci] move sidebar state into views #7559

Merged
merged 6 commits into from
Sep 2, 2022

Conversation

kulmann
Copy link
Member

@kulmann kulmann commented Aug 31, 2022

Description

This PR gets rid of the sidebar vuex module in the files app, in favour of a composable, which has been added to the useResourcesViewDefaults composable as well. This clears up some "magic state" of the sidebar component by wiring the sidebar state management into views, which then pass down the sideBarOpen and sideBarActivePanel refs to whichever child component needs them.

Motivation and Context

Works towards a clear hierarchy in views.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs
Copy link

update-docs bot commented Aug 31, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@@ -37,9 +37,9 @@ export default {
},
inject: ['displayedItem'],
props: {
isContentDisplayed: {
Copy link
Member Author

Choose a reason for hiding this comment

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

prop was unused

@kulmann kulmann force-pushed the move-sidebar-state-into-views branch from e7254d6 to 7820836 Compare August 31, 2022 11:29
}
},
setup() {
const { fileListHeaderY, selectedResourcesIds, selectedResources } = useResourcesViewDefaults<
Copy link
Member Author

Choose a reason for hiding this comment

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

decided to remove the useResourcesViewDefaults composable here, because that one now subscribes to some event bus topics - it should only be used in a view (once per view). Additionally I moved the variables and methods related to selected resources into its own composable (which is then spreaded into the useResourcesViewDefaults composable) so that we can continue to use that here. Remaining composable refs sideBarOpen (new) and fileListHeaderY (existing) have been moved to props and need to be passed down by the shared with me view.

:available-panels="availablePanels"
:sidebar-accordions-warning-message="sidebarAccordionsWarningMessage"
:warning-message="warningMessage"
Copy link
Member Author

Choose a reason for hiding this comment

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

felt that this needs renaming ;-)

ref="sidebar"
class="files-side-bar"
tabindex="-1"
:sidebar-active-panel="sidebarActivePanel"
:open="open"
:active-panel="activePanel"
Copy link
Member Author

Choose a reason for hiding this comment

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

namespacing the props of the sidebar component seemed unnecessary - renamed.

@kulmann kulmann force-pushed the move-sidebar-state-into-views branch from 7820836 to 417ac3d Compare August 31, 2022 11:37
@@ -72,27 +77,6 @@ export const useResourcesViewDefaults = <T, TT, TU extends any[]>(
fileList.accentuateItem(payload.id)
})

const selectedResources: WritableComputedRef<Resource[]> = computed({
Copy link
Member Author

Choose a reason for hiding this comment

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

moved into new composable useSelectedResources

// return hardcoded `actions-item` in all cases once we have them.
await this.openSidebarWithPanel(
$_showActions_trigger() {
// we don't have details in the trashbin, yet. the actions panel is the default
Copy link
Member Author

Choose a reason for hiding this comment

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

added some more context to the explanation (unrelated to this PR otherwise)

@ownclouders
Copy link
Contributor

ownclouders commented Aug 31, 2022

Results for oCISSharingPublic2 https://drone.owncloud.com/owncloud/web/27963/69/1

💥 The acceptance tests failed on retry. Please find the screenshots inside ...

webUISharingPublicManagement-shareByPublicLink_feature-L89.png

webUISharingPublicManagement-shareByPublicLink_feature-L89.png

@kulmann kulmann force-pushed the move-sidebar-state-into-views branch from 417ac3d to 7f2fbe9 Compare August 31, 2022 13:03
@kulmann kulmann marked this pull request as ready for review September 1, 2022 07:19
Copy link
Collaborator

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

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

LGTM. Sidebar still behaves as it should as far as I can see.

@kulmann kulmann changed the title move sidebar state into views [full-ci] move sidebar state into views Sep 1, 2022
@kulmann kulmann force-pushed the move-sidebar-state-into-views branch from 9c106b3 to bbb87c1 Compare September 1, 2022 07:59
Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

LGTM!

@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

72.3% 72.3% Coverage
0.2% 0.2% Duplication

@kulmann kulmann merged commit 26c5c29 into master Sep 2, 2022
@delete-merged-branch delete-merged-branch bot deleted the move-sidebar-state-into-views branch September 2, 2022 11:02
@micbar micbar mentioned this pull request Sep 12, 2022
29 tasks
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