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

Integrate file editors application menu #9809

Merged
merged 48 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
79ff4e0
Integrate file editors in application menu, WIP texteditor
lookacat Oct 16, 2023
c2d9468
Text editor now working
lookacat Oct 16, 2023
d3a3506
Make apps work in general
lookacat Oct 16, 2023
ebba683
Fix unittests
lookacat Oct 16, 2023
9d59467
Add e2e test
AlexAndBear Oct 16, 2023
3087003
Add e2e test
AlexAndBear Oct 16, 2023
7e5d001
Implement temp files
lookacat Oct 16, 2023
0d0641e
Fix local storage not updating
lookacat Oct 17, 2023
4364b09
clean code a bit
lookacat Oct 17, 2023
1933b92
Remove deleting empty file
lookacat Oct 17, 2023
b8ce200
Implement useFolderLink composable
lookacat Oct 17, 2023
28f1ad9
Lint
AlexAndBear Oct 17, 2023
eeec37e
Add priority ordering to app menu items
AlexAndBear Oct 17, 2023
6a6c6a9
Adjust colors
AlexAndBear Oct 17, 2023
a940746
WIP
lookacat Oct 18, 2023
f196dc7
Set destination for new file
AlexAndBear Oct 18, 2023
d59dd8d
add writable check
AlexAndBear Oct 18, 2023
c5d4520
remove unneccersary double check
AlexAndBear Oct 18, 2023
6a3665c
Fix permission error for app menu entries
AlexAndBear Oct 18, 2023
7dc7924
Git says modiefied.. I have no clue, but ill push it anyway
AlexAndBear Oct 18, 2023
5f5a89d
Add shareId on openEditor
lookacat Oct 18, 2023
a75ddc5
Fix unittests
lookacat Oct 18, 2023
663f26d
make use of useFolerLink in ResourceTable
AlexAndBear Oct 19, 2023
c77cf2e
Rm console.log
AlexAndBear Oct 19, 2023
5def28e
Fix class
AlexAndBear Oct 19, 2023
386a5db
Fix AppTopBar unittest
lookacat Oct 19, 2023
00a1e2d
Remove old unittests
lookacat Oct 19, 2023
7b9fff1
WIP add useFolderLink unittests
lookacat Oct 19, 2023
f9f85d2
Fix tests
AlexAndBear Oct 19, 2023
8f49c36
Add more tests
AlexAndBear Oct 19, 2023
926846b
Refactor
AlexAndBear Oct 19, 2023
9109fcf
Rm unused code
AlexAndBear Oct 19, 2023
9097560
Rm unused code
AlexAndBear Oct 19, 2023
842f3cf
Dont autoformat code that we don't touch
AlexAndBear Oct 19, 2023
1d53a12
Dont destruct clientService and make use of appInfo type
AlexAndBear Oct 20, 2023
1c4ab82
Make set_current_folder more bullet proof
AlexAndBear Oct 20, 2023
1c3ff73
Fix open preview app run into errors
AlexAndBear Oct 20, 2023
aa59e58
Fix wrong path displayed in AppTopBar
AlexAndBear Oct 20, 2023
77c7585
Fix trashbin bug
lookacat Oct 20, 2023
00d4761
Lint
AlexAndBear Oct 20, 2023
843faf8
Fix types
AlexAndBear Oct 20, 2023
acd50e1
Lint
AlexAndBear Oct 20, 2023
53300d2
Update snapshots
AlexAndBear Oct 20, 2023
6daa77e
rm unnecessary type
AlexAndBear Oct 23, 2023
7409fe7
Lint
AlexAndBear Oct 23, 2023
a14cdea
Fix acceptance tests
AlexAndBear Oct 23, 2023
2e78207
Dont show parent folder in apptopbar if resource is public shared
AlexAndBear Oct 23, 2023
992a9d8
Fix general resource path
AlexAndBear Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more tests
  • Loading branch information
