mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 14:08:31 -04:00
Merge pull request #3214 from NicoP-S/master
Change slug on card rename
This commit is contained in:
commit
eb7623e218
1 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue