Skip to content

Commit

Permalink
UBER-678 Move delete actions to bottom (#3559)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
  • Loading branch information
aonnikov authored and annano committed Aug 24, 2023
1 parent 48a30d1 commit 416a5f0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion models/calendar/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function createModel (builder: Builder): void {
category: view.category.General,
input: 'any',
target: calendar.class.ReccuringInstance,
context: { mode: ['context', 'browser'], group: 'tools' }
context: { mode: ['context', 'browser'], group: 'remove' }
},
calendar.action.DeleteRecEvent
)
Expand Down
6 changes: 3 additions & 3 deletions models/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ export function createModel (builder: Builder): void {
input: 'focus',
context: {
mode: ['context'],
group: 'other'
group: 'remove'
},
secured: true
},
Expand All @@ -761,7 +761,7 @@ export function createModel (builder: Builder): void {
input: 'focus',
context: {
mode: ['context'],
group: 'other'
group: 'remove'
},
secured: true
},
Expand All @@ -788,7 +788,7 @@ export function createModel (builder: Builder): void {
input: 'focus',
context: {
mode: ['context'],
group: 'other'
group: 'remove'
},
secured: true
},
Expand Down
2 changes: 1 addition & 1 deletion models/setting/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export function createModel (builder: Builder): void {
category: view.category.General,
input: 'any',
target: setting.mixin.UserMixin,
context: { mode: ['context', 'browser'], group: 'tools' }
context: { mode: ['context', 'browser'], group: 'remove' }
},
setting.action.DeleteMixin
)
Expand Down
4 changes: 2 additions & 2 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ export function createModel (builder: Builder): void {
target: tracker.class.Issue,
context: {
mode: ['context', 'browser'],
group: 'edit'
group: 'remove'
},
override: [view.action.Delete]
},
Expand Down Expand Up @@ -1874,7 +1874,7 @@ export function createModel (builder: Builder): void {
category: tracker.category.Tracker,
input: 'any',
target: tracker.class.Milestone,
context: { mode: ['context', 'browser'], group: 'tools' }
context: { mode: ['context', 'browser'], group: 'remove' }
},
tracker.action.DeleteMilestone
)
Expand Down
2 changes: 1 addition & 1 deletion models/view/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export function createModel (builder: Builder): void {
category: view.category.General,
input: 'any',
target: core.class.Doc,
context: { mode: ['context', 'browser'], group: 'tools' }
context: { mode: ['context', 'browser'], group: 'remove' }
},
view.action.Delete
)
Expand Down
4 changes: 2 additions & 2 deletions plugins/view-resources/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import core, {
Ref
} from '@hcengineering/core'
import { getResource } from '@hcengineering/platform'
import { Action, ViewAction, ViewActionInput, ViewContextType } from '@hcengineering/view'
import { Action, ActionGroup, ViewAction, ViewActionInput, ViewContextType } from '@hcengineering/view'
import view from './plugin'
import { FocusSelection } from './selection'

Expand Down Expand Up @@ -60,7 +60,7 @@ export async function getActions (
'context.mode': mode
})

const categories: Record<string, number> = { top: 1, filter: 50, tools: 100 }
const categories: Partial<Record<ActionGroup | 'top', number>> = { top: 1, tools: 50, other: 100, remove: 200 }

let filteredActions: Action[] = []

Expand Down
3 changes: 2 additions & 1 deletion plugins/view-resources/src/components/Menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
copy: 3,
associate: 4,
tools: 5,
other: 6
other: 6,
remove: 7
}
getActions(client, object, baseMenuClass, mode).then((result) => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/view/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export interface ActionCategory extends Doc, UXObject {
/**
* @public
*/
export type ActionGroup = 'create' | 'edit' | 'associate' | 'copy' | 'tools' | 'other'
export type ActionGroup = 'create' | 'edit' | 'associate' | 'copy' | 'tools' | 'other' | 'remove'

/**
* @public
Expand Down

0 comments on commit 416a5f0

Please sign in to comment.