Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ addPasswordConfirmationInterceptors(axios)
async function setCredentials(node: INode, login: string, password: string): Promise<null | true> {
const configResponse = await axios.request({
method: 'PUT',
url: generateUrl('apps/files_external/userglobalstorages/{id}', { id: node.attributes.id }),
url: generateUrl('apps/files_external/userglobalstorages/{id}', { id: node.id }),
confirmPassword: PwdConfirmationMode.Strict,
data: {
backendOptions: { user: login, password },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const action: IFileAction = {

let config: IStorage | undefined
try {
const { data } = await getStatus(node.attributes.id, node.attributes.scope === 'system')
const { data } = await getStatus(node.id, node.attributes.scope === 'system')
config = data
node.attributes.config = config
emit('files:node:updated', node)
Expand Down
15 changes: 5 additions & 10 deletions apps/files_sharing/src/files_actions/acceptShareAction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ describe('Accept share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file = new File({
id: 1,
id: 123,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand All @@ -176,13 +175,12 @@ describe('Accept share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file = new File({
id: 1,
id: 123,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
remote: 3,
share_type: ShareType.User,
},
Expand All @@ -209,26 +207,24 @@ describe('Accept share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file1 = new File({
id: 1,
id: 123,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foo.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
})

const file2 = new File({
id: 2,
id: 456,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/bar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 456,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down Expand Up @@ -257,13 +253,12 @@ describe('Accept share action execute tests', () => {
})

const file = new File({
id: 1,
id: 123,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const action: IFileAction = {
const isRemote = !!node.attributes.remote
const url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {
shareBase: isRemote ? 'remote_shares' : 'shares',
id: node.attributes.id,
id: node.id,
})
await axios.post(url)

Expand Down
15 changes: 5 additions & 10 deletions apps/files_sharing/src/files_actions/rejectShareAction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,12 @@ describe('Reject share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand All @@ -220,13 +219,12 @@ describe('Reject share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
remote: 3,
share_type: ShareType.User,
},
Expand All @@ -253,26 +251,24 @@ describe('Reject share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file1 = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foo.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
})

const file2 = new File({
id: 2,
id: '456',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/bar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 456,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down Expand Up @@ -301,13 +297,12 @@ describe('Reject share action execute tests', () => {
})

const file = new File({
id: 1,
id: 123,
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const action: IFileAction = {
const node = nodes[0]
const isRemote = !!node.attributes.remote
const shareBase = isRemote ? 'remote_shares' : 'shares'
const id = node.attributes.id
const id = node.id
let url: string
if (node.attributes.accepted === 0) {
url = generateOcsUrl('apps/files_sharing/api/v1/{shareBase}/pending/{id}', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ describe('Restore share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand All @@ -177,26 +176,24 @@ describe('Restore share action execute tests', () => {
vi.spyOn(eventBus, 'emit')

const file1 = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foo.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
})

const file2 = new File({
id: 2,
id: '456',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/bar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 456,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down Expand Up @@ -224,13 +221,12 @@ describe('Restore share action execute tests', () => {
.mockImplementation(() => { throw new Error('Mock error') })

const file = new File({
id: 1,
id: '123',
source: 'https://cloud.domain.com/remote.php/dav/files/admin/foobar.txt',
owner: 'admin',
mime: 'text/plain',
permissions: Permission.READ,
attributes: {
id: 123,
share_type: ShareType.User,
},
root: '/files/admin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const action: IFileAction = {
try {
const node = nodes[0]
const url = generateOcsUrl('apps/files_sharing/api/v1/deletedshares/{id}', {
id: node.attributes.id,
id: node.id,
})
await axios.post(url)

Expand Down
Loading
Loading