Validate external_links on both server and client sides.
Display errors from SaveAdminSettings to the user.
This commit is contained in:
@@ -1292,7 +1292,7 @@
|
||||
"This profile is from another instance, the informations shown here may be incomplete.": "Ce profil provient d'une autre instance, les informations montrées ici peuvent être incomplètes.",
|
||||
"This profile is located on this instance, so you need to {access_the_corresponding_account} to suspend it.": "Ce profil se situe sur cette instance, vous devez donc {access_the_corresponding_account} afin de le suspendre.",
|
||||
"This profile was not found": "Ce profil n'a pas été trouvé",
|
||||
"This section lets you add links to external websites to the menu.": "Cette section vous permet d'ajouter des liens vers des sites internets externes au menu.",
|
||||
"This section lets you add links to external websites to the menu.": "Cette section vous permet d'ajouter des liens vers des sites internet externes au menu.",
|
||||
"This setting will be used to display the website and send you emails in the correct language.": "Ce paramètre sera utilisé pour l'affichage du site et pour vous envoyer des courriels dans la bonne langue.",
|
||||
"This URL doesn't seem to be valid": "Cette URL ne semble pas être valide",
|
||||
"This URL is not supported": "Cette URL n'est pas supportée",
|
||||
|
||||
@@ -480,11 +480,17 @@
|
||||
:key="index"
|
||||
>
|
||||
<o-field :label="t('URL')" class="!mt-0"
|
||||
><o-input expanded v-model="link.url" type="text"
|
||||
><o-input expanded v-model="link.url" type="url" required
|
||||
/></o-field>
|
||||
|
||||
<o-field :label="t('Label')"
|
||||
><o-input expanded v-model="link.label" type="text"
|
||||
><o-input
|
||||
expanded
|
||||
v-model="link.label"
|
||||
type="text"
|
||||
minlength="2"
|
||||
maxlength="256"
|
||||
required
|
||||
/></o-field>
|
||||
|
||||
<o-field
|
||||
@@ -609,7 +615,7 @@ const addLink = () => {
|
||||
settingsToWrite.value.externalLinks.push({
|
||||
url: "",
|
||||
label: "",
|
||||
enabled: false,
|
||||
enabled: true,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -700,7 +706,9 @@ saveAdminSettingsDone(() => {
|
||||
|
||||
saveAdminSettingsError((e) => {
|
||||
console.error(e);
|
||||
notifier?.error(t("Failed to save admin settings") as string);
|
||||
notifier?.error(
|
||||
(t("Failed to save admin settings") as string) + ": " + e.message
|
||||
);
|
||||
});
|
||||
|
||||
const updateSettings = async (): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user