saby-customizer 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,9 @@ import { GitBranchCardData } from 'saby-customizer/features/git-branch.js'
5
5
 
6
6
  toolbar.addButton({
7
7
  position: 'top',
8
- title: 'Скопировать ссылку на карточку',
8
+ title: 'Скопировать ссылку на карточку (Alt+L)',
9
9
  iconSVG: octicons.link.toSVG({ width: 18 }),
10
+ keysMapping: 'alt-KeyL',
10
11
  onclick: card => {
11
12
  const gitCard = new GitBranchCardData(card.data)
12
13
 
@@ -1,5 +1,5 @@
1
1
  import { oom } from '@notml/core'
2
- import { keysMapping, toolbar, PopupDialog, getListOfOpenCards, snackbar, context, db } from 'saby-customizer/lib.js'
2
+ import { toolbar, PopupDialog, getListOfOpenCards, snackbar, context, db } from 'saby-customizer/lib.js'
3
3
  import { octicons } from 'saby-customizer/octicons.js'
4
4
 
5
5
 
@@ -777,24 +777,24 @@ class GitBranchCardList extends oom.extends(HTMLElement) {
777
777
 
778
778
  oom.define(GitBranchCard, GitBranchCardList)
779
779
 
780
- keysMapping['alt-KeyB'] = () => PopupDialog.toggle({
781
- key: 'git-branch-dialog',
782
- title: 'Ветки для Git',
783
- Element: GitBranchCardList
784
- })
785
-
786
780
  toolbar.addButton({
787
781
  position: 'right',
788
- title: 'Ветки для Git',
782
+ title: 'История веток для Git (Alt+H)',
789
783
  iconSVG: octicons['git-branch'].toSVG({ width: 24 }),
790
- onclick: keysMapping['alt-KeyB']
784
+ keysMapping: 'alt-KeyH',
785
+ onclick: () => PopupDialog.toggle({
786
+ key: 'git-branch-dialog',
787
+ title: 'Ветки для Git',
788
+ Element: GitBranchCardList
789
+ })
791
790
  })
792
791
 
793
792
  toolbar.addButton({
794
793
  position: 'top',
795
794
  filter: { names: ['Ошибка', 'Задача', 'ЗадачаДок'] },
796
- title: 'Скопировать имя ветки для Git',
795
+ title: 'Скопировать имя ветки для Git (Alt+B)',
797
796
  iconSVG: octicons['git-branch'].toSVG({ width: 18 }),
797
+ keysMapping: 'alt-KeyB',
798
798
  onclick: card => {
799
799
  const gitCard = new GitBranchCardData(card.data)
800
800
 
@@ -806,8 +806,9 @@ toolbar.addButton({
806
806
  toolbar.addButton({
807
807
  position: 'top',
808
808
  filter: { names: ['Ошибка', 'Задача', 'ЗадачаДок'] },
809
- title: 'Скопировать описание для Git коммита',
809
+ title: 'Скопировать описание для Git коммита (Alt+O)',
810
810
  iconSVG: octicons['git-commit'].toSVG({ width: 18 }),
811
+ keysMapping: 'alt-KeyO',
811
812
  onclick: card => {
812
813
  const gitCard = new GitBranchCardData(card.data)
813
814
 
@@ -819,7 +820,7 @@ toolbar.addButton({
819
820
  toolbar.addButton({
820
821
  position: 'top',
821
822
  filter: { names: ['Merge request'] },
822
- title: 'Открыть ветки для Review кода',
823
+ title: 'Открыть ветки для Review кода (Alt+R)',
823
824
  iconSVG: octicons.codescan.toSVG({ width: 18 }),
824
825
  keysMapping: 'alt-KeyR',
825
826
  onclick: card => {
package/lib/context.js CHANGED
@@ -31,7 +31,7 @@ export const context = new Proxy(origin, {
31
31
  async function userInfo(target, name) {
32
32
  const result = (await sabyRPC.call({
33
33
  service: 'auth',
34
- method: 'САП.ТекущийПользователь'
34
+ method: 'SAP.CurrentUser'
35
35
  })).getRow()
36
36
 
37
37
  target.userLogin = result.get('ЛогинПользователя')
@@ -99,7 +99,7 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
99
99
  ? getListOfOpenCards({ id: container.options.card.data.id })
100
100
  : [null]
101
101
 
102
- options.onclick(card)
102
+ if (card) options.onclick(card)
103
103
  }
104
104
  }
105
105
 
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": "github:saby-customizer/saby-customizer.github.io",
11
11
  "license": "Unlicense",
12
- "version": "0.0.3",
12
+ "version": "0.0.5",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {