Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the Trigger Sync Mannually as Ctrl+s #2882

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/app/core-ui/shortcut/shortcut.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { WorkContextType } from '../../features/work-context/work-context.model'
import { SnackService } from '../../core/snack/snack.service';
import { TranslateService } from '@ngx-translate/core';
import { T } from '../../t.const';
import { SyncProviderService } from '../../../app/imex/sync/sync-provider.service';

@Injectable({
providedIn: 'root',
Expand All @@ -33,6 +34,7 @@ export class ShortcutService {
private _taskService: TaskService,
private _workContextService: WorkContextService,
private _snackService: SnackService,
private _syncProviderService: SyncProviderService,
private _activatedRoute: ActivatedRoute,
private _uiHelperService: UiHelperService,
private _bookmarkService: BookmarkService,
Expand Down Expand Up @@ -144,6 +146,9 @@ export class ShortcutService {
});
ev.preventDefault();
}
} else if (checkKeyCombo(ev, keys.saveNote)) {
this._syncProviderService.sync();
ev.preventDefault();
} else if (checkKeyCombo(ev, keys.openProjectNotes)) {
ev.preventDefault();
this._layoutService.toggleNotes();
Expand Down
2 changes: 2 additions & 0 deletions src/app/features/config/default-global-config.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export const DEFAULT_GLOBAL_CONFIG: GlobalConfigState = {
taskDelete: 'Backspace',
taskMoveToProject: 'e',
taskOpenContextMenu: 'q',
saveNote: 'Ctrl+s',
triggerSync: 'Ctrl+m',
selectPreviousTask: 'k',
selectNextTask: 'j',
moveTaskUp: 'Ctrl+Shift+ArrowUp',
Expand Down
14 changes: 14 additions & 0 deletions src/app/features/config/form-cfgs/keyboard-form.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ export const KEYBOARD_SETTINGS_FORM_CFG: ConfigFormSection<KeyboardConfig> = {
label: T.GCF.KEYBOARD.ADD_NEW_NOTE,
},
},
{
key: 'saveNote',
type: 'keyboard',
templateOptions: {
label: T.GCF.KEYBOARD.SAVE_NOTE,
},
},
{
key: 'triggerSync',
type: 'keyboard',
templateOptions: {
label: T.GCF.KEYBOARD.TRIGGER_SYNC,
},
},
{
key: 'toggleSideNav',
type: 'keyboard',
Expand Down
2 changes: 2 additions & 0 deletions src/app/features/config/keyboard-config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export type KeyboardConfig = Readonly<{
taskOpenContextMenu: string | null;
taskDelete: string | null;
taskSchedule: string | null;
saveNote: string | null;
triggerSync: string | null;
selectPreviousTask: string | null;
selectNextTask: string | null;
moveTaskUp: string | null;
Expand Down
2 changes: 2 additions & 0 deletions src/app/t.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,8 @@ const T = {
MOVE_TO_BACKLOG: 'GCF.KEYBOARD.MOVE_TO_BACKLOG',
MOVE_TO_TODAYS_TASKS: 'GCF.KEYBOARD.MOVE_TO_TODAYS_TASKS',
OPEN_PROJECT_NOTES: 'GCF.KEYBOARD.OPEN_PROJECT_NOTES',
SAVE_NOTE: 'GCF.KEYBOARD.SAVE_NOTE',
TRIGGER_SYNC: 'GCF.KEYBOARD.TRIGGER_SYNC',
SELECT_NEXT_TASK: 'GCF.KEYBOARD.SELECT_NEXT_TASK',
SELECT_PREVIOUS_TASK: 'GCF.KEYBOARD.SELECT_PREVIOUS_TASK',
SHOW_SEARCH_BAR: 'GCF.KEYBOARD.SHOW_SEARCH_BAR',
Expand Down