Skip to content

Commit

Permalink
Remove '-item'-suffix from sidebar panels
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Nov 25, 2022
1 parent a934721 commit a4cc2fc
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 65 deletions.
10 changes: 5 additions & 5 deletions changelog/unreleased/enhancement-access-sidebar-via-url
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ For private or internal links it only requires the new `details` param in the UR

The following values can be used for the `details` param:

* `details-item` - sidebar open, no specific panel
* `actions-item` - actions panel
* `sharing-item` - share panel
* `versions-item` - versions panel
* `space-share-item` - members panel (project space only)
* `details` - sidebar open, no specific panel
* `actions` - actions panel
* `sharing` - share panel
* `versions` - versions panel
* `space-share` - members panel (project space only)

https://github.com/owncloud/web/pull/8021
https://github.com/owncloud/web/issues/7927
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,11 @@ export default defineComponent({
openSharingSidebar(file) {
let panelToOpen
if (file.type === 'space') {
panelToOpen = 'space-share-item'
panelToOpen = 'space-share'
} else if (file.share?.shareType === ShareTypes.link.value) {
panelToOpen = 'sharing-item#linkShares'
panelToOpen = 'sharing#linkShares'
} else {
panelToOpen = 'sharing-item#peopleShares'
panelToOpen = 'sharing#peopleShares'
}
eventBus.publish(SideBarEventTopics.openWithPanel, panelToOpen)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export default defineComponent({
return null
},
expandVersionsPanel() {
eventBus.publish(SideBarEventTopics.setActivePanel, 'versions-item')
eventBus.publish(SideBarEventTopics.setActivePanel, 'versions')
},
async loadData() {
const calls = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default defineComponent({
},
methods: {
expandSharesPanel() {
eventBus.publish(SideBarEventTopics.setActivePanel, 'space-share-item')
eventBus.publish(SideBarEventTopics.setActivePanel, 'space-share')
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default defineComponent({
const openSideBarSharePanel = () => {
store.commit('Files/SET_SELECTED_IDS', [])
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share-item')
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share')
}
return {
Expand Down
18 changes: 9 additions & 9 deletions packages/web-app-files/src/fileSideBars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const panelGenerators: (({
// We don't have file details in the trashbin, yet.
// Only allow `actions` panel on trashbin route for now.
({ rootFolder, highlightedFile }): Panel => ({
app: 'no-selection-item',
app: 'no-selection',
icon: 'questionnaire-line',
title: $gettext('Details'),
component: NoSelection,
Expand All @@ -51,7 +51,7 @@ const panelGenerators: (({
}
}),
({ router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'details-item',
app: 'details',
icon: 'questionnaire-line',
title: $gettext('Details'),
component: FileDetails,
Expand All @@ -66,7 +66,7 @@ const panelGenerators: (({
}
}),
({ multipleSelection, rootFolder, highlightedFile, router }) => ({
app: 'details-multiple-item',
app: 'details-multiple',
icon: 'questionnaire-line',
title: $gettext('Details'),
component: FileDetailsMultiple,
Expand All @@ -85,7 +85,7 @@ const panelGenerators: (({
}
}),
({ multipleSelection, highlightedFile }) => ({
app: 'details-space-item',
app: 'details-space',
icon: 'questionnaire-line',
title: $gettext('Details'),
component: SpaceDetails,
Expand All @@ -95,7 +95,7 @@ const panelGenerators: (({
}
}),
({ router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'actions-item',
app: 'actions',
icon: 'slideshow-3',
title: $gettext('Actions'),
component: FileActions,
Expand All @@ -105,7 +105,7 @@ const panelGenerators: (({
}
}),
({ multipleSelection, highlightedFile, user }) => ({
app: 'space-actions-item',
app: 'space-actions',
icon: 'slideshow-3',
title: $gettext('Actions'),
component: SpaceActions,
Expand All @@ -123,7 +123,7 @@ const panelGenerators: (({
}
}),
({ capabilities, router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'sharing-item',
app: 'sharing',
icon: 'user-add',
iconFillType: 'line',
title: $gettext('Shares'),
Expand Down Expand Up @@ -155,7 +155,7 @@ const panelGenerators: (({
}
}),
({ multipleSelection, highlightedFile, capabilities }) => ({
app: 'space-share-item',
app: 'space-share',
icon: 'group',
title: $gettext('Members'),
component: SharesPanel,
Expand All @@ -173,7 +173,7 @@ const panelGenerators: (({
}
}),
({ capabilities, highlightedFile, router, multipleSelection, rootFolder }) => ({
app: 'versions-item',
app: 'versions',
icon: 'git-branch',
title: $gettext('Versions'),
component: FileVersions,
Expand Down
4 changes: 2 additions & 2 deletions packages/web-app-files/src/helpers/statusIndicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const getIndicators = (resource, sharesTree, hasShareJail = false) => {
label: $gettext('Show invited people'),
visible: isUserShare(resource, sharesTree, hasShareJail),
icon: 'group',
target: 'sharing-item',
target: 'sharing',
type: isDirectUserShare(resource) ? 'user-direct' : 'user-indirect',
handler: (resource, panel) => {
eventBus.publish(SideBarEventTopics.openWithPanel, `${panel}#peopleShares`)
Expand All @@ -107,7 +107,7 @@ export const getIndicators = (resource, sharesTree, hasShareJail = false) => {
label: $gettext('Show links'),
visible: isLinkShare(resource, sharesTree),
icon: 'link',
target: 'sharing-item',
target: 'sharing',
type: isDirectLinkShare(resource) ? 'link-direct' : 'link-indirect',
handler: (resource, panel) => {
eventBus.publish(SideBarEventTopics.openWithPanel, `${panel}#linkShares`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
$gettext: this.$gettext
})

eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing-item#linkShares')
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing#linkShares')
}
}
}
4 changes: 2 additions & 2 deletions packages/web-app-files/src/mixins/actions/showActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export default {
$_showActions_trigger() {
// we don't have details in the trashbin, yet. the actions panel is the default
// panel at the moment, so we need to use `null` as panel name for trashbins.
// unconditionally return hardcoded `actions-item` once we have a dedicated
// unconditionally return hardcoded `actions` once we have a dedicated
// details panel in trashbins.
const panelName = isLocationTrashActive(this.$router, 'files-trash-generic')
? null
: 'actions-item'
: 'actions'
eventBus.publish(SideBarEventTopics.openWithPanel, panelName)
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/mixins/actions/showShares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {

$_showShares_trigger({ resources }) {
this.SET_FILE_SELECTION(resources)
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing-item#peopleShares')
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing#peopleShares')
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {

$_showMembers_trigger({ resources }) {
this.SET_FILE_SELECTION(resources)
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share-item')
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share')
}
}
}
6 changes: 3 additions & 3 deletions packages/web-app-files/src/quickActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
id: 'collaborators',
label: ($gettext) => $gettext('Add people'),
icon: 'user-add',
handler: () => eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing-item#peopleShares'),
handler: () => eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing#peopleShares'),
displayed: canShare
},
quicklink: {
Expand All @@ -67,12 +67,12 @@ export default {
if (passwordEnforced) {
return showQuickLinkPasswordModal(ctx, async (password) => {
await createQuicklink({ ...ctx, resource: ctx.item, password })
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing-item#linkShares')
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing#linkShares')
})
}

await createQuicklink({ ...ctx, resource: ctx.item })
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing-item#linkShares')
eventBus.publish(SideBarEventTopics.openWithPanel, 'sharing#linkShares')
},
displayed: canShare
}
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export default defineComponent({
openSidebarSharePanel(space: SpaceResource) {
this.SET_FILE_SELECTION([space])
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share-item')
eventBus.publish(SideBarEventTopics.openWithPanel, 'space-share')
},
getSpaceLinkProps(space: SpaceResource) {
Expand Down
4 changes: 2 additions & 2 deletions packages/web-app-files/tests/__fixtures__/fileActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ const editors = [

const sideBars = [
{
app: 'details-item',
app: 'details',
enabled: jest.fn(),
icon: 'information'
},
{
app: 'actions-item',
app: 'actions',
enabled: jest.fn(),
icon: 'information'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('useScrollTo', () => {
{
mocks: {
...defaultComponentMocks({
currentRoute: { query: { scrollTo: resourceId, details: 'details-item' } }
currentRoute: { query: { scrollTo: resourceId, details: 'details' } }
}),
$store: { commit: jest.fn() }
},
Expand Down
34 changes: 3 additions & 31 deletions tests/acceptance/pageObjects/FilesPageElement/appSideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,50 +251,22 @@ module.exports = {
'//div[contains(@id, "app-sidebar")]//div[contains(@class, "sidebar-panel__navigation")]/button',
locateStrategy: 'xpath'
},
collaboratorsPanel: {
selector:
'//*[@id="sidebar-panel-sharing-item"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
collaboratorsPanelMenuItem: {
selector: '//button[@id="sidebar-panel-sharing-item-select"]',
locateStrategy: 'xpath'
},
linksPanel: {
selector: '#oc-files-file-link'
},
linksPanelMenuItem: {
selector: '//button[@id="sidebar-panel-links-item-select"]',
locateStrategy: 'xpath'
},
actionsPanel: {
selector:
'//*[@id="sidebar-panel-actions-item"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
actionsPanelMenuItem: {
selector: '//button[@id="sidebar-panel-actions-item-select"]',
'//*[@id="sidebar-panel-actions"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
detailsPanel: {
selector:
'//*[@id="sidebar-panel-details-item"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
detailsPanelMenuItem: {
selector: '//button[@id="sidebar-panel-details-item-select"]',
'//*[@id="sidebar-panel-details"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
privateLinkURLCopyButton: {
selector: '.oc-files-private-link-copy-url'
},
versionsPanel: {
selector:
'//*[@id="sidebar-panel-versions-item"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
},
versionsPanelMenuItem: {
selector: '//button[@id="sidebar-panel-versions-item-select"]',
'//*[@id="sidebar-panel-versions"]//*[contains(@class, "sidebar-panel__body-content")]',
locateStrategy: 'xpath'
}
}
Expand Down

0 comments on commit a4cc2fc

Please sign in to comment.