@xwiki/cristal-authentication-nextcloud-ui 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/NextcloudLoginMenu-CuRSwx4-.js +121 -0
- package/dist/NextcloudLoginMenu-CuRSwx4-.js.map +1 -0
- package/dist/index.es.js +2 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -22
- package/dist/index.umd.js.map +1 -1
- package/dist/translations.d.ts +23 -0
- package/langs/translation-en.json +3 -1
- package/langs/translation-fr.json +3 -1
- package/package.json +15 -14
- package/src/NextcloudLoginMenuUIExtension.ts +1 -1
- package/src/index.ts +1 -1
- package/src/translations.ts +1 -1
- package/src/vue/NextcloudLoginMenu.vue +51 -16
- package/vite.config.ts +1 -1
- package/vitest.config.ts +1 -1
- package/dist/NextcloudLoginMenu-3GsKsr0I.js +0 -1286
- package/dist/NextcloudLoginMenu-3GsKsr0I.js.map +0 -1
package/dist/translations.d.ts
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* See the LICENSE file distributed with this work for additional
|
|
3
|
+
* information regarding copyright ownership.
|
|
4
|
+
*
|
|
5
|
+
* This is free software; you can redistribute it and/or modify it
|
|
6
|
+
* under the terms of the GNU Lesser General Public License as
|
|
7
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
8
|
+
* the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This software is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
+
* Lesser General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
16
|
+
* License along with this software; if not, write to the Free
|
|
17
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
18
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
19
|
+
*/
|
|
1
20
|
declare const translations: {
|
|
2
21
|
en: {
|
|
3
22
|
"authentication.nextcloud.modal.title": string;
|
|
@@ -6,6 +25,8 @@ declare const translations: {
|
|
|
6
25
|
"authentication.nextcloud.modal.password.label": string;
|
|
7
26
|
"authentication.nextcloud.modal.password.help": string;
|
|
8
27
|
"authentication.nextcloud.modal.submit.label": string;
|
|
28
|
+
"authentication.nextcloud.modal.error.invalid": string;
|
|
29
|
+
"authentication.nextcloud.modal.error.generic": string;
|
|
9
30
|
};
|
|
10
31
|
fr: {
|
|
11
32
|
"authentication.nextcloud.modal.title": string;
|
|
@@ -14,6 +35,8 @@ declare const translations: {
|
|
|
14
35
|
"authentication.nextcloud.modal.password.label": string;
|
|
15
36
|
"authentication.nextcloud.modal.password.help": string;
|
|
16
37
|
"authentication.nextcloud.modal.submit.label": string;
|
|
38
|
+
"authentication.nextcloud.modal.error.invalid": string;
|
|
39
|
+
"authentication.nextcloud.modal.error.generic": string;
|
|
17
40
|
};
|
|
18
41
|
};
|
|
19
42
|
export default translations;
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
"authentication.nextcloud.modal.username.help": "Enter your username.",
|
|
5
5
|
"authentication.nextcloud.modal.password.label": "Password",
|
|
6
6
|
"authentication.nextcloud.modal.password.help": "It is not recommended to enter your own personal password, you should enter a specific application password instead.",
|
|
7
|
-
"authentication.nextcloud.modal.submit.label": "Log-in"
|
|
7
|
+
"authentication.nextcloud.modal.submit.label": "Log-in",
|
|
8
|
+
"authentication.nextcloud.modal.error.invalid": "Invalid username or password.",
|
|
9
|
+
"authentication.nextcloud.modal.error.generic": "Login check failed. Response status: {status}."
|
|
8
10
|
}
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
"authentication.nextcloud.modal.username.help": "Saisissez votre nom d'utilisateur.",
|
|
5
5
|
"authentication.nextcloud.modal.password.label": "Mot de passe",
|
|
6
6
|
"authentication.nextcloud.modal.password.help": "Il n'est pas recommandé de saisir votre mot de passe personnel, vous devriez saisir un mot de passe d'application à la place.",
|
|
7
|
-
"authentication.nextcloud.modal.submit.label": "Se connecter"
|
|
7
|
+
"authentication.nextcloud.modal.submit.label": "Se connecter",
|
|
8
|
+
"authentication.nextcloud.modal.error.invalid": "Nom d'utilisateur ou mot de passe invalide.",
|
|
9
|
+
"authentication.nextcloud.modal.error.generic": "Échec de la vérification de connexion. Status de la réponse: {status}."
|
|
8
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-authentication-nextcloud-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -27,28 +27,29 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "./dist/index.es.js",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"@xwiki/cristal-authentication-
|
|
33
|
-
"@xwiki/cristal-api": "0.
|
|
34
|
-
"@xwiki/cristal-authentication-
|
|
35
|
-
"@xwiki/cristal-uiextension-api": "0.20.0"
|
|
30
|
+
"vue-i18n": "11.1.11",
|
|
31
|
+
"@xwiki/cristal-api": "0.21.1",
|
|
32
|
+
"@xwiki/cristal-authentication-api": "0.21.1",
|
|
33
|
+
"@xwiki/cristal-uiextension-api": "0.21.1",
|
|
34
|
+
"@xwiki/cristal-authentication-nextcloud-state": "0.21.1"
|
|
36
35
|
},
|
|
37
36
|
"peerDependencies": {
|
|
37
|
+
"inversify": "7.x",
|
|
38
38
|
"reflect-metadata": "0.x",
|
|
39
39
|
"vue": "3.x"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@vue/test-utils": "2.4.6",
|
|
43
|
+
"inversify": "7.7.0",
|
|
43
44
|
"reflect-metadata": "0.2.2",
|
|
44
|
-
"typescript": "5.
|
|
45
|
-
"vite": "7.0.
|
|
45
|
+
"typescript": "5.9.2",
|
|
46
|
+
"vite": "7.0.6",
|
|
46
47
|
"vitest": "3.2.4",
|
|
47
|
-
"vue": "3.5.
|
|
48
|
-
"vue-tsc": "2.2.
|
|
49
|
-
"@xwiki/cristal-dev-
|
|
50
|
-
"@xwiki/cristal-
|
|
51
|
-
"@xwiki/cristal-
|
|
48
|
+
"vue": "3.5.18",
|
|
49
|
+
"vue-tsc": "2.2.12",
|
|
50
|
+
"@xwiki/cristal-dev-config": "0.21.1",
|
|
51
|
+
"@xwiki/cristal-dsapi": "0.21.1",
|
|
52
|
+
"@xwiki/cristal-dev-test-utils": "0.21.1"
|
|
52
53
|
},
|
|
53
54
|
"scripts": {
|
|
54
55
|
"build": "vue-tsc --project tsconfig.json && vite build",
|
package/src/index.ts
CHANGED
package/src/translations.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
See the LICENSE file distributed with this work for additional
|
|
3
|
-
information regarding copyright ownership.
|
|
2
|
+
See the LICENSE file distributed with this work for additional
|
|
3
|
+
information regarding copyright ownership.
|
|
4
4
|
|
|
5
|
-
This is free software; you can redistribute it and/or modify it
|
|
6
|
-
under the terms of the GNU Lesser General Public License as
|
|
7
|
-
published by the Free Software Foundation; either version 2.1 of
|
|
8
|
-
the License, or (at your option) any later version.
|
|
5
|
+
This is free software; you can redistribute it and/or modify it
|
|
6
|
+
under the terms of the GNU Lesser General Public License as
|
|
7
|
+
published by the Free Software Foundation; either version 2.1 of
|
|
8
|
+
the License, or (at your option) any later version.
|
|
9
9
|
|
|
10
|
-
This software is distributed in the hope that it will be useful,
|
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
-
Lesser General Public License for more details.
|
|
10
|
+
This software is distributed in the hope that it will be useful,
|
|
11
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13
|
+
Lesser General Public License for more details.
|
|
14
14
|
|
|
15
|
-
You should have received a copy of the GNU Lesser General Public
|
|
16
|
-
License along with this software; if not, write to the Free
|
|
17
|
-
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
18
|
-
02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
15
|
+
You should have received a copy of the GNU Lesser General Public
|
|
16
|
+
License along with this software; if not, write to the Free
|
|
17
|
+
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
18
|
+
02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import messages from "../translations";
|
|
23
23
|
import { CristalApp } from "@xwiki/cristal-api";
|
|
24
24
|
import { NextcloudAuthenticationState } from "@xwiki/cristal-authentication-nextcloud-state";
|
|
25
|
-
import { inject, watch } from "vue";
|
|
25
|
+
import { inject, ref, watch } from "vue";
|
|
26
26
|
import { useI18n } from "vue-i18n";
|
|
27
27
|
import type { Ref } from "vue";
|
|
28
28
|
|
|
@@ -38,7 +38,14 @@ const authenticationState = cristal
|
|
|
38
38
|
const modalOpened: Ref<boolean> = authenticationState.modalOpened;
|
|
39
39
|
const username: Ref<string> = authenticationState.username;
|
|
40
40
|
const password: Ref<string> = authenticationState.password;
|
|
41
|
-
const
|
|
41
|
+
const errorStatus: Ref<number | undefined> = ref(undefined);
|
|
42
|
+
|
|
43
|
+
async function callback() {
|
|
44
|
+
const response = await authenticationState.callback();
|
|
45
|
+
if (!response.success) {
|
|
46
|
+
errorStatus.value = response.status;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
42
49
|
|
|
43
50
|
watch(
|
|
44
51
|
authenticationState.modalOpened,
|
|
@@ -46,6 +53,7 @@ watch(
|
|
|
46
53
|
if (newValue && !oldValue) {
|
|
47
54
|
authenticationState.username.value = "";
|
|
48
55
|
authenticationState.password.value = "";
|
|
56
|
+
errorStatus.value = undefined;
|
|
49
57
|
}
|
|
50
58
|
},
|
|
51
59
|
);
|
|
@@ -58,6 +66,23 @@ watch(
|
|
|
58
66
|
:title="t('authentication.nextcloud.modal.title')"
|
|
59
67
|
>
|
|
60
68
|
<template #default>
|
|
69
|
+
<!-- We need 2 different divs to implement the following behavior:
|
|
70
|
+
- Use max available width from the parent
|
|
71
|
+
- Do not resize the parent if the content is larger -->
|
|
72
|
+
<div class="alerts-wrapper">
|
|
73
|
+
<div class="alerts">
|
|
74
|
+
<x-alert v-if="errorStatus === 401" type="error">
|
|
75
|
+
{{ t("authentication.nextcloud.modal.error.invalid") }}
|
|
76
|
+
</x-alert>
|
|
77
|
+
<x-alert v-else-if="errorStatus !== undefined" type="error">
|
|
78
|
+
{{
|
|
79
|
+
t("authentication.nextcloud.modal.error.generic", {
|
|
80
|
+
status: errorStatus,
|
|
81
|
+
})
|
|
82
|
+
}}
|
|
83
|
+
</x-alert>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
61
86
|
<x-form id="nextcloud-login-form" @submit="callback">
|
|
62
87
|
<x-text-field
|
|
63
88
|
v-model="username"
|
|
@@ -81,3 +106,13 @@ watch(
|
|
|
81
106
|
</template>
|
|
82
107
|
</x-dialog>
|
|
83
108
|
</template>
|
|
109
|
+
|
|
110
|
+
<style scoped>
|
|
111
|
+
.alerts-wrapper {
|
|
112
|
+
display: flex;
|
|
113
|
+
}
|
|
114
|
+
.alerts {
|
|
115
|
+
flex-grow: 1;
|
|
116
|
+
width: 0;
|
|
117
|
+
}
|
|
118
|
+
</style>
|
package/vite.config.ts
CHANGED
package/vitest.config.ts
CHANGED