From bb08165fef131461992bd50f52b50367bcd4d46e Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Mon, 6 Sep 2021 19:00:43 +0300 Subject: [PATCH] Add KanbanView. Move icons. (#143) Signed-off-by: Alexander Platov --- packages/theme/styles/global.scss | 3 + .../ui}/src/components/icons/File.svelte | 0 .../ui}/src/components/icons/MoreH.svelte | 0 packages/ui/src/index.ts | 2 + .../src/components/AttachmentPresenter.svelte | 4 +- .../src/components/Message.svelte | 5 +- .../src/components/icons/MoreH.svelte | 10 -- .../src/components/CandidateGeneral.svelte | 6 +- .../src/components/Card.svelte | 4 +- .../src/components/CreateApplication.svelte | 3 +- .../components/CreateCandidate copy.svelte | 5 +- .../src/components/CreateVacancy.svelte | 5 +- .../src/components/DialogHeader.svelte | 3 +- .../src/components/KanbanCard.svelte | 10 +- .../src/components/icons/File.svelte | 24 ---- .../src/components/CreateTask.svelte | 5 +- .../src/components/icons/File.svelte | 24 ---- plugins/view-assets/assets/icons.svg | 24 +--- .../src/components/KanbanCard.svelte | 114 ++++++++++++++++ .../src/components/KanbanCardEmpty.svelte | 54 ++++++++ .../src/components/KanbanPanel.svelte | 82 ++++++++++++ .../src/components/KanbanPanelEmpty.svelte | 68 ++++++++++ .../src/components/KanbanView.svelte | 126 +++++++++--------- .../src/components/NavHeader.svelte | 5 +- .../src/components/SpaceHeader.svelte | 5 +- .../src/components/icons/MoreH.svelte | 10 -- 26 files changed, 417 insertions(+), 184 deletions(-) rename {plugins/chunter-resources => packages/ui}/src/components/icons/File.svelte (100%) rename {plugins/recruit-resources => packages/ui}/src/components/icons/MoreH.svelte (100%) delete mode 100644 plugins/chunter-resources/src/components/icons/MoreH.svelte delete mode 100644 plugins/recruit-resources/src/components/icons/File.svelte delete mode 100644 plugins/task-resources/src/components/icons/File.svelte create mode 100644 plugins/view-resources/src/components/KanbanCard.svelte create mode 100644 plugins/view-resources/src/components/KanbanCardEmpty.svelte create mode 100644 plugins/view-resources/src/components/KanbanPanel.svelte create mode 100644 plugins/view-resources/src/components/KanbanPanelEmpty.svelte delete mode 100644 plugins/workbench-resources/src/components/icons/MoreH.svelte diff --git a/packages/theme/styles/global.scss b/packages/theme/styles/global.scss index 179663c870..d9109c9641 100644 --- a/packages/theme/styles/global.scss +++ b/packages/theme/styles/global.scss @@ -81,6 +81,9 @@ background-color: var(--theme-scroll-bar); border-radius: .25rem; } +.kanban-container .scroll::-webkit-scrollbar-track { + margin: 2.5rem; +} .normal-font { font-size: 16px; } .small-font { font-size: 14px; } diff --git a/plugins/chunter-resources/src/components/icons/File.svelte b/packages/ui/src/components/icons/File.svelte similarity index 100% rename from plugins/chunter-resources/src/components/icons/File.svelte rename to packages/ui/src/components/icons/File.svelte diff --git a/plugins/recruit-resources/src/components/icons/MoreH.svelte b/packages/ui/src/components/icons/MoreH.svelte similarity index 100% rename from plugins/recruit-resources/src/components/icons/MoreH.svelte rename to packages/ui/src/components/icons/MoreH.svelte diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index de1b4911b4..fd9c6ecef8 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -60,6 +60,8 @@ export { default as IconSearch } from './components/icons/Search.svelte' export { default as IconToDo } from './components/icons/ToDo.svelte' export { default as IconComments } from './components/icons/Comments.svelte' export { default as IconFolder } from './components/icons/Folder.svelte' +export { default as IconMoreH } from './components/icons/MoreH.svelte' +export { default as IconFile } from './components/icons/File.svelte' export * from './utils' diff --git a/plugins/chunter-resources/src/components/AttachmentPresenter.svelte b/plugins/chunter-resources/src/components/AttachmentPresenter.svelte index 86a0560c0a..16f64a6f15 100644 --- a/plugins/chunter-resources/src/components/AttachmentPresenter.svelte +++ b/plugins/chunter-resources/src/components/AttachmentPresenter.svelte @@ -17,12 +17,12 @@ {#if value} - + {/if} diff --git a/plugins/chunter-resources/src/components/Message.svelte b/plugins/chunter-resources/src/components/Message.svelte index 38e9090294..be21677aea 100644 --- a/plugins/chunter-resources/src/components/Message.svelte +++ b/plugins/chunter-resources/src/components/Message.svelte @@ -16,11 +16,10 @@ - - - - - - diff --git a/plugins/recruit-resources/src/components/CandidateGeneral.svelte b/plugins/recruit-resources/src/components/CandidateGeneral.svelte index 11cdf2d4ca..c62b20134b 100644 --- a/plugins/recruit-resources/src/components/CandidateGeneral.svelte +++ b/plugins/recruit-resources/src/components/CandidateGeneral.svelte @@ -16,14 +16,12 @@ -
+
diff --git a/plugins/recruit-resources/src/components/Card.svelte b/plugins/recruit-resources/src/components/Card.svelte index ddffee726d..67aef137ba 100644 --- a/plugins/recruit-resources/src/components/Card.svelte +++ b/plugins/recruit-resources/src/components/Card.svelte @@ -15,9 +15,9 @@ - - - - diff --git a/plugins/task-resources/src/components/CreateTask.svelte b/plugins/task-resources/src/components/CreateTask.svelte index 1e0f62370c..3a284fd4f6 100644 --- a/plugins/task-resources/src/components/CreateTask.svelte +++ b/plugins/task-resources/src/components/CreateTask.svelte @@ -16,11 +16,10 @@ - - - - diff --git a/plugins/view-assets/assets/icons.svg b/plugins/view-assets/assets/icons.svg index e1a9fe39c9..a465e4e656 100644 --- a/plugins/view-assets/assets/icons.svg +++ b/plugins/view-assets/assets/icons.svg @@ -1,29 +1,13 @@ - - - - - - - - - + + + - - - - - - - - - - - + diff --git a/plugins/view-resources/src/components/KanbanCard.svelte b/plugins/view-resources/src/components/KanbanCard.svelte new file mode 100644 index 0000000000..97852b528f --- /dev/null +++ b/plugins/view-resources/src/components/KanbanCard.svelte @@ -0,0 +1,114 @@ + + + + +
+
+ + +
+
+
+ + Team Interview +
+
{card.description}
+
+
+ + +
+
+
+
+ + diff --git a/plugins/view-resources/src/components/KanbanCardEmpty.svelte b/plugins/view-resources/src/components/KanbanCardEmpty.svelte new file mode 100644 index 0000000000..35ad2e9ab5 --- /dev/null +++ b/plugins/view-resources/src/components/KanbanCardEmpty.svelte @@ -0,0 +1,54 @@ + + + + +
+
+ +
+
+ + diff --git a/plugins/view-resources/src/components/KanbanPanel.svelte b/plugins/view-resources/src/components/KanbanPanel.svelte new file mode 100644 index 0000000000..372e3b5830 --- /dev/null +++ b/plugins/view-resources/src/components/KanbanPanel.svelte @@ -0,0 +1,82 @@ + + + + +
+
+
+
{counter}
+
+
+ + + +
+
+ + diff --git a/plugins/view-resources/src/components/KanbanPanelEmpty.svelte b/plugins/view-resources/src/components/KanbanPanelEmpty.svelte new file mode 100644 index 0000000000..ac94dcb011 --- /dev/null +++ b/plugins/view-resources/src/components/KanbanPanelEmpty.svelte @@ -0,0 +1,68 @@ + + + + +
+
+
+ +
+
+
+ + diff --git a/plugins/view-resources/src/components/KanbanView.svelte b/plugins/view-resources/src/components/KanbanView.svelte index 7cf7f8dee6..855e239cb5 100644 --- a/plugins/view-resources/src/components/KanbanView.svelte +++ b/plugins/view-resources/src/components/KanbanView.svelte @@ -24,6 +24,11 @@ import { createQuery } from '@anticrm/presentation' + import KanbanPanel from './KanbanPanel.svelte' + import KanbanPanelEmpty from './KanbanPanelEmpty.svelte' + import KanbanCard from './KanbanCard.svelte' + import KanbanCardEmpty from './KanbanCardEmpty.svelte' + export let _class: Ref> export let space: Ref export let open: AnyComponent @@ -52,78 +57,79 @@ function onClick(object: Doc) { showPopup(open, { object, space }, 'float') } + + interface ICard { + _id: number + firstName: string + lastName: string + description: string + state: number + } + let dragCard: ICard + let states: Array = [ + { _id: 0, label: 'In progress', color: '#7C6FCD' }, + { _id: 1, label: 'Under review', color: '#6F7BC5' }, + { _id: 2, label: 'Interview', color: '#A5D179' }, + { _id: 3, label: 'Offer', color: '#77C07B' }, + { _id: 4, label: 'Assigned', color: '#F28469' } + ] + const cards: Array = [ + { _id: 0, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 }, + { _id: 1, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 }, + { _id: 2, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 }, + { _id: 3, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 1 }, + { _id: 4, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 1 }, + { _id: 5, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 2 }, + { _id: 6, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 3 }, + ] {#await buildModel(client, _class, config, options)} {:then model} -KANBAN -
- - - - - {#each model as attribute} - +
+ +
+ {#each states as state} + { + event.preventDefault() + }} + on:drop={(event) => { + event.preventDefault() + if (dragCard) { + dragCard.state = state._id + dragCard = undefined + } + }} + > + + {#each cards.filter((c) => c.state === state._id) as card} + { + dragCard = card + }} + on:dragend={() => { + dragCard = undefined + }} + /> {/each} -
- - {#if objects} - - {#each objects as object (object._id)} - onClick(object)}> - {#each model as attribute} - - {/each} - - {/each} - - {/if} -
+ + {/each} + +
{/await} diff --git a/plugins/workbench-resources/src/components/NavHeader.svelte b/plugins/workbench-resources/src/components/NavHeader.svelte index 6868e3c9b6..29129d4306 100644 --- a/plugins/workbench-resources/src/components/NavHeader.svelte +++ b/plugins/workbench-resources/src/components/NavHeader.svelte @@ -15,8 +15,7 @@ - - - - - -