mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-25 01:39:53 +00:00
Removed 'Unstarred all' action (#5756)
Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
parent
e818265c76
commit
56c3f7ed02
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
"DeleteStarred": "Delete starred",
|
|
||||||
"Starred": "Starred",
|
"Starred": "Starred",
|
||||||
"Star": "Star",
|
"Star": "Star",
|
||||||
"Unstar": "Unstar"
|
"Unstar": "Unstar"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
"DeleteStarred": "Eliminar destacados",
|
|
||||||
"Starred": "Destacados",
|
"Starred": "Destacados",
|
||||||
"Star": "Destacar",
|
"Star": "Destacar",
|
||||||
"Unstar": "Eliminar destaque"
|
"Unstar": "Eliminar destaque"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
"DeleteStarred": "Remover destacados",
|
|
||||||
"Starred": "Destacados",
|
"Starred": "Destacados",
|
||||||
"Star": "Destacar",
|
"Star": "Destacar",
|
||||||
"Unstar": "Remover destaque"
|
"Unstar": "Remover destaque"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"string": {
|
"string": {
|
||||||
"DeleteStarred": "Удалить закладки",
|
|
||||||
"Starred": "Закладки",
|
"Starred": "Закладки",
|
||||||
"Star": "Добавить в закладки",
|
"Star": "Добавить в закладки",
|
||||||
"Unstar": "Удалить из закладок"
|
"Unstar": "Удалить из закладок"
|
||||||
|
@ -56,7 +56,6 @@ const preference = plugin(preferenceId, {
|
|||||||
Star: '' as Asset
|
Star: '' as Asset
|
||||||
},
|
},
|
||||||
string: {
|
string: {
|
||||||
DeleteStarred: '' as IntlString,
|
|
||||||
Starred: '' as IntlString,
|
Starred: '' as IntlString,
|
||||||
Star: '' as IntlString,
|
Star: '' as IntlString,
|
||||||
Unstar: '' as IntlString
|
Unstar: '' as IntlString
|
||||||
|
@ -17,10 +17,7 @@
|
|||||||
import { DocNotifyContext, InboxNotification } from '@hcengineering/notification'
|
import { DocNotifyContext, InboxNotification } from '@hcengineering/notification'
|
||||||
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
import { InboxNotificationsClientImpl } from '@hcengineering/notification-resources'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import preference from '@hcengineering/preference'
|
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import { Action } from '@hcengineering/ui'
|
|
||||||
import view from '@hcengineering/view'
|
|
||||||
import { TreeNode } from '@hcengineering/view-resources'
|
import { TreeNode } from '@hcengineering/view-resources'
|
||||||
import { SpacesNavModel } from '@hcengineering/workbench'
|
import { SpacesNavModel } from '@hcengineering/workbench'
|
||||||
import StarredNavItem from './StarredNavItem.svelte'
|
import StarredNavItem from './StarredNavItem.svelte'
|
||||||
@ -35,21 +32,6 @@
|
|||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
const unStarAll: Action = {
|
|
||||||
label: preference.string.DeleteStarred,
|
|
||||||
icon: view.icon.Delete,
|
|
||||||
action: async (): Promise<void> => {
|
|
||||||
const ids = spaces.map((space) => space._id)
|
|
||||||
const current = await client.findAll(preference.class.SpacePreference, { attachedTo: { $in: ids } })
|
|
||||||
|
|
||||||
await Promise.all(
|
|
||||||
current.map(async (item) => {
|
|
||||||
await client.remove(item)
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSpaceModel (space: Ref<Class<Space>>): SpacesNavModel | undefined {
|
function getSpaceModel (space: Ref<Class<Space>>): SpacesNavModel | undefined {
|
||||||
const hierarchy = client.getHierarchy()
|
const hierarchy = client.getHierarchy()
|
||||||
const ancestors = [space, ...[...hierarchy.getAncestors(space)].reverse()]
|
const ancestors = [space, ...[...hierarchy.getAncestors(space)].reverse()]
|
||||||
@ -79,7 +61,6 @@
|
|||||||
<TreeNode
|
<TreeNode
|
||||||
_id={'tree-stared'}
|
_id={'tree-stared'}
|
||||||
{label}
|
{label}
|
||||||
actions={async () => [unStarAll]}
|
|
||||||
highlighted={spaces.some((s) => s._id === currentSpace) && !deselect}
|
highlighted={spaces.some((s) => s._id === currentSpace) && !deselect}
|
||||||
isFold
|
isFold
|
||||||
empty={spaces.length === 0}
|
empty={spaces.length === 0}
|
||||||
|
Loading…
Reference in New Issue
Block a user