saby-customizer 0.0.0 → 0.0.2

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.
@@ -125,7 +125,9 @@ export class GitBranchCardData {
125
125
  navigator.clipboard.writeText(branchName)
126
126
  snackbar.show(`Скопировано имя ветки: ${branchName}`)
127
127
 
128
- await this.saveToHistory()
128
+ if (this.milestones.length) {
129
+ await this.saveToHistory()
130
+ }
129
131
  }
130
132
 
131
133
  /** Копирование описания для git commit */
@@ -137,7 +139,10 @@ export class GitBranchCardData {
137
139
  navigator.clipboard.writeText(description)
138
140
  snackbar.show(`Скопировано описание для git commit:\n${description}`)
139
141
 
140
- await this.saveToHistory()
142
+ if (this.milestones.length) {
143
+ await this.saveToHistory()
144
+ }
145
+
141
146
  }
142
147
 
143
148
  /** Сохраняет данные в историю по карточкам для которых копировали имя ветки или описание */
@@ -797,7 +802,7 @@ toolbar.addButton({
797
802
 
798
803
  toolbar.addButton({
799
804
  position: 'top',
800
- filter: { names: ['Ошибка', 'Задача'] },
805
+ filter: { names: ['Ошибка', 'Задача', 'ЗадачаДок'] },
801
806
  title: 'Скопировать имя ветки для Git',
802
807
  iconSVG: octicons['git-branch'].toSVG({ width: 18 }),
803
808
  onclick: card => {
@@ -810,7 +815,7 @@ toolbar.addButton({
810
815
  })
811
816
  toolbar.addButton({
812
817
  position: 'top',
813
- filter: { names: ['Ошибка', 'Задача'] },
818
+ filter: { names: ['Ошибка', 'Задача', 'ЗадачаДок'] },
814
819
  title: 'Скопировать описание для Git коммита',
815
820
  iconSVG: octicons['git-commit'].toSVG({ width: 18 }),
816
821
  onclick: card => {
@@ -821,3 +826,35 @@ toolbar.addButton({
821
826
  .catch(console.error)
822
827
  }
823
828
  })
829
+ toolbar.addButton({
830
+ position: 'top',
831
+ filter: { names: ['Merge request'] },
832
+ title: 'Открыть ветки для Review кода',
833
+ iconSVG: octicons.codescan.toSVG({ width: 18 }),
834
+ onclick: card => {
835
+ const links = []
836
+ const view = card.element.querySelector('.fed2-DocumentPrint__content-view')?.shadowRoot
837
+
838
+ if (view) {
839
+ const rows = Array.from(view.querySelectorAll('.git_row'))
840
+ const rc = `div[title="rc-${card.data.version}"]`
841
+
842
+ for (const row of rows) {
843
+ if (row.querySelector(rc)) {
844
+ const diff = row.querySelector('a.git_diff')
845
+
846
+ if (diff) {
847
+ links.push(diff.href)
848
+ }
849
+ }
850
+ }
851
+ }
852
+ if (links.length) {
853
+ for (const link of links) {
854
+ window.open(link, '_blank')
855
+ }
856
+ } else {
857
+ snackbar.show('Не удалось найти ветки для Review кода')
858
+ }
859
+ }
860
+ })
@@ -1,13 +1,14 @@
1
1
  const replaceDocTypeName = {
2
2
  'Error': 'Ошибка',
3
3
  'Task to Development': 'Задача',
4
- 'Задача в разработку': 'Задача'
4
+ 'Задача в разработку': 'Задача',
5
+ 'Изменение документации разработки': 'ЗадачаДок',
6
+ 'Изменение документации': 'ЗадачаДок'
5
7
  }
6
8
 
7
9
 
8
10
  /**
9
11
  * Приведение даты к формату
10
- *
11
12
  * @param {Date} date Дата
12
13
  * @returns {string} dd.mm.yy
13
14
  */
@@ -19,12 +20,13 @@ function getStrDate(date) {
19
20
 
20
21
  return d + '.' + m + '.' + y
21
22
  }
23
+
24
+ return ''
22
25
  }
23
26
 
24
27
 
25
28
  /**
26
29
  * Разбирает формат RichEditor и приводить в нестилизированный текст
27
- *
28
30
  * @param {*} json Объет с RichEditorJSON
29
31
  * @returns {string} Тексто документа
30
32
  */
@@ -103,7 +105,6 @@ function parseRichEditorJSON(json) {
103
105
  */
104
106
  /**
105
107
  * Собирает из верстки страницы список открытых в данный момент карточек документов ЭДО
106
- *
107
108
  * @param {OpenCardsFilter} [filter] Параметры фильтрации документов
108
109
  * @returns {Array<Card>} Список открытых карточке документов
109
110
  */