Skip to content

Commit be323cb

Browse files
Add changes after review
1 parent cfff743 commit be323cb

File tree

5 files changed

+30
-26
lines changed

5 files changed

+30
-26
lines changed

docs/api/config/js_kanban_cardshape_config.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ cardShape?: {
5555
},
5656
{...} // other users data
5757
],
58-
maxCount?: boolean | number
58+
maxCount?: number | false
5959
},
6060
priority?: boolean | {
6161
show?: boolean,
@@ -155,11 +155,10 @@ To configure the card appearance, in the **cardShape** object you can specify th
155155
- `id` - (required) a user **ID**
156156
- `label` - (optional) a user name
157157
- `avatar` - (optional) a path to the user avatar
158-
- `maxCount` - (optional) a maximum count of users displayed on the card
158+
- `maxCount` - (optional) a maximum count of users displayed on the card (or ***false***)
159159

160-
If you set the `maxCount` property to `true`, you can see only the first assigned user on the card and the number of assigned users near the avatar.
160+
You can set the `maxCount` property to the number of users to be displayed on the card.
161161
If you set the `maxCount` property to `false`, you can see all the assigned user on the card.
162-
You can set the `maxCount` property to the number of users to be displayed on the card.
163162

164163
:::info
165164
The ***users*** field is disabled by default. To enable it, you need to set the `show` parameter to `true` and provide the corresponding users data via the `values` parameter. To assign new users via the editor, you need to configure the corresponding control via the [`editorShape`](api/config/js_kanban_editorshape_config.md#--parameters-for-combo-select-and-multiselect-types) property. Use the ***select*** type for assigning one or user or the ***multiselect*** type for assigning several users.
@@ -172,7 +171,7 @@ To configure the card appearance, in the **cardShape** object you can specify th
172171
{ id: 1, label: "John Smith", avatar: "../assets/user.jpg" },
173172
{ id: 2, label: "Aaron Short" }
174173
],
175-
maxCount: 3 // only 3 users can be displayed on the card
174+
maxCount: 4 // only 4 users can be displayed on the card
176175
}
177176
}
178177
~~~
@@ -187,7 +186,6 @@ To configure the card appearance, in the **cardShape** object you can specify th
187186
- `votes` - (optional) specifies the **votes** functionality
188187
- `show` - (optional) shows/hides the vote icon on the card and in the editor
189188
- `clickable` - (optional) - makes the vote icon on the card clickable. If `true`, users can vote for the card using the vote icon on this card. Otherwise, users can vote for the card using the vote icon in the editor only
190-
shows/hides **votes** on cards. If **true**, the corresponding control will be displayed in the editor
191189
- `css` - a function returns a css class that applies to cards conditionally
192190
- `headerFields` - (optional) an array of objects with the **custom fields** data. Here you can specify the following parameters:
193191
- `key` - (required) a key of the custom field. It is used when configuring the Editor via the [editorShape](../js_kanban_editorshape_config) property
@@ -237,13 +235,16 @@ const defaultCardShape = {
237235
show: false,
238236
values: defaultColors
239237
},
240-
users: false,
238+
users: {
239+
show: false,
240+
maxCount: 3
241+
},
241242
priority: {
242243
show: false,
243244
values: defaultPriorities
244245
},
245246
comments: false,
246-
votes: false,
247+
votes: false
247248
};
248249
~~~
249250

