From ca2b5ba0f3ea75aa1bf990d2d76c4ba3bdf94918 Mon Sep 17 00:00:00 2001 From: Ruslan Izhitsky Date: Wed, 27 Apr 2022 15:47:29 +0700 Subject: [PATCH] Chunter: file browser additional fixes (#1547) Signed-off-by: Ruslan Izhitsky --- models/chunter/src/index.ts | 5 +- packages/presentation/lang/en.json | 3 + packages/presentation/lang/ru.json | 3 + .../src/components/SpaceInfo.svelte | 10 +- .../src/components/SpaceMultiBoxList.svelte | 73 ++++ .../src/components/SpacesMultiPopup.svelte | 114 ++++++ packages/presentation/src/index.ts | 2 + packages/presentation/src/plugin.ts | 3 + plugins/attachment-assets/lang/en.json | 3 + plugins/attachment-assets/lang/ru.json | 3 + .../src/components/FileBrowser.svelte | 326 +++++------------- .../src/components/FileBrowserFilters.svelte | 82 +++++ .../src/components/FileBrowserSortMenu.svelte | 83 +++++ .../src/components/icons/Pause.svelte | 26 +- .../src/components/icons/Play.svelte | 13 +- plugins/attachment-resources/src/index.ts | 140 +++++++- plugins/attachment-resources/src/plugin.ts | 15 +- plugins/attachment/src/index.ts | 14 +- .../EditChannelDescriptionAttachments.svelte | 1 + 19 files changed, 658 insertions(+), 261 deletions(-) create mode 100644 packages/presentation/src/components/SpaceMultiBoxList.svelte create mode 100644 packages/presentation/src/components/SpacesMultiPopup.svelte create mode 100644 plugins/attachment-resources/src/components/FileBrowserFilters.svelte create mode 100644 plugins/attachment-resources/src/components/FileBrowserSortMenu.svelte diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index 84e6b0f80d..cf6ec3ec98 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -334,7 +334,10 @@ export function createModel (builder: Builder): void { id: 'fileBrowser', label: attachment.string.FileBrowser, icon: attachment.icon.FileBrowser, - component: attachment.component.FileBrowser + component: attachment.component.FileBrowser, + componentProps: { + requestedSpaceClasses: [chunter.class.Channel, chunter.class.DirectMessage] + } } ], spaces: [ diff --git a/packages/presentation/lang/en.json b/packages/presentation/lang/en.json index 42654fad15..e3d07f4d9a 100644 --- a/packages/presentation/lang/en.json +++ b/packages/presentation/lang/en.json @@ -8,15 +8,18 @@ "Close": "Close", "NotSelected": "Not selected", "Deselect": "Deselect", + "Archived": "(archived)", "AddSocialLinks": "Add social links", "EditSocialLinks": "Edit social links", "Change": "Change", "Remove": "Remove", "Members": "Members", "Search": "Search...", + "Spaces": "Spaces", "Unassigned": "Unassigned", "CreateMore": "Create more", "NumberMembers": "{count, plural, =0 {no members} =1 {1 member} other {# members}}", + "NumberSpaces": "{count, plural, =0 {In} =1 {In 1 place} other {In # places}}", "InThis": "In this {space}", "NoMatchesInThis": "No matches in this {space}", "NoMatchesFound": "No matches found", diff --git a/packages/presentation/lang/ru.json b/packages/presentation/lang/ru.json index c4337c18f5..330b30600e 100644 --- a/packages/presentation/lang/ru.json +++ b/packages/presentation/lang/ru.json @@ -8,15 +8,18 @@ "Close": "Закрыть", "NotSelected": "Не выбрано", "Deselect": "Снять выделение", + "Archived": "(архивирован)", "AddSocialLinks": "Добавить контактную информацию", "EditSocialLinks": "Редактировать контактную информацию", "Change": "Изменить", "Remove": "Удалить", "Members": "Участники", "Search": "Поиск...", + "Spaces": "Пространства", "Unassigned": "Не назначен", "CreateMore": "Создать еще", "NumberMembers": "{count, plural, =0 {нет участников} =1 {1 участник} other {# участника}}", + "NumberSpaces": "{count, plural, =0 {В} =1 {В 1 месте} other {В # местах}}", "InThis": "В этом {space}", "NoMatchesInThis": "В этом {space} совпадения не обнаружены", "NoMatchesFound": "Не найдено соответсвий", diff --git a/packages/presentation/src/components/SpaceInfo.svelte b/packages/presentation/src/components/SpaceInfo.svelte index c8000e1171..67c5a7fd0d 100644 --- a/packages/presentation/src/components/SpaceInfo.svelte +++ b/packages/presentation/src/components/SpaceInfo.svelte @@ -14,9 +14,10 @@ --> + + + + diff --git a/packages/presentation/src/components/SpacesMultiPopup.svelte b/packages/presentation/src/components/SpacesMultiPopup.svelte new file mode 100644 index 0000000000..0a10e3e9fe --- /dev/null +++ b/packages/presentation/src/components/SpacesMultiPopup.svelte @@ -0,0 +1,114 @@ + + + +
+
+ +
+
+
+ {#each shownSpaces as space} + + {/each} +
+
+
diff --git a/packages/presentation/src/index.ts b/packages/presentation/src/index.ts index 2412487e1f..18c815b016 100644 --- a/packages/presentation/src/index.ts +++ b/packages/presentation/src/index.ts @@ -29,6 +29,8 @@ export { default as MessageBox } from './components/MessageBox.svelte' export { default as MessageViewer } from './components/MessageViewer.svelte' export { default as PDFViewer } from './components/PDFViewer.svelte' export { default as SpaceCreateCard } from './components/SpaceCreateCard.svelte' +export { default as SpacesMultiPopup } from './components/SpacesMultiPopup.svelte' +export { default as SpaceMultiBoxList } from './components/SpaceMultiBoxList.svelte' export { default as SpaceSelect } from './components/SpaceSelect.svelte' export { default as UserBox } from './components/UserBox.svelte' export { default as UserBoxList } from './components/UserBoxList.svelte' diff --git a/packages/presentation/src/plugin.ts b/packages/presentation/src/plugin.ts index e23d7e02d0..06b2434ebb 100644 --- a/packages/presentation/src/plugin.ts +++ b/packages/presentation/src/plugin.ts @@ -37,15 +37,18 @@ export default plugin(presentationId, { Close: '' as IntlString, NotSelected: '' as IntlString, Deselect: '' as IntlString, + Archived: '' as IntlString, AddSocialLinks: '' as IntlString, EditSocialLinks: '' as IntlString, Change: '' as IntlString, Remove: '' as IntlString, Members: '' as IntlString, Search: '' as IntlString, + Spaces: '' as IntlString, Unassigned: '' as IntlString, CreateMore: '' as IntlString, NumberMembers: '' as IntlString, + NumberSpaces: '' as IntlString, InThis: '' as IntlString, NoMatchesInThis: '' as IntlString, NoMatchesFound: '' as IntlString, diff --git a/plugins/attachment-assets/lang/en.json b/plugins/attachment-assets/lang/en.json index b76fe4e96d..513b334f3a 100644 --- a/plugins/attachment-assets/lang/en.json +++ b/plugins/attachment-assets/lang/en.json @@ -21,10 +21,13 @@ "FileBrowserFilterIn": "In", "FileBrowserFilterDate": "Date", "FileBrowserFilterFileType": "File type", + "FileBrowserSort": "Sort:", "FileBrowserSortNewest": "Newest file", "FileBrowserSortOldest": "Oldest file", "FileBrowserSortAZ": "A to Z", "FileBrowserSortZA": "Z to A", + "FileBrowserSortSmallest": "Smallest file", + "FileBrowserSortBiggest": "Biggest file", "FileBrowserDateFilterAny": "Any time", "FileBrowserDateFilterToday": "Today", "FileBrowserDateFilterYesterday": "Yesterday", diff --git a/plugins/attachment-assets/lang/ru.json b/plugins/attachment-assets/lang/ru.json index 35fe1ffde8..11ca516c53 100644 --- a/plugins/attachment-assets/lang/ru.json +++ b/plugins/attachment-assets/lang/ru.json @@ -21,10 +21,13 @@ "FileBrowserFilterIn": "В", "FileBrowserFilterDate": "Дата", "FileBrowserFilterFileType": "Тип файла", + "FileBrowserSort": "Сортировка:", "FileBrowserSortNewest": "Самый новый файл", "FileBrowserSortOldest": "Самый старый файл", "FileBrowserSortAZ": "От А до Я", "FileBrowserSortZA": "От Я до А", + "FileBrowserSortSmallest": "Самый маленький файл", + "FileBrowserSortBiggest": "Самый большой файл", "FileBrowserDateFilterAny": "В любое время", "FileBrowserDateFilterToday": "Сегодня", "FileBrowserDateFilterYesterday": "Вчера", diff --git a/plugins/attachment-resources/src/components/FileBrowser.svelte b/plugins/attachment-resources/src/components/FileBrowser.svelte index 1110608a61..57faf93eca 100644 --- a/plugins/attachment-resources/src/components/FileBrowser.svelte +++ b/plugins/attachment-resources/src/components/FileBrowser.svelte @@ -16,127 +16,46 @@ import { Attachment } from '@anticrm/attachment' import contact, { Employee } from '@anticrm/contact' import { EmployeeAccount } from '@anticrm/contact' - import { Doc, getCurrentAccount, Ref, SortingOrder, SortingQuery, Space } from '@anticrm/core' - import { IntlString } from '@anticrm/platform' - import { getClient, UserBoxList } from '@anticrm/presentation' - import { DropdownLabelsIntl, IconMoreV, Label, Menu as UIMenu, showPopup } from '@anticrm/ui' + import core, { Class, Doc, getCurrentAccount, Ref, Space } from '@anticrm/core' + import { getClient } from '@anticrm/presentation' + import ui, { + getCurrentLocation, + location, + IconMoreV, + IconSearch, + Label, + showPopup, + navigate, + EditWithIcon, + Spinner + } from '@anticrm/ui' import { Menu } from '@anticrm/view-resources' - import { AttachmentPresenter } from '..' + import { onDestroy } from 'svelte' + import { + AttachmentPresenter, + FileBrowserSortMode, + dateFileBrowserFilters, + fileTypeFileBrowserFilters, + sortModeToOptionObject + } from '..' import attachment from '../plugin' - - enum SortMode { - NewestFile, - OldestFile, - AscendingAlphabetical, - DescendingAlphabetical - } - - const msInDay = 24 * 60 * 60 * 1000 - const getBeginningOfToday = () => { - const date = new Date() - date.setUTCHours(0, 0, 0, 0) - return date.getTime() - } - const dateObjects = [ - { - id: 'dateAny', - label: attachment.string.FileBrowserDateFilterAny, - getDate: () => { - return undefined - } - }, - { - id: 'dateToday', - label: attachment.string.FileBrowserDateFilterToday, - getDate: () => { - return { $gte: getBeginningOfToday() } - } - }, - { - id: 'dateYesterday', - label: attachment.string.FileBrowserDateFilterYesterday, - getDate: () => { - return { $gte: getBeginningOfToday() - msInDay, $lt: getBeginningOfToday() } - } - }, - { - id: 'date7Days', - label: attachment.string.FileBrowserDateFilter7Days, - getDate: () => { - return { $gte: getBeginningOfToday() - msInDay * 6 } - } - }, - { - id: 'date30Days', - label: attachment.string.FileBrowserDateFilter30Days, - getDate: () => { - return { $gte: getBeginningOfToday() - msInDay * 29 } - } - }, - { - id: 'date3Months', - label: attachment.string.FileBrowserDateFilter3Months, - getDate: () => { - return { $gte: getBeginningOfToday() - msInDay * 90 } - } - }, - { - id: 'date12Months', - label: attachment.string.FileBrowserDateFilter12Months, - getDate: () => { - return { $gte: getBeginningOfToday() - msInDay * 364 } - } - } - ] - - const fileTypeObjects = [ - { - id: 'typeAny', - label: attachment.string.FileBrowserTypeFilterAny, - getType: () => { - return undefined - } - }, - { - id: 'typeImage', - label: attachment.string.FileBrowserTypeFilterImages, - getType: () => { - return { $like: '%image/%' } - } - }, - { - id: 'typeAudio', - label: attachment.string.FileBrowserTypeFilterAudio, - getType: () => { - return { $like: '%audio/%' } - } - }, - { - id: 'typeVideo', - label: attachment.string.FileBrowserTypeFilterVideos, - getType: () => { - return { $like: '%video/%' } - } - }, - { - id: 'typePDF', - label: attachment.string.FileBrowserTypeFilterPDFs, - getType: () => { - return 'application/pdf' - } - } - ] + import FileBrowserFilters from './FileBrowserFilters.svelte' + import FileBrowserSortMenu from './FileBrowserSortMenu.svelte' const client = getClient() - export let space: Space | undefined + const loc = getCurrentLocation() + const spaceId: Ref | undefined = loc.query?.spaceId as Ref | undefined + export let requestedSpaceClasses: Ref>[] = [] const currentUser = getCurrentAccount() as EmployeeAccount - let participants: Ref[] = [currentUser.employee] - const assignee: Ref | null = null + let selectedParticipants: Ref[] = [currentUser.employee] + let selectedSpaces: Ref[] = [] + let searchQuery: string = '' + let isLoading = false let attachments: Attachment[] = [] let selectedFileNumber: number | undefined - let selectedSort: SortMode = SortMode.NewestFile + let selectedSort: FileBrowserSortMode = FileBrowserSortMode.NewestFile let selectedDateId = 'dateAny' let selectedFileTypeId = 'typeAny' @@ -147,135 +66,89 @@ }) } - const showSortMenu = async (ev: Event): Promise => { - showPopup( - UIMenu, - { - actions: [ - { - label: sortModeToString(SortMode.NewestFile), - action: () => { - selectedSort = SortMode.NewestFile - } - }, - { - label: sortModeToString(SortMode.OldestFile), - action: () => { - selectedSort = SortMode.OldestFile - } - }, - { - label: sortModeToString(SortMode.AscendingAlphabetical), - action: () => { - selectedSort = SortMode.AscendingAlphabetical - } - }, - { - label: sortModeToString(SortMode.DescendingAlphabetical), - action: () => { - selectedSort = SortMode.DescendingAlphabetical - } - } - ] - }, - ev.target as HTMLElement - ) - } + $: fetch(searchQuery, selectedSort, selectedFileTypeId, selectedDateId, selectedParticipants, selectedSpaces) - const sortModeToString = (sortMode: SortMode): IntlString<{}> => { - switch (sortMode) { - case SortMode.NewestFile: - return attachment.string.FileBrowserSortNewest - case SortMode.OldestFile: - return attachment.string.FileBrowserSortOldest - case SortMode.AscendingAlphabetical: - return attachment.string.FileBrowserSortAZ - case SortMode.DescendingAlphabetical: - return attachment.string.FileBrowserSortZA + async function fetch( + searchQuery_: string, + selectedSort_: FileBrowserSortMode, + selectedFileTypeId_: string, + selectedDateId_: string, + selectedParticipants_: Ref[], + selectedSpaces_: Ref[] + ) { + isLoading = true + + const nameQuery = searchQuery_ ? { name: { $like: '%' + searchQuery_ + '%' } } : {} + + const accounts = await client.findAll(contact.class.EmployeeAccount, { employee: { $in: selectedParticipants_ } }) + const senderQuery = accounts.length ? { modifiedBy: { $in: accounts.map((a) => a._id) } } : {} + + let spaceQuery: { space: any } + if (selectedSpaces_.length) { + spaceQuery = { space: { $in: selectedSpaces_ } } + } else { + // nothing is selected in space filter - show all available attachments (except for the archived channels) + const allSpaces = await client.findAll(core.class.Space, { + archived: false, + _class: { $in: requestedSpaceClasses } + }) + const availableSpaces = allSpaces + .filter((sp) => !sp.private || sp.members.includes(currentUser._id)) + .map((sp) => sp._id) + spaceQuery = { space: { $in: availableSpaces } } } - } - const sortModeToOptionObject = (sortMode: SortMode): SortingQuery => { - switch (sortMode) { - case SortMode.NewestFile: - return { modifiedOn: SortingOrder.Descending } - case SortMode.OldestFile: - return { modifiedOn: SortingOrder.Ascending } - case SortMode.AscendingAlphabetical: - return { name: SortingOrder.Ascending } - case SortMode.DescendingAlphabetical: - return { name: SortingOrder.Descending } - } - } - - $: fetch(selectedSort, selectedFileTypeId, selectedDateId) - - async function fetch (selectedSort_: SortMode, selectedFileTypeId_: string, selectedDateId_: string) { - const spaceQuery = space && { space: space._id } - const fileType = fileTypeObjects.find((o) => o.id === selectedFileTypeId_)?.getType() - const typeQuery = fileType && { type: fileType } - const date = dateObjects.find((o) => o.id === selectedDateId_)?.getDate() + const date = dateFileBrowserFilters.find((o) => o.id === selectedDateId_)?.getDate() const dateQuery = date && { modifiedOn: date } + const fileType = fileTypeFileBrowserFilters.find((o) => o.id === selectedFileTypeId_)?.getType() + const fileTypeQuery = fileType && { type: fileType } + attachments = await client.findAll( attachment.class.Attachment, - { ...spaceQuery, ...typeQuery, ...dateQuery }, + { ...nameQuery, ...senderQuery, ...spaceQuery, ...dateQuery, ...fileTypeQuery }, { - sort: sortModeToOptionObject(selectedSort_) + sort: sortModeToOptionObject(selectedSort_), + limit: 200 } ) + isLoading = false } + + onDestroy( + location.subscribe(async (loc) => { + loc.query = undefined + navigate(loc) + }) + )
+
-
-
- { - participants = evt.detail - }} - noItems={attachment.string.NoParticipants} - /> -
- - -
- -
-
- -
-
+
-
showSortMenu(event)}> - {'Sort: '} -
+
- {#if attachments?.length} + {#if isLoading} +
+ +
+ {:else if attachments?.length}
{#each attachments as attachment, i}
@@ -299,9 +172,8 @@ diff --git a/plugins/attachment-resources/src/components/FileBrowserFilters.svelte b/plugins/attachment-resources/src/components/FileBrowserFilters.svelte new file mode 100644 index 0000000000..3043d93fb5 --- /dev/null +++ b/plugins/attachment-resources/src/components/FileBrowserFilters.svelte @@ -0,0 +1,82 @@ + + + +
+
+ { + selectedParticipants = evt.detail + }} + noItems={attachment.string.NoParticipants} + /> +
+
+ { + selectedSpaces = evt.detail + }} + /> +
+
+ +
+
+ +
+
+ + diff --git a/plugins/attachment-resources/src/components/FileBrowserSortMenu.svelte b/plugins/attachment-resources/src/components/FileBrowserSortMenu.svelte new file mode 100644 index 0000000000..c08f3daa3f --- /dev/null +++ b/plugins/attachment-resources/src/components/FileBrowserSortMenu.svelte @@ -0,0 +1,83 @@ + + +
showSortMenu(event)}> +
+ + diff --git a/plugins/attachment-resources/src/components/icons/Pause.svelte b/plugins/attachment-resources/src/components/icons/Pause.svelte index 1cba8460f0..b6182f5b32 100644 --- a/plugins/attachment-resources/src/components/icons/Pause.svelte +++ b/plugins/attachment-resources/src/components/icons/Pause.svelte @@ -19,11 +19,25 @@ - - - - - - + + + + + + diff --git a/plugins/attachment-resources/src/components/icons/Play.svelte b/plugins/attachment-resources/src/components/icons/Play.svelte index 83c4428e1a..7ea44f4325 100644 --- a/plugins/attachment-resources/src/components/icons/Play.svelte +++ b/plugins/attachment-resources/src/components/icons/Play.svelte @@ -19,8 +19,15 @@ - - - + + + diff --git a/plugins/attachment-resources/src/index.ts b/plugins/attachment-resources/src/index.ts index 3b785d543c..926144b2d8 100644 --- a/plugins/attachment-resources/src/index.ts +++ b/plugins/attachment-resources/src/index.ts @@ -24,9 +24,10 @@ import TxAttachmentCreate from './components/activity/TxAttachmentCreate.svelte' import Attachments from './components/Attachments.svelte' import FileBrowser from './components/FileBrowser.svelte' import Photos from './components/Photos.svelte' -import { Resources } from '@anticrm/platform' import { uploadFile, deleteFile } from './utils' import attachment, { Attachment } from '@anticrm/attachment' +import { SortingOrder, SortingQuery } from '@anticrm/core' +import { IntlString, Resources } from '@anticrm/platform' import preference from '@anticrm/preference' import { getClient } from '@anticrm/presentation' @@ -41,6 +42,143 @@ export { AttachmentDocList } +export enum FileBrowserSortMode { + NewestFile, + OldestFile, + AscendingAlphabetical, + DescendingAlphabetical, + SmallestSize, + BiggestSize +} + +export const sortModeToOptionObject = (sortMode: FileBrowserSortMode): SortingQuery => { + switch (sortMode) { + case FileBrowserSortMode.NewestFile: + return { modifiedOn: SortingOrder.Descending } + case FileBrowserSortMode.OldestFile: + return { modifiedOn: SortingOrder.Ascending } + case FileBrowserSortMode.AscendingAlphabetical: + return { name: SortingOrder.Ascending } + case FileBrowserSortMode.DescendingAlphabetical: + return { name: SortingOrder.Descending } + case FileBrowserSortMode.SmallestSize: + return { size: SortingOrder.Ascending } + case FileBrowserSortMode.BiggestSize: + return { size: SortingOrder.Descending } + } +} + +const msInDay = 24 * 60 * 60 * 1000 +const getBeginningOfDate = (customDate?: Date) => { + if (!customDate) { + customDate = new Date() + } + customDate.setUTCHours(0, 0, 0, 0) + return customDate.getTime() +} + +export const dateFileBrowserFilters: { + id: string + label: IntlString<{}> + getDate: () => any +}[] = [ + { + id: 'dateAny', + label: attachment.string.FileBrowserDateFilterAny, + getDate: () => { + return undefined + } + }, + { + id: 'dateToday', + label: attachment.string.FileBrowserDateFilterToday, + getDate: () => { + return { $gte: getBeginningOfDate() } + } + }, + { + id: 'dateYesterday', + label: attachment.string.FileBrowserDateFilterYesterday, + getDate: () => { + return { $gte: getBeginningOfDate() - msInDay, $lt: getBeginningOfDate() } + } + }, + { + id: 'date7Days', + label: attachment.string.FileBrowserDateFilter7Days, + getDate: () => { + return { $gte: getBeginningOfDate() - msInDay * 6 } + } + }, + { + id: 'date30Days', + label: attachment.string.FileBrowserDateFilter30Days, + getDate: () => { + return { $gte: getBeginningOfDate() - msInDay * 29 } + } + }, + { + id: 'date3Months', + label: attachment.string.FileBrowserDateFilter3Months, + getDate: () => { + const now = new Date() + now.setMonth(now.getMonth() - 3) + return { $gte: getBeginningOfDate(now) } + } + }, + { + id: 'date12Months', + label: attachment.string.FileBrowserDateFilter12Months, + getDate: () => { + const now = new Date() + now.setMonth(now.getMonth() - 12) + return { $gte: getBeginningOfDate(now) } + } + } +] + +export const fileTypeFileBrowserFilters: { + id: string + label: IntlString<{}> + getType: () => any +}[] = [ + { + id: 'typeAny', + label: attachment.string.FileBrowserTypeFilterAny, + getType: () => { + return undefined + } + }, + { + id: 'typeImage', + label: attachment.string.FileBrowserTypeFilterImages, + getType: () => { + return { $like: '%image/%' } + } + }, + { + id: 'typeAudio', + label: attachment.string.FileBrowserTypeFilterAudio, + getType: () => { + return { $like: '%audio/%' } + } + }, + { + id: 'typeVideo', + label: attachment.string.FileBrowserTypeFilterVideos, + getType: () => { + return { $like: '%video/%' } + } + }, + { + id: 'typePDF', + label: attachment.string.FileBrowserTypeFilterPDFs, + getType: () => { + return 'application/pdf' + } + } +] + export async function AddAttachmentToSaved(attach: Attachment): Promise { const client = getClient() diff --git a/plugins/attachment-resources/src/plugin.ts b/plugins/attachment-resources/src/plugin.ts index e8317248b8..0470645c21 100644 --- a/plugins/attachment-resources/src/plugin.ts +++ b/plugins/attachment-resources/src/plugin.ts @@ -32,22 +32,13 @@ export default mergeIds(attachmentId, attachment, { FileBrowserFilterIn: '' as IntlString, FileBrowserFilterDate: '' as IntlString, FileBrowserFilterFileType: '' as IntlString, + FileBrowserSort: '' as IntlString, FileBrowserSortNewest: '' as IntlString, FileBrowserSortOldest: '' as IntlString, FileBrowserSortAZ: '' as IntlString, FileBrowserSortZA: '' as IntlString, - FileBrowserDateFilterAny: '' as IntlString, - FileBrowserDateFilterToday: '' as IntlString, - FileBrowserDateFilterYesterday: '' as IntlString, - FileBrowserDateFilter7Days: '' as IntlString, - FileBrowserDateFilter30Days: '' as IntlString, - FileBrowserDateFilter3Months: '' as IntlString, - FileBrowserDateFilter12Months: '' as IntlString, - FileBrowserTypeFilterAny: '' as IntlString, - FileBrowserTypeFilterImages: '' as IntlString, - FileBrowserTypeFilterAudio: '' as IntlString, - FileBrowserTypeFilterVideos: '' as IntlString, - FileBrowserTypeFilterPDFs: '' as IntlString, + FileBrowserSortSmallest: '' as IntlString, + FileBrowserSortBiggest: '' as IntlString, AddAttachmentToSaved: '' as IntlString, RemoveAttachmentFromSaved: '' as IntlString }, diff --git a/plugins/attachment/src/index.ts b/plugins/attachment/src/index.ts index 56a137ce2b..ca1be55b11 100644 --- a/plugins/attachment/src/index.ts +++ b/plugins/attachment/src/index.ts @@ -71,6 +71,18 @@ export default plugin(attachmentId, { Files: '' as IntlString, NoFiles: '' as IntlString, NoParticipants: '' as IntlString, - ShowMoreAttachments: '' as IntlString + ShowMoreAttachments: '' as IntlString, + FileBrowserDateFilterAny: '' as IntlString, + FileBrowserDateFilterToday: '' as IntlString, + FileBrowserDateFilterYesterday: '' as IntlString, + FileBrowserDateFilter7Days: '' as IntlString, + FileBrowserDateFilter30Days: '' as IntlString, + FileBrowserDateFilter3Months: '' as IntlString, + FileBrowserDateFilter12Months: '' as IntlString, + FileBrowserTypeFilterAny: '' as IntlString, + FileBrowserTypeFilterImages: '' as IntlString, + FileBrowserTypeFilterAudio: '' as IntlString, + FileBrowserTypeFilterVideos: '' as IntlString, + FileBrowserTypeFilterPDFs: '' as IntlString } }) diff --git a/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte b/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte index fc0c9c00d6..56dd37bbec 100644 --- a/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte +++ b/plugins/chunter-resources/src/components/EditChannelDescriptionAttachments.svelte @@ -77,6 +77,7 @@ on:click={() => { const loc = getCurrentLocation() loc.path[2] = 'fileBrowser' + loc.query = channel ? { spaceId: channel._id } : {} navigate(loc) }} >