diff --git a/frontend/src/kanban-board/kanban-card.tsx b/frontend/src/kanban-board/kanban-card.tsx
index 4402739..09d6e17 100644
--- a/frontend/src/kanban-board/kanban-card.tsx
+++ b/frontend/src/kanban-board/kanban-card.tsx
@@ -37,11 +37,14 @@ export const KanbanCard = observer((props: Props) => {
}
const timePassedClassName = `${KanbanCardCss.timepassedDot} ${timePassedColorClassName}`;
let tagsSection = <>>;
- const tagsParams = props.store.params?.fields.find((field) => {
+ const tagsParams = props.store.params.fields.find((field) => {
return field.component === 'tags';
});
+ console.debug('Tag params:', tagsParams); // DEBUG
+ console.debug('Issue:', props.store.issue); // DEBUG
if (tagsParams && props.store.issue[tagsParams.path]) {
const tags = props.store.issue[tagsParams.path] as TagProps[];
+ console.debug(`Tags:`, tags); // DEBUG
tagsSection = (
{tagsParams.label || 'Tags'}: {tags.map(tag => )}
diff --git a/frontend/src/kanban-board/store.ts b/frontend/src/kanban-board/store.ts
index 3cc5977..e273b51 100644
--- a/frontend/src/kanban-board/store.ts
+++ b/frontend/src/kanban-board/store.ts
@@ -14,9 +14,9 @@ export const ColumnStore = types.model({
return {
get cards(): ICardStore[] {
return self.issues.map(issue => {
- return {
+ return CardStore.create({
issue: issue
- } as ICardStore;
+ })
});
}
}
@@ -77,24 +77,29 @@ export type CardField = {
export const CardSettings = types.model({});
-export const CardStore = types.model({
- issue: IssueStore,
- params: types.maybe(types.model({
- fields: types.optional(
- types.array(
- types.frozen()
- ),
- [
- { component: 'text', label: 'Исп.', path: 'current_user.name' },
- { component: 'text', label: 'Прио.', path: 'priority.name' },
- { component: 'text', label: 'Версия', path: 'fixed_version.name' },
- { component: 'text', label: 'Прогресс', path: 'done_ratio' },
- { component: 'labor_costs' },
- { component: 'tags', label: 'Tags', path: 'styledTags' }
- ]
+export const CardParamsStore = types.optional(
+ types.model({
+ fields: types.array(
+ types.frozen()
),
autoCollapse: types.boolean
- })),
+ }),
+ {
+ fields: [
+ { component: 'text', label: 'Исп.', path: 'current_user.name' },
+ { component: 'text', label: 'Прио.', path: 'priority.name' },
+ { component: 'text', label: 'Версия', path: 'fixed_version.name' },
+ { component: 'text', label: 'Прогресс', path: 'done_ratio' },
+ { component: 'labor_costs' },
+ { component: 'tags', label: 'Tags', path: 'styledTags' }
+ ],
+ autoCollapse: false,
+ }
+);
+
+export const CardStore = types.model({
+ issue: IssueStore,
+ params: CardParamsStore
});
export interface ICardStore extends Instance {}