summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-07-19 22:35:25 +0300
committerGitHub <noreply@github.com>2020-07-19 22:35:25 +0300
commiteb7623e218da7c09491894432560d9d8fc871ed0 (patch)
treeea3c0a4ba35f9af26d06ff9c68c453258be975fa
parent282f0f91fef799dc3981004e4d20730ae18eff2f (diff)
parent19acd7861d1843460297f27e8da0c90dba6ebe54 (diff)
downloadwekan-eb7623e218da7c09491894432560d9d8fc871ed0.tar.gz
wekan-eb7623e218da7c09491894432560d9d8fc871ed0.tar.bz2
wekan-eb7623e218da7c09491894432560d9d8fc871ed0.zip
Merge pull request #3214 from NicoP-S/master
Change slug on card rename
-rw-r--r--models/boards.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/models/boards.js b/models/boards.js
index f272e097..306bae13 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -18,18 +18,14 @@ Boards.attachSchema(
type: String,
// eslint-disable-next-line consistent-return
autoValue() {
- // XXX We need to improve slug management. Only the id should be necessary
- // to identify a board in the code.
- // XXX If the board title is updated, the slug should also be updated.
// In some cases (Chinese and Japanese for instance) the `getSlug` function
// return an empty string. This is causes bugs in our application so we set
// a default slug in this case.
- if (this.isInsert && !this.isSet) {
+ // Improvment would be to change client URL after slug is changed
+ const title = this.field('title');
+ if (title.isSet && !this.isSet) {
let slug = 'board';
- const title = this.field('title');
- if (title.isSet) {
- slug = getSlug(title.value) || slug;
- }
+ slug = getSlug(title.value) || slug;
return slug;
}
},