-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement file locking information (#9566)
* Implement file locking information * Implement lock in files-table (ugly) * Implement lock owner in buildResource * Display lock owner * remove lock column * Add changelog * Add tooltip to reflect status * Add aria label * Disable move, delete, rename for locked files * Address PR issues, add lock file * Remove lockowner from details (for now) * Fix misreplaced code * Now i found the right code to remove * Add unittests * remove unused prop in test * Fix acceptance tests
- Loading branch information
1 parent
1d581c8
commit 083a0ec
Showing
16 changed files
with
168 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Enhancement: Display locking information | ||
|
||
We've added indicators and information in case a file is locked. | ||
|
||
https://github.com/owncloud/web/pull/9566 | ||
https://github.com/owncloud/web/issues/6682 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
packages/web-app-files/tests/unit/composables/actions/files/useFileActionsMove.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { mock, mockDeep } from 'jest-mock-extended' | ||
import { unref } from 'vue' | ||
import { useFileActionsMove } from 'web-app-files/src/composables' | ||
import { Resource, SpaceResource } from 'web-client/src' | ||
import { useStore } from 'web-pkg/src/composables' | ||
import { | ||
RouteLocation, | ||
createStore, | ||
defaultComponentMocks, | ||
defaultStoreMockOptions, | ||
getComposableWrapper | ||
} from 'web-test-helpers/src' | ||
|
||
describe('move', () => { | ||
describe('computed property "actions"', () => { | ||
describe('move isEnabled property of returned element', () => { | ||
it.each([ | ||
{ | ||
resources: [{ isReceivedShare: () => true, canBeDeleted: () => true }] as Resource[], | ||
expectedStatus: true | ||
}, | ||
{ | ||
resources: [ | ||
{ isReceivedShare: () => true, canBeDeleted: () => true, locked: true } | ||
] as Resource[], | ||
expectedStatus: false | ||
} | ||
])('should be set correctly', (inputData) => { | ||
const { wrapper } = getWrapper({ | ||
setup: () => { | ||
const store = useStore() | ||
const { actions } = useFileActionsMove({ store }) | ||
|
||
const resources = inputData.resources | ||
expect(unref(actions)[0].isEnabled({ space: null, resources })).toBe( | ||
inputData.expectedStatus | ||
) | ||
} | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
function getWrapper({ | ||
setup | ||
}: { | ||
setup: ( | ||
instance: ReturnType<typeof useFileActionsMove>, | ||
{ | ||
storeOptions | ||
}: { | ||
storeOptions: typeof defaultStoreMockOptions | ||
} | ||
) => void | ||
}) { | ||
const routeName = 'files-spaces-generic' | ||
const mocks = { | ||
...defaultComponentMocks({ currentRoute: mock<RouteLocation>({ name: routeName }) }), | ||
space: mockDeep<SpaceResource>({ | ||
webDavPath: 'irrelevant' | ||
}) | ||
} | ||
|
||
const storeOptions = { | ||
...defaultStoreMockOptions | ||
} | ||
storeOptions.modules.Files.getters.currentFolder.mockImplementation(() => mocks.space) | ||
const store = createStore(storeOptions) | ||
return { | ||
mocks, | ||
storeOptions, | ||
wrapper: getComposableWrapper( | ||
() => { | ||
const store = useStore() | ||
const instance = useFileActionsMove({ store }) | ||
setup(instance, { storeOptions }) | ||
}, | ||
{ | ||
mocks, | ||
provide: mocks, | ||
store | ||
} | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters