bfg-common 1.4.484 → 1.4.486

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.
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <common-pages-home-widgets-services-new
3
3
  v-if="isNewView"
4
+ :services="props.services"
4
5
  :loading="false"
5
6
  ></common-pages-home-widgets-services-new>
6
7
 
@@ -3,14 +3,15 @@
3
3
  <template v-if="props.loading">
4
4
  <!-- skeleton -->
5
5
  </template>
6
- <div v-else>
6
+ <div v-else class="services-table">
7
+ <h1>{{ localization.home.services }}</h1>
8
+
7
9
  <ui-data-table
8
- test-id="data-table-main"
10
+ test-id="home-services-table-main"
9
11
  :data="data"
10
12
  :options="options"
11
13
  :loading="props.loading"
12
14
  server-off
13
- class="resent-task-table"
14
15
  >
15
16
  <template #icon="{ item }">
16
17
  <span class="flex-align-center">
@@ -36,6 +37,7 @@ import type {
36
37
  UI_I_DataTableHeader,
37
38
  UI_I_DataTableBody,
38
39
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
40
+ import type { UI_I_Service } from '~/components/common/home/lib/models/interfaces'
39
41
  import {
40
42
  options,
41
43
  getHeaderDataFunc,
@@ -43,7 +45,7 @@ import {
43
45
  } from '~/components/common/pages/home/widgets/services/lib/config/config'
44
46
 
45
47
  const props = defineProps<{
46
- tableData: any
48
+ services: UI_I_Service[]
47
49
  loading: boolean
48
50
  }>()
49
51
 
@@ -61,8 +63,8 @@ const resentTaskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
61
63
 
62
64
  const resentTaskBodyItems = ref<UI_I_DataTableBody[]>([])
63
65
  watch(
64
- () => props.tableData,
65
- (newValue) => {
66
+ () => props.services,
67
+ (newValue: UI_I_Service[]) => {
66
68
  if (!newValue?.length) return
67
69
 
68
70
  resentTaskBodyItems.value = getBodyDataFunc(newValue, localization.value)
@@ -72,6 +74,19 @@ watch(
72
74
  </script>
73
75
 
74
76
  <style lang="scss" scoped>
77
+ .services-table {
78
+ :deep(.default-layout) {
79
+ box-shadow: none;
80
+ padding: 0;
81
+ }
82
+ & > h1 {
83
+ color: var(--widget-text-first);
84
+ font-size: 16px;
85
+ font-weight: 500;
86
+ line-height: 19.36px;
87
+ }
88
+ }
89
+
75
90
  .target-link {
76
91
  font-family: Inter, serif;
77
92
  font-size: 13px;
@@ -7,7 +7,7 @@
7
7
  icon-name="icon-content-libraries"
8
8
  class="most-alerts"
9
9
  >
10
- <common-home-services-table :data-table="props.services" />
10
+ <common-pages-home-widgets-services-table :data-table="props.services" />
11
11
  </common-pages-home-card>
12
12
  </div>
13
13
  </div>
@@ -4,7 +4,6 @@ import type {
4
4
  UI_I_DataTableOptions,
5
5
  UI_I_DataTableHeader,
6
6
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
7
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
8
7
  import { UI_E_RecentTaskStatus } from '~/lib/models/store/tasks/enums'
9
8
  import { E_NodeIconsByState } from '~/lib/models/enums'
10
9
  // import { E_TabsByType } from '~/components/templates/inventory/lib/models/enums'
@@ -12,63 +11,58 @@ import {
12
11
  E_RTaskChipColor,
13
12
  E_RTaskStatusIcon,
14
13
  } from '~/components/common/pages/home/widgets/services/lib/models/enums'
15
- import type { T_TypeNodes } from '~/lib/models/types'
16
14
 
17
15
  export const getHeaderDataFunc = (
18
16
  localization: UI_I_Localization
19
17
  ): UI_I_DataTableHeader[] => [
20
18
  {
21
19
  col: 0,
22
- colName: 'taskName',
23
- text: localization.tasks.taskName,
20
+ colName: 'item',
21
+ text: localization.common.item,
24
22
  isSortable: true,
25
23
  sort: 'asc',
26
24
  sortColumn: true,
27
- width: '180px',
25
+ width: '33.3%',
28
26
  show: true,
29
27
  filter: true,
30
28
  },
31
29
  {
32
30
  col: 1,
33
- colName: 'target',
34
- text: localization.common.target,
31
+ colName: 'alerts',
32
+ text: localization.common.alerts,
35
33
  isSortable: true,
36
34
  sort: 'asc',
37
- width: '180px',
35
+ width: '33.3%',
38
36
  show: true,
39
37
  filter: true,
40
38
  },
41
39
  {
42
40
  col: 2,
43
- colName: 'status',
44
- text: localization.common.status,
41
+ colName: 'warnings',
42
+ text: localization.common.warnings,
45
43
  isSortable: true,
46
44
  sort: 'asc',
47
- width: '180px',
45
+ width: '33.3%',
48
46
  show: true,
49
47
  filter: true,
50
48
  },
51
49
  ]
52
50
 
53
51
  export const options: UI_I_DataTableOptions = {
54
- perPageOptions: [
55
- { text: '10', value: 10 },
56
- { text: '50', value: 50 },
57
- { text: '100', value: 100 },
58
- ],
52
+ perPageOptions: [],
59
53
  isSelectable: false,
60
54
  isFocusable: false,
61
- showPagination: true,
62
- showPageInfo: true,
55
+ showPagination: false,
56
+ showPageInfo: false,
63
57
  isSortable: true,
64
58
  server: false,
65
- isResizable: true,
59
+ isResizable: false,
66
60
  showSearch: false,
67
- showColumnManager: true,
61
+ showColumnManager: false,
68
62
  }
69
63
 
70
64
  export const getBodyDataFunc = (
71
- bodyData: UI_I_RecentTaskItem<T_TypeNodes>[],
65
+ bodyData: any,
72
66
  localization: UI_I_Localization
73
67
  ): UI_I_DataTableBody[] => {
74
68
  return bodyData.map((task, index: number) => {
@@ -33,7 +33,7 @@ import type {
33
33
  import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
34
34
  import type { UI_I_Localization } from '~/lib/models/interfaces'
35
35
  import type { UI_I_Service } from '~/components/common/home/lib/models/interfaces'
36
- import * as table from '~/components/common/home/servicesTable/lib/config/config'
36
+ import * as table from '~/components/common/pages/home/widgets/services/table/lib/config/config'
37
37
 
38
38
  const props = defineProps<{
39
39
  dataTable: UI_I_Service[]
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <common-pages-home-widgets-warnings-new
3
3
  v-if="isNewView"
4
+ :alerts="props.alerts"
4
5
  :loading="false"
5
6
  ></common-pages-home-widgets-warnings-new>
6
7
 
@@ -3,9 +3,14 @@
3
3
  <template v-if="props.loading">
4
4
  <!-- skeleton -->
5
5
  </template>
6
- <div v-else>
6
+ <div v-else class="warnings-table">
7
+ <div class="warnings-table__title">
8
+ <h1>{{ localization.home.objectsWithMostAlerts }}</h1>
9
+ <span>({{ props.alerts.length }})</span>
10
+ </div>
11
+
7
12
  <ui-data-table
8
- test-id="data-table-main"
13
+ test-id="home-warnings-table-main"
9
14
  :data="data"
10
15
  :options="options"
11
16
  :loading="props.loading"
@@ -36,6 +41,7 @@ import type {
36
41
  UI_I_DataTableHeader,
37
42
  UI_I_DataTableBody,
38
43
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
44
+ import type { UI_I_Alert } from '~/components/common/home/lib/models/interfaces'
39
45
  import {
40
46
  options,
41
47
  getHeaderDataFunc,
@@ -43,6 +49,7 @@ import {
43
49
  } from '~/components/common/pages/home/widgets/warnings/lib/config/config'
44
50
 
45
51
  const props = defineProps<{
52
+ alerts: UI_I_Alert[]
46
53
  loading: boolean
47
54
  }>()
48
55
 
@@ -60,8 +67,8 @@ const resentTaskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
60
67
 
61
68
  const resentTaskBodyItems = ref<UI_I_DataTableBody[]>([])
62
69
  watch(
63
- () => props.tableData,
64
- (newValue) => {
70
+ () => props.alerts,
71
+ (newValue: UI_I_Alert[]) => {
65
72
  if (!newValue?.length) return
66
73
 
67
74
  resentTaskBodyItems.value = getBodyDataFunc(newValue, localization.value)
@@ -70,4 +77,17 @@ watch(
70
77
  )
71
78
  </script>
72
79
 
73
- <style lang="scss" scoped></style>
80
+ <style lang="scss" scoped>
81
+ .warnings-table {
82
+ :deep(.default-layout) {
83
+ box-shadow: none;
84
+ padding: 0;
85
+ }
86
+ & > h1 {
87
+ color: var(--widget-text-first);
88
+ font-size: 16px;
89
+ font-weight: 500;
90
+ line-height: 19.36px;
91
+ }
92
+ }
93
+ </style>
@@ -4,7 +4,6 @@ import type {
4
4
  UI_I_DataTableOptions,
5
5
  UI_I_DataTableHeader,
6
6
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
7
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
8
7
  import { UI_E_RecentTaskStatus } from '~/lib/models/store/tasks/enums'
9
8
  import { E_NodeIconsByState } from '~/lib/models/enums'
10
9
  // import { E_TabsByType } from '~/components/templates/inventory/lib/models/enums'
@@ -12,63 +11,58 @@ import {
12
11
  E_RTaskChipColor,
13
12
  E_RTaskStatusIcon,
14
13
  } from '~/components/common/pages/home/widgets/services/lib/models/enums'
15
- import type { T_TypeNodes } from '~/lib/models/types'
16
14
 
17
15
  export const getHeaderDataFunc = (
18
16
  localization: UI_I_Localization
19
17
  ): UI_I_DataTableHeader[] => [
20
18
  {
21
19
  col: 0,
22
- colName: 'taskName',
23
- text: localization.tasks.taskName,
20
+ colName: 'item',
21
+ text: localization.common.item,
24
22
  isSortable: true,
25
23
  sort: 'asc',
26
24
  sortColumn: true,
27
- width: '180px',
25
+ width: '33.3%',
28
26
  show: true,
29
27
  filter: true,
30
28
  },
31
29
  {
32
30
  col: 1,
33
- colName: 'target',
34
- text: localization.common.target,
31
+ colName: 'status',
32
+ text: localization.common.status,
35
33
  isSortable: true,
36
34
  sort: 'asc',
37
- width: '180px',
35
+ width: '33.3%',
38
36
  show: true,
39
37
  filter: true,
40
38
  },
41
39
  {
42
40
  col: 2,
43
- colName: 'status',
44
- text: localization.common.status,
41
+ colName: 'version',
42
+ text: localization.common.version,
45
43
  isSortable: true,
46
44
  sort: 'asc',
47
- width: '180px',
45
+ width: '33.3%',
48
46
  show: true,
49
47
  filter: true,
50
48
  },
51
49
  ]
52
50
 
53
51
  export const options: UI_I_DataTableOptions = {
54
- perPageOptions: [
55
- { text: '10', value: 10 },
56
- { text: '50', value: 50 },
57
- { text: '100', value: 100 },
58
- ],
52
+ perPageOptions: [],
59
53
  isSelectable: false,
60
54
  isFocusable: false,
61
- showPagination: true,
62
- showPageInfo: true,
55
+ showPagination: false,
56
+ showPageInfo: false,
63
57
  isSortable: true,
64
58
  server: false,
65
- isResizable: true,
59
+ isResizable: false,
66
60
  showSearch: false,
67
- showColumnManager: true,
61
+ showColumnManager: false,
68
62
  }
69
63
 
70
64
  export const getBodyDataFunc = (
71
- bodyData: UI_I_RecentTaskItem<T_TypeNodes>[],
65
+ bodyData: any,
72
66
  localization: UI_I_Localization
73
67
  ): UI_I_DataTableBody[] => {
74
68
  return bodyData.map((task, index: number) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.484",
4
+ "version": "1.4.486",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",