@@ -280,7 +281,7 @@ const cardShape = { // card settings
280281
users: {
281282
show: true,
282283
values: users,
283-
maxCount: 3
284+
maxCount: false
284285
},
285286
priority: {
286287
show: true,

docs/api/config/js_kanban_columnshape_config.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,28 +153,27 @@ const columnShape = {
153153
fixedHeaders: false,
154154
css: (column, cards) => column.id == "inprogress" && cards.length < 5 ? "green" : "red",
155155
headerTemplate: template(column => {
156-
return `<div class="wx-collapse-icon" data-action=${"collapse"}>
156+
return `<div class="wx-collapse-icon" data-action=${"collapse"}>
157157
<i class=${column.column.collapsed ? "wxi-angle-right" : "wxi-angle-left"}></i>
158158
</div>
159159
${
160-
!column.renaming && !column.column.collapsed
160+
!column.column.collapsed
161161
? `<div class="wx-label" data-action="rename">
162162
${escapeHTML(column.column.label)}
163163
(${column.columnState.cardsCount})
164-
${column.column.limit ? `(${column.columnState.cardsCount}/${column.columnState.totalLimit})` : ""}
165164
</div>`
166165
: ""
167166
}
168167
${
169-
column.isMenuVisible && !column.readonly && !column.renaming && !column.column.collapsed
168+
!column.column.collapsed
170169
? `<div class="wx-menu" data-menu-id={column.id}>
171170
<i class="wxi-dots-h"></i>
172171
</div>`
173172
: ""
174173
}`;
175174
}),
176175
collapsedTemplate: template(column => {
177-
return `<div class="wx-collapsed-label">
176+
return `<div class="wx-collapsed-label">
178177
<div class="wx-label-text">${escapeHTML(column.column.label)} (${
179178
column.columnState?.cardsCount
180179
})</div>

docs/api/events/js_kanban_setedit_event.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ description: You can learn about the set-edit event in the documentation of the
1313
### Usage
1414

1515
~~~jsx {}
16-
"set-edit": ({ cardId: string | number, eventSource: "select-card" } | null) => void;
16+
"set-edit": ({ cardId: string | number, eventSource?: "select-card" } | null) => void;
1717
~~~
1818

1919
### Parameters
2020

2121
The callback of the **set-edit** event can take the *null* value or an object with the following parameter:
2222

2323
- `cardId` - (required) the ID of the card to be edited
24-
- `eventSource` - (required) the ***"select-card"*** action that invokes the ***set-edit*** event
24+
- `eventSource` - (optional) the ***"select-card"*** action that invokes the ***set-edit*** event
2525

2626
:::note
2727
The ***null*** value is used when closing editor
@@ -39,7 +39,7 @@ const board = new kanban.Kanban("#root", {
3939
columns,
4040
cards
4141
});
42-
// prevent editing card when a user click the card once
42+
// prevent editing when a user clicks the card once
4343
board.api.intercept("set-edit", ({ eventSource }) => {
4444
return eventSource != "select-card";
4545
});

docs/guides/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ The board of Kanban consists of the *cards* distributed into *columns* and *rows
5959

6060
- a card cover (*preview image*) via the `cover: boolean` config
6161
- a card comment(s) via the `comments: boolean` config
62-
- a card vote(s) via the `votes: { show: boolean, clicable: true }` config
63-
- a card assignment (users) via the `users: { show: boolean, values: object, maxCount: number }` config
62+
- a card vote(s) via the `votes: boolean | { show: boolean, clicable: true }` config
63+
- a card assignment (users) via the `users: boolean | { show: boolean, values: object, maxCount: number | false }` config
6464

6565
:::tip
6666
You can assign one or several users to any card via the corresponding control of the Kanban editor. To configure the control for assigning a single user, use the [**combo** or **select**](#combo-select-and-multiselect-types) types of editor. To assign multiple users, use the [**multiselect**](#combo-select-and-multiselect-types) type.
6767
:::
6868

69-
- a card priority via the `priority: { show: boolean, values: object }` config
69+
- a card priority via the `priority: boolean | { show: boolean, values: object }` config
7070

7171
:::tip
7272
You can manage the **priority** of any card via the corresponding control of the Kanban editor. If you activate **priority**, the corresponding control will be displayed in the editor automatically. To configure this control, you can use the [**combo** or **select**](#combo-select-and-multiselect-types) types only.

docs/news/whats_new.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Released on Month Day, 2024
1414

1515
### New functionality
1616

17-
- An ability to display the editor as a modal window via the [`editor.placement`](../../api/config/js_kanban_editor_config) property
18-
- An ability to enable voting for a card (using the vote icon on the card) via the [`cardShape.votes.clicable`](../../api/config/js_kanban_columnshape_config) property
19-
- An ability to specify a custom template for a search result via the [`items.searchResult`](../../api/config/toolbar_items_config) property of the Toolbar **search** control
20-
- An ability to specify a max count of assigned users displayed on a card via the [`cardShape.users.maxCount`](../../api/config/js_kanban_columnshape_config) property
21-
- An ability to specify custom templates for column header in expanded and collapsed states via the [`columnShape`](../../api/config/js_kanban_columnshape_config) property
17+
- The ability to change how many assigned users are displayed on a card via the [`cardShape.users.maxCount`](../../api/config/js_kanban_columnshape_config) property
18+
- The ability to change the content of column headers via the [`items.searchResult`](../../api/config/toolbar_items_config) property of the Toolbar **search** control
19+
- The ability to change the view and content of search results via the [`columnShape`](../../api/config/js_kanban_columnshape_config) property
20+
- The ability to display the editor as a modal window via the [`editor.placement`](../../api/config/js_kanban_editor_config) property
21+
- The ability to enable voting for a card (using the vote icon on the card) via the [`cardShape.votes.clicable`](../../api/config/js_kanban_columnshape_config) property
2222

2323
### Updates
2424

@@ -29,9 +29,13 @@ Released on Month Day, 2024
2929
- The [`editor`](../../api/config/js_kanban_editor_config) property is extended by the ***placement*** parameter
3030
- The [`items`](../../api/config/toolbar_items_config) property of the Toolbar **search** control is extended by the ***searchResult*** parameter
3131

32+
- #### Events
33+
34+
- The [`set-edit`](../../api/events/js_kanban_setedit_event) event is extended by the ***eventSource*** parameter
35+
3236
### Fixes
3337

34-
- ...
38+
- Add missing localization strings
3539
- ...
3640

3741
## Version 1.5.13

0 commit comments

Comments
 (0)