diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2025-02-20 16:29:19 +0100 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2025-02-20 20:58:52 +0100 |
commit | df005a53f0a48fd83b3d2bc5fd0da0c7bf4947a7 (patch) | |
tree | e1a66ca57c27629b37ba1f908e09e2966c3043fe /apps/files_external | |
parent | 7c73c5c0586965317791ecfb51ac6769480cabd7 (diff) | |
download | nextcloud-server-df005a53f0a48fd83b3d2bc5fd0da0c7bf4947a7.tar.gz nextcloud-server-df005a53f0a48fd83b3d2bc5fd0da0c7bf4947a7.zip |
chore(files_external): add cypress tests for user credentials action
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/src/actions/enterCredentialsAction.ts | 13 | ||||
-rw-r--r-- | apps/files_external/src/views/CredentialsDialog.vue | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_external/src/actions/enterCredentialsAction.ts b/apps/files_external/src/actions/enterCredentialsAction.ts index 50698d1e83a..580f15ad876 100644 --- a/apps/files_external/src/actions/enterCredentialsAction.ts +++ b/apps/files_external/src/actions/enterCredentialsAction.ts @@ -59,8 +59,10 @@ async function setCredentials(node: Node, login: string, password: string): Prom return true } +export const ACTION_CREDENTIALS_EXTERNAL_STORAGE = 'credentials-external-storage' + export const action = new FileAction({ - id: 'credentials-external-storage', + id: ACTION_CREDENTIALS_EXTERNAL_STORAGE, displayName: () => t('files', 'Enter missing credentials'), iconSvgInline: () => LoginSvg, @@ -93,7 +95,14 @@ export const action = new FileAction({ )) if (login && password) { - return await setCredentials(node, login, password) + try { + await setCredentials(node, login, password) + showSuccess(t('files_external', 'Credentials successfully set')) + } catch (error) { + showError(t('files_external', 'Error while setting credentials: {error}', { + error: (error as Error).message, + })) + } } return null diff --git a/apps/files_external/src/views/CredentialsDialog.vue b/apps/files_external/src/views/CredentialsDialog.vue index 86ff533f4b3..1d506628f6d 100644 --- a/apps/files_external/src/views/CredentialsDialog.vue +++ b/apps/files_external/src/views/CredentialsDialog.vue @@ -76,7 +76,7 @@ export default defineComponent({ computed: { dialogButtons() { return [{ - label: t('files_external', 'Submit'), + label: t('files_external', 'Confirm'), type: 'primary', nativeType: 'submit', }] |