Signed-off-by: Artyom Grigorovich <grigorovichartyom@gmail.com>
This commit is contained in:
Artyom Grigorovich 2022-05-19 17:37:41 +07:00 committed by GitHub
parent 06254e720f
commit 870f41f7de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -15,18 +15,15 @@
<script lang="ts">
import contact from '@anticrm/contact'
import { DocumentQuery, FindOptions, Ref, SortingOrder } from '@anticrm/core'
import { IntlString } from '@anticrm/platform'
import { createQuery } from '@anticrm/presentation'
import { Project, Team } from '@anticrm/tracker'
import { Button, IconAdd, IconOptions, Label, showPopup } from '@anticrm/ui'
import tracker from '../../plugin'
import { getIncludedProjectStatuses, ProjectsViewMode } from '../../utils'
import NewProject from './NewProject.svelte'
import ProjectsListBrowser from './ProjectsListBrowser.svelte'
import tracker from '../../plugin'
import { getIncludedProjectStatuses, ProjectsViewMode, projectsTitleMap } from '../../utils'
export let currentSpace: Ref<Team>
export let title: IntlString = tracker.string.AllProjects
export let query: DocumentQuery<Project> = {}
export let search: string = ''
export let mode: ProjectsViewMode = 'all'
@ -43,6 +40,7 @@
let resultProjects: Project[] = []
$: includedProjectStatuses = getIncludedProjectStatuses(mode)
$: title = projectsTitleMap[mode]
$: includedProjectsQuery = { status: { $in: includedProjectStatuses } }
$: baseQuery = {

View File

@ -278,3 +278,10 @@ export const getIncludedProjectStatuses = (mode: ProjectsViewMode): ProjectStatu
}
}
}
export const projectsTitleMap: Record<ProjectsViewMode, IntlString> = Object.freeze({
all: tracker.string.AllProjects,
backlog: tracker.string.BacklogProjects,
active: tracker.string.ActiveProjects,
closed: tracker.string.ClosedProjects
})