From 30a81528a2e251a4735f4f9d84b53c0c01347fdd Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 2 Aug 2018 09:29:33 -0400 Subject: [PATCH] (js) Prohibit duplicate calendar categories --- NEWS | 1 + .../English.lproj/Localizable.strings | 2 ++ UI/Templates/PreferencesUI/UIxPreferences.wox | 7 ++++++- .../js/Preferences/PreferencesController.js | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e3c08055b..17eeb8fbb 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ New features - [web] move mailboxes (#644, #3511, #4479) Enhancements + - [web] prohibit duplicate calendar categories in Preferences module - [web] added Romanian (ro) translation - thanks to Vasile Razvan Luca Bug fixes diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index ac5a4444a..68d2a7004 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -124,6 +124,8 @@ "Prevent from being invited to appointments" = "Prevent from being invited to appointments"; "White list for appointment invitations" = "White list for appointment invitations"; "Contacts Names" = "Contacts Names"; +"Duplicate name" = "Duplicate name"; +"Calendar categories must have unique names." = "Calendar categories must have unique names."; /* Default Calendar */ "Default calendar" = "Default calendar"; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 7c3e039ad..45afb9c93 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -410,9 +410,14 @@ track by $index"> - +
+
+
-1)) { + form['calendarCategory_' + i].$setValidity('duplicate', false); + sendForm = false; + } + }); + } + if (sendForm) return this.preferences.$save().then(function(data) { if (!options || !options.quick) {