diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index ade5354f58..ea5e3e99d9 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -521,6 +521,14 @@ export function createModel (builder: Builder): void { actionTartget: 'query', action: tracker.function.SubIssueQuery, label: tracker.string.SubIssues + }, + { + key: 'shouldShowAll', + type: 'toggle', + defaultValue: false, + actionTartget: 'category', + action: view.function.ShowEmptyGroups, + label: view.string.ShowEmptyGroups } ] } @@ -596,6 +604,7 @@ export function createModel (builder: Builder): void { ['dueDate', SortingOrder.Descending], ['rank', SortingOrder.Ascending] ], + groupDepth: 1, other: [] } @@ -696,7 +705,10 @@ export function createModel (builder: Builder): void { builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: tracker.class.Issue, descriptor: tracker.viewlet.Kanban, - viewOptions: issuesOptions, + viewOptions: { + ...issuesOptions, + groupDepth: 1 + }, config: [] }) @@ -876,6 +888,22 @@ export function createModel (builder: Builder): void { fields: ['assignee'] }) + builder.mixin(tracker.class.IssueStatus, core.class.Class, view.mixin.AllValuesFunc, { + func: tracker.function.GetAllStatuses + }) + + builder.mixin(tracker.class.TypeIssuePriority, core.class.Class, view.mixin.AllValuesFunc, { + func: tracker.function.GetAllPriority + }) + + builder.mixin(tracker.class.Project, core.class.Class, view.mixin.AllValuesFunc, { + func: tracker.function.GetAllProjects + }) + + builder.mixin(tracker.class.Sprint, core.class.Class, view.mixin.AllValuesFunc, { + func: tracker.function.GetAllSprints + }) + builder.createDoc( workbench.class.Application, core.space.Model, @@ -933,13 +961,13 @@ export function createModel (builder: Builder): void { { id: activeId, label: tracker.string.Active, - // icon: tracker.icon.TrackerApplication, + icon: tracker.icon.CategoryStarted, component: tracker.component.Active }, { id: backlogId, label: tracker.string.Backlog, - // icon: tracker.icon.TrackerApplication, + icon: tracker.icon.CategoryBacklog, component: tracker.component.Backlog }, { diff --git a/models/view/src/index.ts b/models/view/src/index.ts index d12f7e72cf..aeded039ec 100644 --- a/models/view/src/index.ts +++ b/models/view/src/index.ts @@ -62,7 +62,8 @@ import type { ViewletDescriptor, ViewletPreference, ViewOptionsModel, - ViewOptions + ViewOptions, + AllValuesFunc } from '@hcengineering/view' import view from './plugin' @@ -215,6 +216,11 @@ export class TSortFuncs extends TClass implements ClassSortFuncs { func!: SortFunc } +@Mixin(view.mixin.AllValuesFunc, core.class.Class) +export class TAllValuesFunc extends TClass implements AllValuesFunc { + func!: Resource<(space: Ref | undefined) => Promise> +} + @Model(view.class.ViewletPreference, preference.class.Preference) export class TViewletPreference extends TPreference implements ViewletPreference { attachedTo!: Ref @@ -339,7 +345,8 @@ export function createModel (builder: Builder): void { TLinkPresenter, TArrayEditor, TInlineAttributEditor, - TFilteredView + TFilteredView, + TAllValuesFunc ) classPresenter( diff --git a/models/view/src/plugin.ts b/models/view/src/plugin.ts index f9208668d8..eb0b236071 100644 --- a/models/view/src/plugin.ts +++ b/models/view/src/plugin.ts @@ -13,10 +13,9 @@ // limitations under the License. // -import { ObjQueryType } from '@hcengineering/core' -import { IntlString, mergeIds, Resource } from '@hcengineering/platform' +import { IntlString, mergeIds } from '@hcengineering/platform' import type { AnyComponent } from '@hcengineering/ui' -import { Filter, ViewAction, viewId } from '@hcengineering/view' +import { FilterFunction, ViewAction, ViewCategoryAction, viewId } from '@hcengineering/view' import view from '@hcengineering/view-resources/src/plugin' export default mergeIds(viewId, view, { @@ -93,13 +92,14 @@ export default mergeIds(viewId, view, { MarkdownFormatting: '' as IntlString }, function: { - FilterObjectInResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterObjectNinResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterValueInResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterValueNinResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterBeforeResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterAfterResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterNestedMatchResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterNestedDontMatchResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>> + FilterObjectInResult: '' as FilterFunction, + FilterObjectNinResult: '' as FilterFunction, + FilterValueInResult: '' as FilterFunction, + FilterValueNinResult: '' as FilterFunction, + FilterBeforeResult: '' as FilterFunction, + FilterAfterResult: '' as FilterFunction, + FilterNestedMatchResult: '' as FilterFunction, + FilterNestedDontMatchResult: '' as FilterFunction, + ShowEmptyGroups: '' as ViewCategoryAction } }) diff --git a/plugins/recruit-resources/src/plugin.ts b/plugins/recruit-resources/src/plugin.ts index 722eef0062..99871f019e 100644 --- a/plugins/recruit-resources/src/plugin.ts +++ b/plugins/recruit-resources/src/plugin.ts @@ -13,13 +13,13 @@ // limitations under the License. // -import { Client, Doc, ObjQueryType, Ref, Space } from '@hcengineering/core' +import { Client, Doc, Ref, Space } from '@hcengineering/core' import type { IntlString, Resource, StatusCode } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform' import recruit, { recruitId } from '@hcengineering/recruit' import { TagCategory } from '@hcengineering/tags' import { AnyComponent } from '@hcengineering/ui' -import { Filter, FilterMode } from '@hcengineering/view' +import { FilterFunction, FilterMode } from '@hcengineering/view' export default mergeIds(recruitId, recruit, { status: { @@ -137,9 +137,9 @@ export default mergeIds(recruitId, recruit, { }, function: { ApplicationTitleProvider: '' as Resource<(client: Client, ref: Ref) => Promise>, - HasActiveApplicant: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - HasNoActiveApplicant: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - NoneApplications: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>> + HasActiveApplicant: '' as FilterFunction, + HasNoActiveApplicant: '' as FilterFunction, + NoneApplications: '' as FilterFunction }, filter: { HasActive: '' as Ref, diff --git a/plugins/tags-resources/src/plugin.ts b/plugins/tags-resources/src/plugin.ts index 4cd9ee1145..f7f885e3ac 100644 --- a/plugins/tags-resources/src/plugin.ts +++ b/plugins/tags-resources/src/plugin.ts @@ -11,11 +11,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ObjQueryType } from '@hcengineering/core' import { IntlString, mergeIds, Resource } from '@hcengineering/platform' import tags, { tagsId } from '@hcengineering/tags' import { AnyComponent } from '@hcengineering/ui' -import { Filter } from '@hcengineering/view' +import { FilterFunction } from '@hcengineering/view' export default mergeIds(tagsId, tags, { component: { @@ -53,8 +52,8 @@ export default mergeIds(tagsId, tags, { Initial: '' as IntlString }, function: { - FilterTagsInResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, - FilterTagsNinResult: '' as Resource<(filter: Filter, onUpdate: () => void) => Promise>>, + FilterTagsInResult: '' as FilterFunction, + FilterTagsNinResult: '' as FilterFunction, CreateTagElement: '' as Resource<(props?: Record) => Promise> } }) diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index fd9f288b55..6df8052afd 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -118,7 +118,6 @@ "Grouping": "Grouping", "Ordering": "Ordering", "CompletedIssues": "Completed issues", - "ShowEmptyGroups": "Show empty groups", "NoGrouping": "No grouping", "NoAssignee": "No assignee", "LastUpdated": "Last updated", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index af3948be25..12203d9001 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -118,7 +118,6 @@ "Grouping": "Группировка", "Ordering": "Сортировка", "CompletedIssues": "Завершённые задачи", - "ShowEmptyGroups": "Показывать пустые группы", "NoGrouping": "Нет группировки", "NoAssignee": "Нет исполнителя", "LastUpdated": "Последнее обновление", diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index 409bf9f7c2..6bcb9e922e 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -13,25 +13,26 @@ // limitations under the License. --> {#if !states?.length} @@ -211,11 +278,17 @@ on:contextmenu={(evt) => showMenu(evt.detail.evt, evt.detail.objects)} > - {@const stateWLU = getState(state)} + {@const status = statusesMap.get(state._id)}
- {#if stateWLU !== undefined}{/if} + {#if state.icon} + {#if groupBy === 'status' && status} + + {:else} + + {/if} + {/if} {state.title} {count}
diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 924ef1c35f..0a47de049b 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -106,7 +106,17 @@ import IssueTemplates from './components/templates/IssueTemplates.svelte' import EditIssueTemplate from './components/templates/EditIssueTemplate.svelte' import TemplateEstimationEditor from './components/templates/EstimationEditor.svelte' import MoveAndDeleteSprintPopup from './components/sprints/MoveAndDeleteSprintPopup.svelte' -import { moveIssuesToAnotherSprint, issueStatusSort, issuePrioritySort, sprintSort, subIssueQuery } from './utils' +import { + moveIssuesToAnotherSprint, + issueStatusSort, + issuePrioritySort, + sprintSort, + subIssueQuery, + getAllStatuses, + getAllPriority, + getAllProjects, + getAllSprints +} from './utils' import { deleteObject } from '@hcengineering/view-resources/src/utils' import CreateTeam from './components/teams/CreateTeam.svelte' @@ -384,7 +394,11 @@ export default async (): Promise => ({ IssueStatusSort: issueStatusSort, IssuePrioritySort: issuePrioritySort, SprintSort: sprintSort, - SubIssueQuery: subIssueQuery + SubIssueQuery: subIssueQuery, + GetAllStatuses: getAllStatuses, + GetAllPriority: getAllPriority, + GetAllProjects: getAllProjects, + GetAllSprints: getAllSprints }, actionImpl: { EditWorkflowStatuses: editWorkflowStatuses, diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index d9cbd0c332..ab5cb6b03b 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. // -import { Client, Doc, DocumentQuery, Ref } from '@hcengineering/core' +import { Client, Doc, Ref, Space } from '@hcengineering/core' import type { IntlString, Metadata, Resource } from '@hcengineering/platform' import { mergeIds } from '@hcengineering/platform' -import { IssueDraft } from '@hcengineering/tracker' +import { IssueDraft, IssuePriority, IssueStatus, Project, Sprint } from '@hcengineering/tracker' import { AnyComponent } from '@hcengineering/ui' -import { SortFunc, Viewlet } from '@hcengineering/view' +import { SortFunc, Viewlet, ViewQueryAction } from '@hcengineering/view' import tracker, { trackerId } from '../../tracker/lib' export default mergeIds(trackerId, tracker, { @@ -143,7 +143,6 @@ export default mergeIds(trackerId, tracker, { Grouping: '' as IntlString, Ordering: '' as IntlString, CompletedIssues: '' as IntlString, - ShowEmptyGroups: '' as IntlString, NoGrouping: '' as IntlString, NoAssignee: '' as IntlString, LastUpdated: '' as IntlString, @@ -377,6 +376,10 @@ export default mergeIds(trackerId, tracker, { IssueStatusSort: '' as SortFunc, IssuePrioritySort: '' as SortFunc, SprintSort: '' as SortFunc, - SubIssueQuery: '' as Resource<(value: any, query: DocumentQuery) => DocumentQuery> + SubIssueQuery: '' as ViewQueryAction, + GetAllStatuses: '' as Resource<(space: Ref | undefined) => Promise>>>, + GetAllPriority: '' as Resource<(space: Ref | undefined) => Promise>, + GetAllProjects: '' as Resource<(space: Ref | undefined) => Promise>>>, + GetAllSprints: '' as Resource<(space: Ref | undefined) => Promise>>> } }) diff --git a/plugins/tracker-resources/src/utils.ts b/plugins/tracker-resources/src/utils.ts index ebeb879957..d9fe4bc877 100644 --- a/plugins/tracker-resources/src/utils.ts +++ b/plugins/tracker-resources/src/utils.ts @@ -13,13 +13,14 @@ // limitations under the License. // -import { Employee } from '@hcengineering/contact' +import { Employee, formatName } from '@hcengineering/contact' import core, { AttachedData, Doc, DocumentQuery, Ref, SortingOrder, + Space, toIdMap, TxCollectionCUD, TxOperations, @@ -37,6 +38,7 @@ import { IssuesOrdering, IssueStatus, IssueTemplateData, + Project, ProjectStatus, Sprint, SprintStatus, @@ -51,7 +53,6 @@ import { isWeekend, MILLISECONDS_IN_WEEK } from '@hcengineering/ui' -import { ViewOptionModel } from '@hcengineering/view' import { ListSelectionProvider, SelectDirection } from '@hcengineering/view-resources' import tracker from './plugin' import { defaultPriorities, defaultProjectStatuses, defaultSprintStatuses, issuePriorities } from './types' @@ -360,154 +361,108 @@ export async function sprintSort (value: Array>): Promise> +export async function mapKanbanCategories ( + groupBy: string, + categories: any[], + statuses: Array>, + projects: Project[], + sprints: Sprint[], + assignee: Employee[] ): Promise { if (groupBy === IssuesGrouping.NoGrouping) { return [{ _id: undefined, color: UNSET_COLOR, title: await translate(tracker.string.NoGrouping, {}) }] } if (groupBy === IssuesGrouping.Priority) { - const states = issues.reduce((result, issue) => { - const { priority } = issue - if (result.find(({ _id }) => _id === priority) !== undefined) return result - return [ - ...result, - { - _id: priority, - title: issuePriorities[priority].label, - color: UNSET_COLOR, - icon: issuePriorities[priority].icon - } - ] - }, []) - await Promise.all( - states.map(async (state) => { - state.title = await translate(state.title as IntlString, {}) + const res: TypeState[] = [] + for (const priority of categories) { + const title = await translate((issuePriorities as any)[priority].label, {}) + res.push({ + _id: priority, + title, + color: UNSET_COLOR, + icon: (issuePriorities as any)[priority].icon }) - ) - return states + } + return res } if (groupBy === IssuesGrouping.Status) { - return issues.reduce((result, issue) => { - const status = issue.$lookup?.status - if (status === undefined || result.find(({ _id }) => _id === status._id) !== undefined) return result - const category = '$lookup' in status ? status.$lookup?.category : undefined - return [ - ...result, - { + return statuses + .filter((p) => categories.includes(p._id)) + .map((status) => { + const category = '$lookup' in status ? status.$lookup?.category : undefined + return { _id: status._id, title: status.name, icon: category?.icon, color: status.color ?? category?.color ?? UNSET_COLOR } - ] - }, []) + }) } if (groupBy === IssuesGrouping.Assignee) { const noAssignee = await translate(tracker.string.NoAssignee, {}) - return issues.reduce((result, issue) => { - if (result.find(({ _id }) => _id === issue.assignee) !== undefined) return result - return [ - ...result, - { - _id: issue.assignee, - title: issue.$lookup?.assignee?.name ?? noAssignee, + const res: TypeState[] = assignee + .filter((p) => categories.includes(p._id)) + .map((employee) => { + return { + _id: employee._id, + title: formatName(employee.name), color: UNSET_COLOR, icon: undefined } - ] - }, []) + }) + if (categories.includes(undefined)) { + res.push({ + _id: null, + title: noAssignee, + color: UNSET_COLOR, + icon: undefined + }) + } + return res } if (groupBy === IssuesGrouping.Project) { const noProject = await translate(tracker.string.NoProject, {}) - return issues.reduce((result, issue) => { - if (result.find(({ _id }) => _id === issue.project) !== undefined) return result - return [ - ...result, - { - _id: issue.project, - title: issue.$lookup?.project?.label ?? noProject, - color: UNSET_COLOR, - icon: undefined - } - ] - }, []) + const res: TypeState[] = projects + .filter((p) => categories.includes(p._id)) + .map((project) => ({ + _id: project._id, + title: project.label, + color: UNSET_COLOR, + icon: undefined + })) + if (categories.includes(undefined)) { + res.push({ + _id: null, + title: noProject, + color: UNSET_COLOR, + icon: undefined + }) + } + return res } if (groupBy === IssuesGrouping.Sprint) { const noSprint = await translate(tracker.string.NoSprint, {}) - return issues.reduce((result, issue) => { - if (result.find(({ _id }) => _id === issue.sprint) !== undefined) return result - return [ - ...result, - { - _id: issue.sprint, - title: issue.$lookup?.sprint?.label ?? noSprint, - color: UNSET_COLOR, - icon: undefined - } - ] - }, []) + const res: TypeState[] = sprints + .filter((p) => categories.includes(p._id)) + .map((sprint) => ({ + _id: sprint._id, + title: sprint.label, + color: UNSET_COLOR, + icon: undefined + })) + if (categories.includes(undefined)) { + res.push({ + _id: null, + title: noSprint, + color: UNSET_COLOR, + icon: undefined + }) + } + return res } return [] } -export function getIssueStatusStates (issueStatuses: Array> = []): TypeState[] { - return issueStatuses.map((status) => ({ - _id: status._id, - title: status.name, - color: status.color ?? status.$lookup?.category?.color ?? UNSET_COLOR, - icon: status.$lookup?.category?.icon ?? undefined - })) -} - -export async function getPriorityStates (): Promise { - return await Promise.all( - defaultPriorities.map(async (priority) => ({ - _id: priority, - title: await translate(issuePriorities[priority].label, {}), - color: UNSET_COLOR, - icon: issuePriorities[priority].icon - })) - ) -} - -export function getDefaultViewOptionsTemplatesConfig (): ViewOptionModel[] { - const groupByCategory: ViewOptionModel = { - key: 'groupBy', - label: tracker.string.Grouping, - defaultValue: 'project', - values: [ - { id: 'assignee', label: tracker.string.Assignee }, - { id: 'priority', label: tracker.string.Priority }, - { id: 'project', label: tracker.string.Project }, - { id: 'sprint', label: tracker.string.Sprint }, - { id: '#no_category', label: tracker.string.NoGrouping } - ], - type: 'dropdown' - } - const orderByCategory: ViewOptionModel = { - key: 'orderBy', - label: tracker.string.Ordering, - defaultValue: 'priority', - values: [ - { id: 'modifiedOn', label: tracker.string.LastUpdated }, - { id: 'priority', label: tracker.string.Priority }, - { id: 'dueDate', label: tracker.string.DueDate } - ], - type: 'dropdown' - } - const showEmptyGroups: ViewOptionModel = { - key: 'shouldShowEmptyGroups', - label: tracker.string.ShowEmptyGroups, - defaultValue: false, - type: 'toggle' - } - const result: ViewOptionModel[] = [groupByCategory, orderByCategory] - result.push(showEmptyGroups) - return result -} - /** * @public */ @@ -591,6 +546,43 @@ export function subIssueQuery (value: boolean, query: DocumentQuery): Doc return value ? query : { ...query, attachedTo: tracker.ids.NoParent } } +export async function getAllStatuses (space: Ref | undefined): Promise> | undefined> { + if (space === undefined) return + return await new Promise((resolve) => { + const query = createQuery(true) + query.query(tracker.class.IssueStatus, { space }, (res) => { + resolve(res.map((p) => p._id)) + query.unsubscribe() + }) + }) +} + +export async function getAllPriority (space: Ref | undefined): Promise { + return defaultPriorities +} + +export async function getAllProjects (space: Ref | undefined): Promise> | undefined> { + if (space === undefined) return + return await new Promise((resolve) => { + const query = createQuery(true) + query.query(tracker.class.Project, { space }, (res) => { + resolve(res.map((p) => p._id)) + query.unsubscribe() + }) + }) +} + +export async function getAllSprints (space: Ref | undefined): Promise> | undefined> { + if (space === undefined) return + return await new Promise((resolve) => { + const query = createQuery(true) + query.query(tracker.class.Sprint, { space }, (res) => { + resolve(res.map((p) => p._id)) + query.unsubscribe() + }) + }) +} + export function subIssueListProvider (subIssues: Issue[], target: Ref): void { const listProvider = new ListSelectionProvider((offset: 1 | -1 | 0, of?: Doc, dir?: SelectDirection) => { if (dir === 'vertical') { diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index bde2a5baa1..f2182b0aad 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -387,17 +387,6 @@ export interface Scrum extends Doc { attachments?: number } -/** - * @public - */ -export interface ViewOptions { - groupBy: IssuesGrouping - orderBy: IssuesOrdering - completedIssuesPeriod: IssuesDateModificationPeriod - shouldShowEmptyGroups: boolean - shouldShowSubIssues: boolean -} - /** * @public */ diff --git a/plugins/view-assets/lang/en.json b/plugins/view-assets/lang/en.json index 2c183532c5..7643a6fe98 100644 --- a/plugins/view-assets/lang/en.json +++ b/plugins/view-assets/lang/en.json @@ -64,6 +64,7 @@ "Then": "Then", "ShowPreviewOnClick": "Please click to show document index preview...", "Showed": "Showed", - "Total": "Total" + "Total": "Total", + "ShowEmptyGroups": "Show empty groups" } } diff --git a/plugins/view-assets/lang/ru.json b/plugins/view-assets/lang/ru.json index d8a740970e..4b7e09a148 100644 --- a/plugins/view-assets/lang/ru.json +++ b/plugins/view-assets/lang/ru.json @@ -61,6 +61,7 @@ "Then": "Затем", "ShowPreviewOnClick": "Пожалуйста нажмите чтобы увидеть предпросмотр...", "Showed": "Показано", - "Total": "Всего" + "Total": "Всего", + "ShowEmptyGroups": "Показывать пустые группы" } } diff --git a/plugins/view-resources/src/components/ValueSelector.svelte b/plugins/view-resources/src/components/ValueSelector.svelte index 68825c7b34..d2dda11e6b 100644 --- a/plugins/view-resources/src/components/ValueSelector.svelte +++ b/plugins/view-resources/src/components/ValueSelector.svelte @@ -33,7 +33,6 @@ const dispatch = createEventDispatcher() const changeStatus = async (newStatus: any) => { - console.log('CHANGE VALUE', newStatus) if (newStatus === '#null') { newStatus = null return @@ -120,7 +119,6 @@ { - console.log(evt) changeStatus(evt.detail) }} placeholder={placeholder ?? view.string.Filter} @@ -138,7 +136,6 @@ allowDeselect={true} selected={current} on:close={(evt) => { - console.log(evt) changeStatus(evt.detail === null ? null : evt.detail?._id) }} placeholder={placeholder ?? view.string.Filter} diff --git a/plugins/view-resources/src/components/ViewOptions.svelte b/plugins/view-resources/src/components/ViewOptions.svelte index ba323e811a..79ddacad68 100644 --- a/plugins/view-resources/src/components/ViewOptions.svelte +++ b/plugins/view-resources/src/components/ViewOptions.svelte @@ -34,16 +34,11 @@ } }) - $: groups = - viewOptions.groupBy[viewOptions.groupBy.length - 1] === noCategory - ? viewOptions.groupBy - : [...viewOptions.groupBy, noCategory] - function selectGrouping (value: string, i: number) { viewOptions.groupBy[i] = value if (value === noCategory) { - viewOptions.groupBy.length = i - } else { + viewOptions.groupBy.length = i + 1 + } else if (config.groupDepth === undefined || config.groupDepth > viewOptions.groupBy.length) { viewOptions.groupBy.length = i + 1 viewOptions.groupBy[i + 1] = noCategory } @@ -62,7 +57,7 @@
- {#each groups as group, i} + {#each viewOptions.groupBy as group, i}
- {#each config.other as model} + {#each config.other.filter((p) => !p.hidden?.(viewOptions)) as model}
{#if isToggleType(model)} { viewOptions[model.key] = !viewOptions[model.key] dispatch('update', { key: model.key, value: viewOptions[model.key] }) @@ -109,7 +104,7 @@ { diff --git a/plugins/view-resources/src/components/ViewletSetting.svelte b/plugins/view-resources/src/components/ViewletSetting.svelte index 159028e89d..cacaefc6bd 100644 --- a/plugins/view-resources/src/components/ViewletSetting.svelte +++ b/plugins/view-resources/src/components/ViewletSetting.svelte @@ -347,8 +347,6 @@ }, getEventPositionElement(e), (val) => { - console.log('val') - console.log(val) if (val !== undefined) { const value = classes.get(_class)?.find((it) => it.value === val) if (value) { diff --git a/plugins/view-resources/src/components/filter/ValueFilter.svelte b/plugins/view-resources/src/components/filter/ValueFilter.svelte index 20ccb7eaf7..8f5f882290 100644 --- a/plugins/view-resources/src/components/filter/ValueFilter.svelte +++ b/plugins/view-resources/src/components/filter/ValueFilter.svelte @@ -58,7 +58,6 @@ const attr = hieararchy.getAttribute(filter.key._class, filter.key.key) if (hieararchy.isMixin(attr.attributeOf)) { prefix = attr.attributeOf + '.' - console.log('prefix', prefix) } objectsPromise = client.findAll( _class, diff --git a/plugins/view-resources/src/components/list/ListCategories.svelte b/plugins/view-resources/src/components/list/ListCategories.svelte index 90161b29b9..647a792f02 100644 --- a/plugins/view-resources/src/components/list/ListCategories.svelte +++ b/plugins/view-resources/src/components/list/ListCategories.svelte @@ -14,11 +14,11 @@ -->