diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 30863df353..893db84c2e 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -679,6 +679,10 @@ export function createModel (builder: Builder): void { presenter: tracker.component.ProjectTitlePresenter }) + builder.mixin(tracker.class.Team, core.class.Class, view.mixin.AttributePresenter, { + presenter: tracker.component.TeamPresenter + }) + classPresenter( builder, tracker.class.Project, diff --git a/plugins/tracker-assets/assets/icons.svg b/plugins/tracker-assets/assets/icons.svg index 6c6793dc66..6072eebb6d 100644 --- a/plugins/tracker-assets/assets/icons.svg +++ b/plugins/tracker-assets/assets/icons.svg @@ -50,6 +50,9 @@ + + + diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index e899fda7b1..05a098b119 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -40,6 +40,11 @@ "Completed": "Completed", "Canceled": "Canceled", "CreateTeam": "Create team", + "NewTeam": "New team", + "TeamTitlePlaceholder": "Team title", + "MakePrivate": "Make private", + "MakePrivateDescription": "Only members can see it", + "ChooseIcon": "Choose icon", "AddIssue": "Add Issue", "NewIssue": "New issue", "ResumeDraft": "Resume draft", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index 14fd5b548d..b3cd055194 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -40,6 +40,11 @@ "Completed": "Завершен", "Canceled": "Отменено", "CreateTeam": "Создать команду", + "NewTeam": "Новая команда", + "TeamTitlePlaceholder": "Название команды", + "MakePrivate": "Сделать личным", + "MakePrivateDescription": "Только пользователи могут видеть это", + "ChooseIcon": "Выбрать иконку", "AddIssue": "Добавить задачу", "NewIssue": "Новая задача", "ResumeDraft": "Восстановить черновик", diff --git a/plugins/tracker-assets/src/index.ts b/plugins/tracker-assets/src/index.ts index c3be3fc500..95dd44ff6c 100644 --- a/plugins/tracker-assets/src/index.ts +++ b/plugins/tracker-assets/src/index.ts @@ -31,6 +31,7 @@ loadMetadata(tracker.icon, { NewIssue: `${icons}#newissue`, Magnifier: `${icons}#magnifier`, Home: `${icons}#home`, + RedCircle: `${icons}#red-circle`, Labels: `${icons}#priority-nopriority`, // TODO: add icon DueDate: `${icons}#inbox`, // TODO: add icon Parent: `${icons}#myissues`, // TODO: add icon diff --git a/plugins/tracker-resources/package.json b/plugins/tracker-resources/package.json index bd1a5b7a48..623a89cf15 100644 --- a/plugins/tracker-resources/package.json +++ b/plugins/tracker-resources/package.json @@ -55,6 +55,7 @@ "@hcengineering/attachment-resources": "~0.6.0", "@hcengineering/workbench": "~0.6.2", "@hcengineering/attachment": "~0.6.1", - "@hcengineering/chunter-resources": "~0.6.0" + "@hcengineering/chunter-resources": "~0.6.0", + "@hcengineering/workbench-resources": "~0.6.1" } } diff --git a/plugins/tracker-resources/src/components/teams/CreateTeam.svelte b/plugins/tracker-resources/src/components/teams/CreateTeam.svelte new file mode 100644 index 0000000000..ab3a6e850d --- /dev/null +++ b/plugins/tracker-resources/src/components/teams/CreateTeam.svelte @@ -0,0 +1,84 @@ + + + + 0} + on:close={() => { + dispatch('close') + }} +> + + + +
+
+
+
+
diff --git a/plugins/tracker-resources/src/components/teams/TeamIconChooser.svelte b/plugins/tracker-resources/src/components/teams/TeamIconChooser.svelte new file mode 100644 index 0000000000..25d113b20f --- /dev/null +++ b/plugins/tracker-resources/src/components/teams/TeamIconChooser.svelte @@ -0,0 +1,41 @@ + + + { + dispatch('close') + }} +> +
+ {#each icons as obj} +
+
+ {/each} +
+
diff --git a/plugins/tracker-resources/src/components/teams/TeamPresenter.svelte b/plugins/tracker-resources/src/components/teams/TeamPresenter.svelte new file mode 100644 index 0000000000..7c4dae3225 --- /dev/null +++ b/plugins/tracker-resources/src/components/teams/TeamPresenter.svelte @@ -0,0 +1,47 @@ + + + +{#if model.specials} + getActions(space)}> + {#each model.specials as special} + dispatch('special', special.id)} + selected={currentSpace === space._id && special.id === currentSpecial} + on:click={() => { + selectSpace(space._id, special.id) + }} + /> + {/each} + +{/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 6ad18eb74f..e78309bde3 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -94,6 +94,9 @@ import IssueTemplates from './components/templates/IssueTemplates.svelte' import EditIssueTemplate from './components/templates/EditIssueTemplate.svelte' import TemplateEstimationEditor from './components/templates/EstimationEditor.svelte' +import CreateTeam from './components/teams/CreateTeam.svelte' +import TeamPresenter from './components/teams/TeamPresenter.svelte' + export async function queryIssue ( _class: Ref>, client: Client, @@ -216,7 +219,9 @@ export default async (): Promise => ({ IssueTemplates, IssueTemplatePresenter, EditIssueTemplate, - TemplateEstimationEditor + TemplateEstimationEditor, + CreateTeam, + TeamPresenter }, completion: { IssueQuery: async (client: Client, query: string, filter?: { in?: RelatedDocument[], nin?: RelatedDocument[] }) => diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 2dabaea063..f34c515eb6 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -60,6 +60,11 @@ export default mergeIds(trackerId, tracker, { Completed: '' as IntlString, Canceled: '' as IntlString, CreateTeam: '' as IntlString, + NewTeam: '' as IntlString, + TeamTitlePlaceholder: '' as IntlString, + MakePrivate: '' as IntlString, + MakePrivateDescription: '' as IntlString, + ChooseIcon: '' as IntlString, AddIssue: '' as IntlString, NewIssue: '' as IntlString, ResumeDraft: '' as IntlString, @@ -273,6 +278,7 @@ export default mergeIds(trackerId, tracker, { DueDatePresenter: '' as AnyComponent, EditIssueTemplate: '' as AnyComponent, CreateTeam: '' as AnyComponent, + TeamPresenter: '' as AnyComponent, NewIssueHeader: '' as AnyComponent, IconPresenter: '' as AnyComponent, LeadPresenter: '' as AnyComponent, diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index 472faad773..6ca91ef520 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -59,11 +59,11 @@ export interface IssueStatusCategory extends Doc { * @public */ export interface Team extends Space { - teamLogo?: string | null identifier: string // Team identifier sequence: number issueStatuses: number defaultIssueStatus: Ref + icon?: Asset } /** @@ -413,6 +413,7 @@ export default plugin(trackerId, { NewIssue: '' as Asset, Magnifier: '' as Asset, Home: '' as Asset, + RedCircle: '' as Asset, Labels: '' as Asset, DueDate: '' as Asset, Parent: '' as Asset, diff --git a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte index 6693aff9f1..f5e262b04f 100644 --- a/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte +++ b/plugins/workbench-resources/src/components/navigator/SpacesNav.svelte @@ -21,12 +21,11 @@ import preference from '@hcengineering/preference' import { getClient } from '@hcengineering/presentation' import { Action, getCurrentLocation, IconAdd, IconEdit, IconSearch, navigate, showPopup } from '@hcengineering/ui' - import { getActions as getContributedActions } from '@hcengineering/view-resources' + import { getActions as getContributedActions, getObjectPresenter } from '@hcengineering/view-resources' import { SpacesNavModel } from '@hcengineering/workbench' import { createEventDispatcher } from 'svelte' import plugin from '../../plugin' import { classIcon, getSpaceName } from '../../utils' - import SpecialElement from './SpecialElement.svelte' import TreeItem from './TreeItem.svelte' import TreeNode from './TreeNode.svelte' @@ -113,36 +112,33 @@ getParentActions()} indent={'ml-2'}> {#each spaces as space (space._id)} - {#if model.specials} - getActions(space)}> - {#each model.specials as special} - + {:else} + {#await getSpaceName(client, space) then name} + dispatch('special', special.id)} - selected={currentSpace === space._id && special.id === currentSpecial} + _id={space._id} + title={name} + icon={classIcon(client, space._class)} + selected={currentSpace === space._id} + actions={() => getActions(space)} + bold={isChanged(space, $lastViews)} on:click={() => { - selectSpace(space._id, special.id) + selectSpace(space._id) }} /> - {/each} - - {:else} - {#await getSpaceName(client, space) then name} - getActions(space)} - bold={isChanged(space, $lastViews)} - on:click={() => { - selectSpace(space._id) - }} - /> - {/await} - {/if} + {/await} + {/if} + {/await} {/each} diff --git a/plugins/workbench-resources/src/index.ts b/plugins/workbench-resources/src/index.ts index 04db69d250..9f9af28bf5 100644 --- a/plugins/workbench-resources/src/index.ts +++ b/plugins/workbench-resources/src/index.ts @@ -27,6 +27,8 @@ function hasArchiveSpaces (spaces: Space[]): boolean { return spaces.find((sp) => sp.archived) !== undefined } export { default as SpaceBrowser } from './components/SpaceBrowser.svelte' +export { default as TreeNode } from './components/navigator/TreeNode.svelte' +export { default as SpecialElement } from './components/navigator/SpecialElement.svelte' export default async (): Promise => ({ component: { WorkbenchApp,