AlexAndBear committed Oct 23, 2023
commit 8f49c36199cc672a897a855decd2308e5d2ed362
1 change: 0 additions & 1 deletion packages/web-pkg/src/helpers/router/routeOptions.ts
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ export const createFileRouteOptions = (
options?: { configurationManager?: ConfigurationManager }
): { params: RouteParams; query: LocationQuery } => {
const config = options?.configurationManager || configurationManager
console.log(1337, options?.configurationManager)
return {
params: {
driveAliasAndItem: space.getDriveAliasAndItem({ path: target.path || '' } as Resource)
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { mock } from 'jest-mock-extended'
import {
RouteLocation,
createStore,
defaultComponentMocks,
defaultStoreMockOptions,
getComposableWrapper
} from 'web-test-helpers'
import { useFolderLink } from '../../../../src/composables'
import { ConfigurationManager, configurationManager } from '../../../../src/configuration'
import { ConfigurationManager } from '../../../../src/configuration'

jest.mock('../../../../src/configuration', () => {
return {
@@ -60,7 +59,7 @@ describe('useFolderLink', () => {
expect(folderLink).toEqual({
name: 'files-spaces-generic',
params: { driveAliasAndItem: 'personal/admin' },
query: {fileId: '2'}
query: { fileId: '2' }
})
})

@@ -69,7 +68,7 @@ describe('useFolderLink', () => {
path: '/my-folder',
id: '2',
fileId: '2',
storageId: '2',
storageId: '1',
parentFolderId: '1'
}

@@ -81,55 +80,85 @@ describe('useFolderLink', () => {
query: { fileId: '1' }
})
})
/*
it('getParentFolderName should return the correct parent folder name', () => {
const resource = {
path: '/my-folder',
shareId: 456
// ... other properties as needed
}

const { result } = renderHook(() => useFolderLink())
describe('getParentFolderName should return the correct parent folder name', () => {
it('should equal "Personal" if share jail is enabled', () => {
const resource = {
path: '/my-folder',
storageId: '1'
}

const wrapper = createWrapper()
const parentFolderName = wrapper.vm.getParentFolderName(resource)
expect(parentFolderName).toEqual('Personal')
})
it('should equal "All files and folders" if share jail disabled', () => {
const resource = {
path: '/my-folder',
storageId: '1'
}

const parentFolderName = result.current.getParentFolderName(resource)
expect(parentFolderName).toBe('Shared with me')
})
const wrapper = createWrapper({ hasShareJail: false })
const parentFolderName = wrapper.vm.getParentFolderName(resource)
expect(parentFolderName).toEqual('All files and folders')
})
it('should equal the space name if resource storage is representing a project space', () => {
const resource = {
path: '/my-folder',
storageId: '2'
}

it('getParentFolderLinkIconAdditionalAttributes should return the correct icon attributes', () => {
// Similar setup as the previous tests
const resource = {
path: '/my-folder'
// ... other properties as needed
}
const wrapper = createWrapper()
const parentFolderName = wrapper.vm.getParentFolderName(resource)
expect(parentFolderName).toEqual('New space')
})
it('should equal the "Shared with me" if resource is representing the root share', () => {
const resource = {
path: '/My share',
shareRoot: '/My share',
shareId: '1',
isShareRoot: () => true
}

const { result } = renderHook(() => useFolderLink())
const wrapper = createWrapper()
const parentFolderName = wrapper.vm.getParentFolderName(resource)
expect(parentFolderName).toEqual('Shared with me')
})
it('should equal the share name if resource is representing a file or folder in the root of a share', () => {
const resource = {
path: '/My share/test.txt',
shareRoot: '/My share',
shareId: '1'
}

const iconAttributes = result.current.getParentFolderLinkIconAdditionalAttributes(resource)
expect(iconAttributes).toEqual({
name: 'layout-grid',
'fill-type': 'fill'
})
})*/
const wrapper = createWrapper()
const parentFolderName = wrapper.vm.getParentFolderName(resource)
expect(parentFolderName).toEqual('My share')
})
})
})

const createWrapper = () => {
const createWrapper = ({ hasShareJail = true }: { hasShareJail?: boolean } = {}) => {
const storeOptions = { ...defaultStoreMockOptions }
storeOptions.getters.capabilities.mockImplementation(() => ({
spaces: { projects: true, share_jail: hasShareJail }
}))
storeOptions.modules.runtime.modules.spaces.getters.spaces = jest.fn(() => [
{
id: '1',
fileId: '1',
driveType: 'personal',
getDriveAliasAndItem: () => 'personal/admin'
},
{
id: '2',
driveType: 'project',
name: 'New space',
getDriveAliasAndItem: jest.fn()
}
])
const store = createStore(storeOptions)
const mocks = defaultComponentMocks({
/*currentRoute: mock<RouteLocation>({
name: 'files-spaces-generic',
path: '/',
query: { fileId: undefined }
})*/
})
const mocks = defaultComponentMocks({})
return getComposableWrapper(
() => {
const {