fix goto actions (#3333)

This commit is contained in:
Denis Bykhov 2023-06-03 09:49:20 +06:00 committed by GitHub
parent 4edbdc1641
commit 4243f68f07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 20 deletions

View File

@ -576,7 +576,8 @@ export function createModel (builder: Builder): void {
{
label: contact.string.Profile,
icon: contact.icon.Profile,
placeholder: contact.string.ProfilePlaceholder
placeholder: contact.string.ProfilePlaceholder,
action: contact.actionImpl.OpenChannel
},
contact.channelProvider.Profile
)

View File

@ -1070,11 +1070,11 @@ export function createModel (builder: Builder): void {
})
}
createGotoSpecialAction(builder, talentsId, 'g->e', recruit.string.GotoTalents)
createGotoSpecialAction(builder, vacanciesId, 'g->v', recruit.string.GotoVacancies)
createGotoSpecialAction(builder, skillsId, 'g->s', recruit.string.GotoSkills)
createGotoSpecialAction(builder, myApplicationsId, 'g->h', recruit.string.GotoMyApplications)
createGotoSpecialAction(builder, candidatesId, 'g->a', recruit.string.GotoApplicants)
createGotoSpecialAction(builder, talentsId, 'keyG-keyE', recruit.string.GotoTalents)
createGotoSpecialAction(builder, vacanciesId, 'keyG->keyV', recruit.string.GotoVacancies)
createGotoSpecialAction(builder, skillsId, 'keyG->keyS', recruit.string.GotoSkills)
createGotoSpecialAction(builder, myApplicationsId, 'keyG->keyM', recruit.string.GotoMyApplications)
createGotoSpecialAction(builder, candidatesId, 'keyG->keyA', recruit.string.GotoApplicants)
createAction(builder, {
action: workbench.actionImpl.Navigate,

View File

@ -895,9 +895,6 @@ export function createModel (builder: Builder): void {
)
const issuesId = 'issues'
const activeId = 'active'
const backlogId = 'backlog'
const boardId = 'board'
const componentsId = 'components'
const milestonesId = 'milestones'
const templatesId = 'templates'
@ -1153,21 +1150,31 @@ export function createModel (builder: Builder): void {
tracker.app.Tracker
)
function createGotoSpecialAction (builder: Builder, id: string, key: KeyBinding, label: IntlString): void {
function createGotoSpecialAction (
builder: Builder,
id: string,
key: KeyBinding,
label: IntlString,
query?: Record<string, string | null>
): void {
createNavigateAction(builder, key, label, tracker.app.Tracker, {
application: trackerId,
mode: 'space',
spaceSpecial: id,
spaceClass: tracker.class.Project
spaceClass: tracker.class.Project,
query
})
}
createGotoSpecialAction(builder, issuesId, 'g->e', tracker.string.GotoIssues)
createGotoSpecialAction(builder, activeId, 'g->a', tracker.string.GotoActive)
createGotoSpecialAction(builder, backlogId, 'g->b', tracker.string.GotoBacklog)
createGotoSpecialAction(builder, boardId, 'g->d', tracker.string.GotoBoard)
createGotoSpecialAction(builder, componentsId, 'g->c', tracker.string.GotoComponents)
createGotoSpecialAction(builder, myIssuesId, 'g->m', tracker.string.GotoMyIssues)
createGotoSpecialAction(builder, issuesId, 'keyG->keyE', tracker.string.GotoIssues)
createGotoSpecialAction(builder, issuesId, 'keyG->keyA', tracker.string.GotoActive, { mode: 'active' })
createGotoSpecialAction(builder, issuesId, 'keyG->keyB', tracker.string.GotoBacklog, { mode: 'backlog' })
createGotoSpecialAction(builder, componentsId, 'keyG->keyC', tracker.string.GotoComponents)
createNavigateAction(builder, 'keyG->keyM', tracker.string.GotoMyIssues, tracker.app.Tracker, {
application: trackerId,
mode: 'special',
special: myIssuesId
})
createAction(builder, {
action: workbench.actionImpl.Navigate,

View File

@ -32,7 +32,6 @@ export default mergeIds(trackerId, tracker, {
GotoIssues: '' as IntlString,
GotoActive: '' as IntlString,
GotoBacklog: '' as IntlString,
GotoBoard: '' as IntlString,
GotoComponents: '' as IntlString,
GotoTrackerApplication: '' as IntlString,
GotoMyIssues: '' as IntlString,

View File

@ -73,6 +73,7 @@ export function createNavigateAction (
space?: Ref<Space>
spaceClass?: Ref<Class<Space>>
spaceSpecial?: string
query?: Record<string, string | null>
}
): void {
createAction(builder, {

View File

@ -144,7 +144,6 @@
"GotoIssues": "Go to issues",
"GotoActive": "Go to active issues",
"GotoBacklog": "Go to backlog",
"GotoBoard": "Go to issue board",
"GotoComponents": "Go to components",
"GotoMyIssues": "Go to my issues",
"GotoTrackerApplication": "Switch to Tracker Application",

View File

@ -144,7 +144,6 @@
"GotoIssues": "Перейти к задачам",
"GotoActive": "Перейти к активным задачам",
"GotoBacklog": "Перейти к пулу задач",
"GotoBoard": "Перейти к канбану",
"GotoComponents": "Перейти к компоненту",
"GotoMyIssues": "Перейи к моим задачам",
"GotoTrackerApplication": "Перейти к приложению Трекер",

View File

@ -67,6 +67,7 @@ export async function doNavigate (
space?: Ref<Space>
// If no space is selected, select first space from list
spaceClass?: Ref<Class<Space>>
query?: Record<string, string | null>
}
): Promise<void> {
evt?.preventDefault()
@ -83,6 +84,8 @@ export async function doNavigate (
} else {
loc.path.length = 3
}
loc.query = props.query
loc.fragment = undefined
navigate(loc)
break
case 'special':
@ -91,6 +94,8 @@ export async function doNavigate (
}
loc.path[3] = props.special ?? ''
loc.path.length = 4
loc.query = props.query
loc.fragment = undefined
navigate(loc)
break
case 'space': {
@ -114,6 +119,8 @@ export async function doNavigate (
}
}
loc.path.length = 5
loc.query = props.query
loc.fragment = undefined
navigate(loc)
break