Skip to content

Commit 7e20e30

Browse files
authored
Merge pull request #57129 from nextcloud/backport/55726/stable32
[stable32] chore: Update `@nextcloud/dialogs` to v7.0.0
2 parents 2b68534 + 9e4b966 commit 7e20e30

File tree

337 files changed

+20958
-2402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+20958
-2402
lines changed

.github/workflows/cypress.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ jobs:
102102
matrix:
103103
# Run multiple copies of the current job in parallel
104104
# Please increase the number or runners as your tests suite grows (0 based index for e2e tests)
105-
containers: ['component', 'setup', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
106-
# Hack as strategy.job-total includes the component and GitHub does not allow math expressions
105+
containers: ['setup', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
106+
# Hack as strategy.job-total includes the "setup" and GitHub does not allow math expressions
107107
# Always align this number with the total of e2e runners (max. index + 1)
108108
total-containers: [10]
109109

__tests__/setup-global.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: CC0-1.0
44
*/
5+
56
export function setup() {
67
process.env.TZ = 'UTC'
78
}

__tests__/setup-testing-library.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
33
* SPDX-License-Identifier: CC0-1.0
44
*/
5+
56
import '@testing-library/jest-dom/vitest'
67
import 'core-js/stable/index.js'

apps/federatedfilesharing/src/components/AdminSettings.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@
6565
</template>
6666

6767
<script>
68+
import axios from '@nextcloud/axios'
69+
import { DialogBuilder, showError } from '@nextcloud/dialogs'
6870
import { loadState } from '@nextcloud/initial-state'
69-
import { DialogBuilder, DialogSeverity, showError } from '@nextcloud/dialogs'
7071
import { generateOcsUrl } from '@nextcloud/router'
7172
import { confirmPassword } from '@nextcloud/password-confirmation'
72-
import axios from '@nextcloud/axios'
7373
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
7474
import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection'
7575
@@ -114,10 +114,8 @@ export default {
114114
115115
const dialog = new DialogBuilder(t('federatedfilesharing', 'Confirm data upload to lookup server'))
116116
await dialog
117-
.setSeverity(DialogSeverity.Warning)
118-
.setText(
119-
t('federatedfilesharing', 'When enabled, all account properties (e.g. email address) with scope visibility set to "published", will be automatically synced and transmitted to an external system and made available in a public, global address book.'),
120-
)
117+
.setSeverity('warning')
118+
.setText(t('federatedfilesharing', 'When enabled, all account properties (e.g. email address) with scope visibility set to "published", will be automatically synced and transmitted to an external system and made available in a public, global address book.'))
121119
.addButton({
122120
callback: () => this.setLookupServerUploadEnabled(false),
123121
label: t('federatedfilesharing', 'Disable upload'),
@@ -147,9 +145,8 @@ export default {
147145
148146
const dialog = new DialogBuilder(t('federatedfilesharing', 'Confirm querying lookup server'))
149147
await dialog
150-
.setSeverity(DialogSeverity.Warning)
151-
.setText(
152-
t('federatedfilesharing', 'When enabled, the search input when creating shares will be sent to an external system that provides a public and global address book.')
148+
.setSeverity('warning')
149+
.setText(t('federatedfilesharing', 'When enabled, the search input when creating shares will be sent to an external system that provides a public and global address book.')
153150
+ t('federatedfilesharing', 'This is used to retrieve the federated cloud ID to make federated sharing easier.')
154151
+ t('federatedfilesharing', 'Moreover, email addresses of users might be sent to that system in order to verify them.'),
155152
)

apps/federatedfilesharing/src/components/RemoteShareDialog.cy.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { cleanup, fireEvent, render } from '@testing-library/vue'
7+
import { beforeEach, describe, expect, it, vi } from 'vitest'
8+
import RemoteShareDialog from './RemoteShareDialog.vue'
9+
10+
describe('RemoteShareDialog', () => {
11+
beforeEach(cleanup)
12+
13+
it('can be mounted', async () => {
14+
const component = render(RemoteShareDialog, {
15+
props: {
16+
owner: 'user123',
17+
name: 'my-photos',
18+
remote: 'nextcloud.local',
19+
passwordRequired: false,
20+
},
21+
})
22+
23+
await expect(component.findByRole('dialog', { name: 'Remote share' })).resolves.not.toThrow()
24+
expect(component.getByRole('dialog').innerText).toContain(/my-photos from user123@nextcloud.local/)
25+
await expect(component.findByRole('button', { name: 'Cancel' })).resolves.not.toThrow()
26+
await expect(component.findByRole('button', { name: /Add remote share/ })).resolves.not.toThrow()
27+
})
28+
29+
it('does not show password input if not enabled', async () => {
30+
const component = render(RemoteShareDialog, {
31+
props: {
32+
owner: 'user123',
33+
name: 'my-photos',
34+
remote: 'nextcloud.local',
35+
passwordRequired: false,
36+
},
37+
})
38+
39+
await expect(component.findByLabelText('Remote share password')).rejects.toThrow()
40+
})
41+
42+
it('emits true when accepted', () => {
43+
const onClose = vi.fn()
44+
45+
const component = render(RemoteShareDialog, {
46+
listeners: {
47+
close: onClose,
48+
},
49+
props: {
50+
owner: 'user123',
51+
name: 'my-photos',
52+
remote: 'nextcloud.local',
53+
passwordRequired: false,
54+
},
55+
})
56+
57+
component.getByRole('button', { name: 'Cancel' }).click()
58+
expect(onClose).toHaveBeenCalledWith(false)
59+
})
60+
61+
it('show password input if needed', async () => {
62+
const component = render(RemoteShareDialog, {
63+
props: {
64+
owner: 'admin',
65+
name: 'secret-data',
66+
remote: 'nextcloud.local',
67+
passwordRequired: true,
68+
},
69+
})
70+
71+
await expect(component.findByLabelText('Remote share password')).resolves.not.toThrow()
72+
})
73+
74+
it('emits the submitted password', async () => {
75+
const onClose = vi.fn()
76+
77+
const component = render(RemoteShareDialog, {
78+
listeners: {
79+
close: onClose,
80+
},
81+
props: {
82+
owner: 'admin',
83+
name: 'secret-data',
84+
remote: 'nextcloud.local',
85+
passwordRequired: true,
86+
},
87+
})
88+
89+
const input = component.getByLabelText('Remote share password')
90+
await fireEvent.update(input, 'my password')
91+
component.getByRole('button', { name: 'Add remote share' }).click()
92+
expect(onClose).toHaveBeenCalledWith(true, 'my password')
93+
})
94+
95+
it('emits no password if cancelled', async () => {
96+
const onClose = vi.fn()
97+
98+
const component = render(RemoteShareDialog, {
99+
listeners: {
100+
close: onClose,
101+
},
102+
props: {
103+
owner: 'admin',
104+
name: 'secret-data',
105+
remote: 'nextcloud.local',
106+
passwordRequired: true,
107+
},
108+
})
109+
110+
const input = component.getByLabelText('Remote share password')
111+
await fireEvent.update(input, 'my password')
112+
component.getByRole('button', { name: 'Cancel' }).click()
113+
expect(onClose).toHaveBeenCalledWith(false)
114+
})
115+
})

apps/federatedfilesharing/src/components/RemoteShareDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const buttons = computed(() => [
3535
},
3636
{
3737
label: t('federatedfilesharing', 'Add remote share'),
38-
nativeType: props.passwordRequired ? 'submit' : undefined,
39-
type: 'primary',
38+
type: props.passwordRequired ? 'submit' : undefined,
39+
variant: 'primary',
4040
callback: () => emit('close', true, password.value),
4141
},
4242
])

apps/federatedfilesharing/src/services/dialogService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import { spawnDialog } from '@nextcloud/dialogs'
6+
import { spawnDialog } from '@nextcloud/vue/functions/dialog'
77
import RemoteShareDialog from '../components/RemoteShareDialog.vue'
88

99
/**

apps/files/src/composables/useFileListWidth.cy.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)