@atlaskit/link-datasource 1.19.7 → 1.19.9
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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/assets-modal/modal/index.js +6 -1
- package/dist/cjs/ui/issue-like-table/empty-state/index.js +6 -4
- package/dist/cjs/ui/issue-like-table/index.js +137 -62
- package/dist/cjs/ui/issue-like-table/styled.js +3 -1
- package/dist/cjs/ui/jira-issues-modal/basic-filters/hooks/messages.js +14 -0
- package/dist/cjs/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.js +34 -10
- package/dist/cjs/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +24 -9
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +3 -2
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/menu-list/messages.js +3 -2
- package/dist/cjs/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +11 -3
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +5 -1
- package/dist/cjs/ui/table-footer/index.js +2 -2
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +6 -1
- package/dist/es2019/ui/issue-like-table/empty-state/index.js +6 -4
- package/dist/es2019/ui/issue-like-table/index.js +123 -11
- package/dist/es2019/ui/issue-like-table/styled.js +7 -5
- package/dist/es2019/ui/jira-issues-modal/basic-filters/hooks/messages.js +8 -0
- package/dist/es2019/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.js +25 -4
- package/dist/es2019/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +21 -3
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +3 -2
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/menu-list/messages.js +3 -2
- package/dist/es2019/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +11 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +6 -2
- package/dist/es2019/ui/table-footer/index.js +3 -1
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/assets-modal/modal/index.js +6 -1
- package/dist/esm/ui/issue-like-table/empty-state/index.js +6 -4
- package/dist/esm/ui/issue-like-table/index.js +136 -61
- package/dist/esm/ui/issue-like-table/styled.js +3 -1
- package/dist/esm/ui/jira-issues-modal/basic-filters/hooks/messages.js +8 -0
- package/dist/esm/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.js +33 -9
- package/dist/esm/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +24 -9
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +3 -2
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/menu-list/messages.js +3 -2
- package/dist/esm/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +11 -3
- package/dist/esm/ui/jira-issues-modal/modal/index.js +6 -2
- package/dist/esm/ui/table-footer/index.js +2 -2
- package/dist/types/ui/issue-like-table/index.d.ts +6 -0
- package/dist/types/ui/jira-issues-modal/basic-filters/hooks/messages.d.ts +7 -0
- package/dist/types/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +3 -1
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +3 -1
- package/package.json +1 -1
|
@@ -20,11 +20,19 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20
20
|
// Map of field keys to their respective clauses in the Jast
|
|
21
21
|
|
|
22
22
|
var getFieldValues = function getFieldValues(operand) {
|
|
23
|
+
var mapValuesFromList = function mapValuesFromList(value) {
|
|
24
|
+
if (value.operandType === _jqlAst.OPERAND_TYPE_VALUE) {
|
|
25
|
+
return value.value;
|
|
26
|
+
}
|
|
27
|
+
// we only support EMPTY keyword atm, hence making sure if operandType is a KEYWORD, then its an EMPTY keyword
|
|
28
|
+
if (value.operandType === _jqlAst.OPERAND_TYPE_KEYWORD && value.value === _jqlAst.OPERAND_EMPTY) {
|
|
29
|
+
return value.value;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
23
33
|
switch (operand.operandType) {
|
|
24
34
|
case _jqlAst.OPERAND_TYPE_LIST:
|
|
25
|
-
return operand.values.map(function (value) {
|
|
26
|
-
return value.operandType === _jqlAst.OPERAND_TYPE_VALUE && value.value || undefined;
|
|
27
|
-
}).filter(function (value) {
|
|
35
|
+
return operand.values.map(mapValuesFromList).filter(function (value) {
|
|
28
36
|
return !!value;
|
|
29
37
|
});
|
|
30
38
|
case _jqlAst.OPERAND_TYPE_VALUE:
|
|
@@ -62,7 +62,11 @@ var contentContainerStyles = (0, _react2.css)({
|
|
|
62
62
|
display: 'grid',
|
|
63
63
|
maxHeight: '420px',
|
|
64
64
|
overflow: 'auto',
|
|
65
|
-
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"))
|
|
65
|
+
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
66
|
+
background: _issueLikeTable.scrollableContainerShadowsCssComponents.background,
|
|
67
|
+
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
68
|
+
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
69
|
+
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
66
70
|
});
|
|
67
71
|
var placeholderSmartLinkStyles = (0, _react2.css)({
|
|
68
72
|
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N0, ")"),
|
|
@@ -21,8 +21,8 @@ var _messages = require("./messages");
|
|
|
21
21
|
var _syncInfo = require("./sync-info");
|
|
22
22
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
23
23
|
/** @jsx jsx */
|
|
24
|
-
var FooterWrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", ";\n box-sizing: border-box;\n border-radius: inherit;\n background: ", ";\n"])), "var(--ds-space-200, 16px)", "var(--ds-background-input, ".concat(_colors.N0, ")"));
|
|
25
|
-
var TopBorderWrapper = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n padding: ", " 0;\n
|
|
24
|
+
var FooterWrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: 0 ", ";\n box-sizing: border-box;\n border-radius: inherit;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n background: ", ";\n border-top: 2px solid ", ";\n"])), "var(--ds-space-200, 16px)", "var(--ds-background-input, ".concat(_colors.N0, ")"), "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"));
|
|
25
|
+
var TopBorderWrapper = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n padding: ", " 0;\n"])), "var(--ds-space-250, 20px)");
|
|
26
26
|
var ItemCounterWrapper = _styled.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-self: center;\n"])));
|
|
27
27
|
var SyncWrapper = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n color: ", ";\n"])), "var(--ds-text-accent-gray, ".concat(_colors.N90, ")"));
|
|
28
28
|
var SyncTextWrapper = _styled.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: 5px;\n font-size: 12px;\n"])));
|
|
@@ -21,6 +21,7 @@ import i18nEN from '../../../i18n/en';
|
|
|
21
21
|
import { PermissionError } from '../../../services/cmdbService.utils';
|
|
22
22
|
import { AccessRequired } from '../../../ui/common/error-state/access-required';
|
|
23
23
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
24
|
+
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
24
25
|
import { AssetsSearchContainer } from '../search-container';
|
|
25
26
|
import { AssetsSearchContainerLoading } from '../search-container/loading-state';
|
|
26
27
|
import { modalMessages } from './messages';
|
|
@@ -28,7 +29,11 @@ import { RenderAssetsContent } from './render-assets-content';
|
|
|
28
29
|
const modalBodyWrapperStyles = css({
|
|
29
30
|
display: 'grid',
|
|
30
31
|
height: '420px',
|
|
31
|
-
overflow: 'auto'
|
|
32
|
+
overflow: 'auto',
|
|
33
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
34
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
35
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
36
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
32
37
|
});
|
|
33
38
|
const modalBodyErrorWrapperStyles = css({
|
|
34
39
|
alignItems: 'center'
|
|
@@ -15,16 +15,17 @@ const SkeletonComponent = ({
|
|
|
15
15
|
const tableBodyStyles = css({
|
|
16
16
|
borderBottom: 0
|
|
17
17
|
});
|
|
18
|
+
const padding = `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"}`;
|
|
18
19
|
const cellStyles = css({
|
|
19
|
-
|
|
20
|
+
padding,
|
|
20
21
|
borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
21
22
|
borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
22
23
|
'&:first-child': {
|
|
23
|
-
paddingLeft: `${"var(--ds-space-100,
|
|
24
|
+
paddingLeft: `${"var(--ds-space-100, 8px)"}`
|
|
24
25
|
},
|
|
25
26
|
'&:last-child': {
|
|
26
27
|
borderRight: 0,
|
|
27
|
-
paddingRight: `${"var(--ds-space-100,
|
|
28
|
+
paddingRight: `${"var(--ds-space-100, 8px)"}`
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
const baseColumns = [{
|
|
@@ -115,7 +116,8 @@ export default (({
|
|
|
115
116
|
}) => jsx(TableHeading, {
|
|
116
117
|
key: key,
|
|
117
118
|
style: {
|
|
118
|
-
width
|
|
119
|
+
width,
|
|
120
|
+
padding
|
|
119
121
|
}
|
|
120
122
|
}, jsx(Skeleton, {
|
|
121
123
|
appearance: "darkGray",
|
|
@@ -23,7 +23,7 @@ import { Table, TableHeading } from './styled';
|
|
|
23
23
|
import { useIsOnScreen } from './useIsOnScreen';
|
|
24
24
|
const tableSidePadding = "var(--ds-space-200, 16px)";
|
|
25
25
|
const tableHeadStyles = css({
|
|
26
|
-
background: "var(--ds-surface, #FFF)",
|
|
26
|
+
background: "var(--ds-elevation-surface-current, #FFF)",
|
|
27
27
|
position: 'sticky',
|
|
28
28
|
top: 0,
|
|
29
29
|
zIndex: stickyTableHeadersIndex
|
|
@@ -33,7 +33,7 @@ const ColumnPickerHeader = styled.th`
|
|
|
33
33
|
z-index: 10;
|
|
34
34
|
position: sticky;
|
|
35
35
|
right: calc(-1 * ${tableSidePadding});
|
|
36
|
-
background-color: ${"var(--ds-surface, #FFF)"};
|
|
36
|
+
background-color: ${"var(--ds-elevation-surface-current, #FFF)"};
|
|
37
37
|
border-bottom: 2px solid ${`var(--ds-border, ${N40})`}; /* It is required to have solid (not half-transparent) color because of this gradient business below */
|
|
38
38
|
|
|
39
39
|
padding-right: ${"var(--ds-space-100, 4px)"};
|
|
@@ -41,7 +41,7 @@ const ColumnPickerHeader = styled.th`
|
|
|
41
41
|
background: linear-gradient(
|
|
42
42
|
90deg,
|
|
43
43
|
rgba(255, 255, 255, 0) 0%,
|
|
44
|
-
${"var(--ds-surface, #FFF)"} 10%
|
|
44
|
+
${"var(--ds-elevation-surface-current, #FFF)"} 10%
|
|
45
45
|
);
|
|
46
46
|
vertical-align: middle; /* Keeps dropdown button in the middle */
|
|
47
47
|
&:last-of-type {
|
|
@@ -56,19 +56,131 @@ const truncatedCellStyles = css({
|
|
|
56
56
|
borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
57
57
|
borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
58
58
|
'&:first-child': {
|
|
59
|
-
paddingLeft: `${"var(--ds-space-100,
|
|
59
|
+
paddingLeft: `${"var(--ds-space-100, 8px)"}`
|
|
60
60
|
},
|
|
61
61
|
'&:last-child': {
|
|
62
62
|
borderRight: 0,
|
|
63
|
-
paddingRight: `${"var(--ds-space-100,
|
|
63
|
+
paddingRight: `${"var(--ds-space-100, 8px)"}`
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
const tableContainerStyles = css({
|
|
67
|
-
borderRadius: 'inherit'
|
|
67
|
+
borderRadius: 'inherit',
|
|
68
|
+
borderBottomLeftRadius: 0,
|
|
69
|
+
borderBottomRightRadius: 0
|
|
68
70
|
});
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Following section deals with slight gradient shadows that we add
|
|
74
|
+
* on all four sides when there is more content in that direction.
|
|
75
|
+
*
|
|
76
|
+
* We do that by applying two gradients to the background -
|
|
77
|
+
* one is "static" ('local') and other is "sticky" ('scroll'). \
|
|
78
|
+
* "Static" one makes a white color gradient, that when window is at the end of scrollable area goes on top
|
|
79
|
+
* of "sticky" (gray) one, dominating and hence disabling sticky one.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
const shadowColor = "var(--ds-shadow-overflow-perimeter, rgba(0, 0, 0, 0.1))";
|
|
83
|
+
const shadowColorLight = "var(--ds-shadow-overflow-perimeter, rgba(0, 0, 0, 0.05))";
|
|
84
|
+
const leftWhiteOverrideGradient = {
|
|
85
|
+
background: `
|
|
86
|
+
linear-gradient(
|
|
87
|
+
90deg,
|
|
88
|
+
${"var(--ds-elevation-surface-current, #FFF)"} 30%,
|
|
89
|
+
rgba(255, 255, 255, 0)
|
|
90
|
+
) left center`,
|
|
91
|
+
size: `40px 100%`,
|
|
92
|
+
attachment: `local`
|
|
93
|
+
};
|
|
94
|
+
const topWhiteOverrideGradient = {
|
|
95
|
+
background: `
|
|
96
|
+
linear-gradient(
|
|
97
|
+
0deg,
|
|
98
|
+
rgba(255, 255, 255, 0),
|
|
99
|
+
${"var(--ds-elevation-surface-current, #FFF)"} 30%
|
|
100
|
+
) top center`,
|
|
101
|
+
size: `100% 100px`,
|
|
102
|
+
attachment: `local`
|
|
103
|
+
};
|
|
104
|
+
const rightWhiteOverrideGradient = {
|
|
105
|
+
background: `
|
|
106
|
+
linear-gradient(
|
|
107
|
+
90deg,
|
|
108
|
+
rgba(255, 255, 255, 0),
|
|
109
|
+
${"var(--ds-elevation-surface-current, #FFF)"} 70%
|
|
110
|
+
) right center`,
|
|
111
|
+
size: `40px 100%`,
|
|
112
|
+
attachment: `local`
|
|
113
|
+
};
|
|
114
|
+
const bottomWhiteOverride = {
|
|
115
|
+
background: `
|
|
116
|
+
linear-gradient(
|
|
117
|
+
0deg,
|
|
118
|
+
${"var(--ds-elevation-surface-current, #FFF)"} 30%,
|
|
119
|
+
rgba(255, 255, 255, 0)
|
|
120
|
+
) bottom center`,
|
|
121
|
+
size: `100% 40px`,
|
|
122
|
+
attachment: `local`
|
|
123
|
+
};
|
|
124
|
+
const leftShadowGradient = {
|
|
125
|
+
background: `
|
|
126
|
+
linear-gradient(
|
|
127
|
+
90deg,
|
|
128
|
+
${shadowColor},
|
|
129
|
+
rgba(0, 0, 0, 0)
|
|
130
|
+
) left center`,
|
|
131
|
+
size: `14px 100%`,
|
|
132
|
+
attachment: `scroll`
|
|
133
|
+
};
|
|
134
|
+
const topShadowGradient = {
|
|
135
|
+
background: `
|
|
136
|
+
linear-gradient(
|
|
137
|
+
0deg,
|
|
138
|
+
rgba(0, 0, 0, 0),
|
|
139
|
+
${shadowColorLight}
|
|
140
|
+
) 0 52px`,
|
|
141
|
+
size: `100% 14px`,
|
|
142
|
+
attachment: `scroll`
|
|
143
|
+
};
|
|
144
|
+
const rightShadowGradient = {
|
|
145
|
+
background: `
|
|
146
|
+
linear-gradient(
|
|
147
|
+
90deg,
|
|
148
|
+
rgba(0, 0, 0, 0),
|
|
149
|
+
${shadowColor}
|
|
150
|
+
) right center`,
|
|
151
|
+
size: `14px 100%`,
|
|
152
|
+
attachment: `scroll`
|
|
153
|
+
};
|
|
154
|
+
const bottomShadowGradient = {
|
|
155
|
+
background: `
|
|
156
|
+
linear-gradient(
|
|
157
|
+
0deg,
|
|
158
|
+
${shadowColorLight},
|
|
159
|
+
rgba(0, 0, 0, 0)
|
|
160
|
+
) bottom center`,
|
|
161
|
+
size: `100% 10px`,
|
|
162
|
+
attachment: `scroll`
|
|
163
|
+
};
|
|
164
|
+
const shadows = [leftWhiteOverrideGradient, leftShadowGradient, rightWhiteOverrideGradient, rightShadowGradient, topWhiteOverrideGradient, topShadowGradient, bottomWhiteOverride, bottomShadowGradient];
|
|
165
|
+
export const scrollableContainerShadowsCssComponents = {
|
|
166
|
+
background: shadows.map(({
|
|
167
|
+
background
|
|
168
|
+
}) => background).join(','),
|
|
169
|
+
backgroundRepeat: 'no-repeat',
|
|
170
|
+
backgroundSize: shadows.map(({
|
|
171
|
+
size
|
|
172
|
+
}) => size).join(','),
|
|
173
|
+
backgroundAttachment: shadows.map(({
|
|
174
|
+
attachment
|
|
175
|
+
}) => attachment).join(',')
|
|
176
|
+
};
|
|
69
177
|
const scrollableContainerStyles = css({
|
|
70
178
|
overflow: 'auto',
|
|
71
|
-
boxSizing: 'border-box'
|
|
179
|
+
boxSizing: 'border-box',
|
|
180
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
181
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
182
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
183
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
72
184
|
});
|
|
73
185
|
const tableStyles = css({
|
|
74
186
|
// These styles are needed to prevent thead bottom border from scrolling away.
|
|
@@ -102,11 +214,11 @@ const BASE_WIDTH = 8;
|
|
|
102
214
|
const DEFAULT_WIDTH = BASE_WIDTH * 22;
|
|
103
215
|
export const COLUMN_MIN_WIDTH = BASE_WIDTH * 3;
|
|
104
216
|
const keyBasedWidthMap = {
|
|
105
|
-
priority: BASE_WIDTH *
|
|
217
|
+
priority: BASE_WIDTH * 5,
|
|
106
218
|
status: BASE_WIDTH * 18,
|
|
107
219
|
summary: BASE_WIDTH * 45,
|
|
108
220
|
description: BASE_WIDTH * 31.25,
|
|
109
|
-
type: BASE_WIDTH *
|
|
221
|
+
type: BASE_WIDTH * 5,
|
|
110
222
|
key: BASE_WIDTH * 13
|
|
111
223
|
};
|
|
112
224
|
function getDefaultColumnWidth(key, type) {
|
|
@@ -118,7 +230,7 @@ function getDefaultColumnWidth(key, type) {
|
|
|
118
230
|
case 'date':
|
|
119
231
|
return BASE_WIDTH * 14;
|
|
120
232
|
case 'icon':
|
|
121
|
-
return BASE_WIDTH *
|
|
233
|
+
return BASE_WIDTH * 5;
|
|
122
234
|
default:
|
|
123
235
|
return DEFAULT_WIDTH;
|
|
124
236
|
}
|
|
@@ -442,7 +554,7 @@ export const IssueLikeDataTableView = ({
|
|
|
442
554
|
if (key !== null && key !== void 0 && key.includes('loading')) {
|
|
443
555
|
loadingRowStyle = {
|
|
444
556
|
...loadingRowStyle,
|
|
445
|
-
paddingBlock: "var(--ds-space-100,
|
|
557
|
+
paddingBlock: "var(--ds-space-100, 8px)"
|
|
446
558
|
};
|
|
447
559
|
}
|
|
448
560
|
return jsx("td", {
|
|
@@ -5,12 +5,15 @@ export const FieldTextFontSize = '14px';
|
|
|
5
5
|
export const Table = styled.table`
|
|
6
6
|
width: 100%;
|
|
7
7
|
`;
|
|
8
|
+
const lineHeight = "var(--ds-font-lineHeight-300, 24px)";
|
|
9
|
+
const verticalPadding = "var(--ds-space-025, 2px)";
|
|
8
10
|
export const TableHeading = styled.th`
|
|
9
11
|
position: relative;
|
|
10
|
-
line-height: ${
|
|
12
|
+
line-height: ${lineHeight};
|
|
13
|
+
padding: ${verticalPadding} ${"var(--ds-space-050, 4px)"};
|
|
11
14
|
border-right: 0.5px solid ${`var(--ds-border, ${N40})`};
|
|
12
15
|
border-bottom: 2px solid ${`var(--ds-border, ${N40})`};
|
|
13
|
-
height: calc(
|
|
16
|
+
height: calc(${lineHeight} * 2 + ${verticalPadding} * 2);
|
|
14
17
|
vertical-align: bottom;
|
|
15
18
|
|
|
16
19
|
&.has-column-picker:nth-last-of-type(2) {
|
|
@@ -18,7 +21,7 @@ export const TableHeading = styled.th`
|
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
&:first-child {
|
|
21
|
-
padding-left: ${"var(--ds-space-
|
|
24
|
+
padding-left: ${"var(--ds-space-050, 4px)"};
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
&:last-child {
|
|
@@ -27,13 +30,12 @@ export const TableHeading = styled.th`
|
|
|
27
30
|
|
|
28
31
|
& [data-testid='datasource-header-content--container'] {
|
|
29
32
|
width: 100%;
|
|
30
|
-
padding: ${
|
|
33
|
+
padding: ${verticalPadding} ${"var(--ds-space-050, 4px)"};
|
|
31
34
|
display: -webkit-box;
|
|
32
35
|
-webkit-line-clamp: 2;
|
|
33
36
|
-webkit-box-orient: vertical;
|
|
34
37
|
white-space: normal;
|
|
35
38
|
overflow: hidden;
|
|
36
|
-
max-height: 2.5rem;
|
|
37
39
|
word-wrap: break-word;
|
|
38
40
|
|
|
39
41
|
&:hover {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const filterOptionMessages = defineMessages({
|
|
3
|
+
assigneeUnassignedFilterOption: {
|
|
4
|
+
id: 'linkDataSource.basic-filter.dropdown.select.assignee.unassigned',
|
|
5
|
+
description: 'Text to display for Unassigned assignee filter option.',
|
|
6
|
+
defaultMessage: 'Unassigned'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
2
3
|
import { useBasicFilterAGG } from '../../../../services/useBasicFilterAGG';
|
|
3
4
|
import { mapFieldValuesToFilterOptions, mapFieldValuesToPageCursor, mapFieldValuesToTotalCount } from '../utils/transformers';
|
|
5
|
+
import { filterOptionMessages } from './messages';
|
|
6
|
+
export const getAssigneeUnassignedFilterOption = formatMessage => ({
|
|
7
|
+
label: formatMessage(filterOptionMessages.assigneeUnassignedFilterOption),
|
|
8
|
+
optionType: 'avatarLabel',
|
|
9
|
+
value: 'empty'
|
|
10
|
+
});
|
|
4
11
|
export const useFilterOptions = ({
|
|
5
12
|
filterType,
|
|
6
13
|
cloudId
|
|
7
14
|
}) => {
|
|
15
|
+
const {
|
|
16
|
+
formatMessage
|
|
17
|
+
} = useIntl();
|
|
8
18
|
const [filterOptions, setFilterOptions] = useState([]);
|
|
9
19
|
const [totalCount, setTotalCount] = useState(0);
|
|
10
20
|
const [status, setStatus] = useState('empty');
|
|
@@ -37,26 +47,37 @@ export const useFilterOptions = ({
|
|
|
37
47
|
setErrors(response.errors);
|
|
38
48
|
return;
|
|
39
49
|
}
|
|
50
|
+
const mappedResponse = mapFieldValuesToFilterOptions(response);
|
|
51
|
+
let mappedTotalCount = mapFieldValuesToTotalCount(response);
|
|
40
52
|
if (isNewSearch) {
|
|
41
|
-
setFilterOptions(mapFieldValuesToFilterOptions(response));
|
|
42
53
|
if (isRequestLikeInitialSearch) {
|
|
43
54
|
/**
|
|
44
55
|
* The initial dataset is used in couple of paths, eg: when a user searches and clears the search text.
|
|
45
56
|
* During these times, we dont want to fetch data again and again, hence a mini cache setup to store and provide the initial dataset
|
|
46
57
|
*/
|
|
47
58
|
initialData.current = response;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* For assignee filter option, we want `Unassigned` as an option.
|
|
62
|
+
* Since `Unassigned/EMPTY` is not returned by the API, we add it manually, but only for the initial list
|
|
63
|
+
*/
|
|
64
|
+
if (filterType === 'assignee') {
|
|
65
|
+
mappedResponse.unshift(getAssigneeUnassignedFilterOption(formatMessage));
|
|
66
|
+
mappedTotalCount += 1;
|
|
67
|
+
}
|
|
48
68
|
}
|
|
69
|
+
setFilterOptions(mappedResponse);
|
|
49
70
|
} else {
|
|
50
|
-
setFilterOptions([...filterOptions, ...
|
|
71
|
+
setFilterOptions([...filterOptions, ...mappedResponse]);
|
|
51
72
|
}
|
|
52
|
-
setTotalCount(
|
|
73
|
+
setTotalCount(mappedTotalCount);
|
|
53
74
|
setNextPageCursor(mapFieldValuesToPageCursor(response));
|
|
54
75
|
setStatus('resolved');
|
|
55
76
|
} catch (error) {
|
|
56
77
|
setStatus('rejected');
|
|
57
78
|
setErrors([error]);
|
|
58
79
|
}
|
|
59
|
-
}, [cloudId, filterOptions, filterType, getFieldValues]);
|
|
80
|
+
}, [cloudId, filterOptions, filterType, formatMessage, getFieldValues]);
|
|
60
81
|
useEffect(() => {
|
|
61
82
|
if (status !== 'rejected' && errors.length !== 0) {
|
|
62
83
|
setErrors([]);
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { OPERAND_EMPTY } from '@atlaskit/jql-ast';
|
|
2
4
|
import { useBasicFilterAGG } from '../../../../services/useBasicFilterAGG';
|
|
3
5
|
import { extractValuesFromNonComplexJQL } from '../utils/extractValuesFromNonComplexJQL';
|
|
4
6
|
import { removeFuzzyCharacter } from '../utils/isClauseTooComplex';
|
|
5
7
|
import { mapHydrateResponseData } from '../utils/transformers';
|
|
8
|
+
import { getAssigneeUnassignedFilterOption } from './useFilterOptions';
|
|
6
9
|
export const useHydrateJqlQuery = (cloudId, jql) => {
|
|
7
10
|
const [hydratedOptions, setHydratedOptions] = useState({});
|
|
11
|
+
const {
|
|
12
|
+
formatMessage
|
|
13
|
+
} = useIntl();
|
|
8
14
|
const [status, setStatus] = useState('empty');
|
|
9
15
|
const [errors, setErrors] = useState([]);
|
|
10
16
|
const {
|
|
@@ -19,6 +25,10 @@ export const useHydrateJqlQuery = (cloudId, jql) => {
|
|
|
19
25
|
setErrors(response.errors);
|
|
20
26
|
return;
|
|
21
27
|
}
|
|
28
|
+
const {
|
|
29
|
+
assignee: mappedHydratedAssigneeValue,
|
|
30
|
+
...restOfMappedHydratedResponse
|
|
31
|
+
} = mapHydrateResponseData(response);
|
|
22
32
|
|
|
23
33
|
/**
|
|
24
34
|
* Hydrate logic does not return text field, hence we parse and extract value from jql
|
|
@@ -26,11 +36,19 @@ export const useHydrateJqlQuery = (cloudId, jql) => {
|
|
|
26
36
|
const {
|
|
27
37
|
text,
|
|
28
38
|
summary,
|
|
29
|
-
key
|
|
39
|
+
key,
|
|
40
|
+
assignee: extractedAssigneeValue
|
|
30
41
|
} = extractValuesFromNonComplexJQL(jql);
|
|
31
42
|
const [textFieldValue] = text || summary || key || [];
|
|
32
43
|
const mappedValues = {
|
|
33
|
-
...
|
|
44
|
+
...restOfMappedHydratedResponse,
|
|
45
|
+
/**
|
|
46
|
+
* Special handling for assignee as we need to inject Unassigned value if JQL contains EMPTY keyword for assignee
|
|
47
|
+
*/
|
|
48
|
+
assignee: [...(mappedHydratedAssigneeValue || []),
|
|
49
|
+
// all values provided by the hydrate API for assignee
|
|
50
|
+
...(extractedAssigneeValue !== null && extractedAssigneeValue !== void 0 && extractedAssigneeValue.includes(OPERAND_EMPTY) // checks and adds EMPTY filter option if extracted assignee values from jql contains EMPTY
|
|
51
|
+
? [getAssigneeUnassignedFilterOption(formatMessage)] : [])],
|
|
34
52
|
...(textFieldValue ? {
|
|
35
53
|
basicInputTextValue: removeFuzzyCharacter(textFieldValue)
|
|
36
54
|
} : {})
|
|
@@ -41,7 +59,7 @@ export const useHydrateJqlQuery = (cloudId, jql) => {
|
|
|
41
59
|
setErrors([error]);
|
|
42
60
|
setStatus('rejected');
|
|
43
61
|
}
|
|
44
|
-
}, [cloudId, getHydratedJQL, jql]);
|
|
62
|
+
}, [cloudId, formatMessage, getHydratedJQL, jql]);
|
|
45
63
|
useEffect(() => {
|
|
46
64
|
if (status !== 'rejected' && errors.length !== 0) {
|
|
47
65
|
setErrors([]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const asyncPopupSelectMessages = defineMessages({
|
|
2
3
|
selectPlaceholder: {
|
|
3
4
|
id: 'linkDataSource.basic-filter.dropdown.select.placeholder',
|
|
4
5
|
description: 'Placeholder text to be displayed for the search input box.',
|
|
@@ -34,4 +35,4 @@ export const asyncPopupSelectMessages = {
|
|
|
34
35
|
defaultMessage: 'Show more',
|
|
35
36
|
description: 'The text to show more options in dropdown'
|
|
36
37
|
}
|
|
37
|
-
};
|
|
38
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const asyncPopupSelectMessages = defineMessages({
|
|
2
3
|
loadingMessage: {
|
|
3
4
|
id: 'linkDataSource.basic-filter.loading-message',
|
|
4
5
|
defaultMessage: 'Loading...',
|
|
@@ -14,4 +15,4 @@ export const asyncPopupSelectMessages = {
|
|
|
14
15
|
defaultMessage: 'Something went wrong',
|
|
15
16
|
description: 'The text for when an error occurs when loading options'
|
|
16
17
|
}
|
|
17
|
-
};
|
|
18
|
+
});
|
package/dist/es2019/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js
CHANGED
|
@@ -6,9 +6,19 @@ import { isQueryTooComplex } from './isQueryTooComplex';
|
|
|
6
6
|
// Map of field keys to their respective clauses in the Jast
|
|
7
7
|
|
|
8
8
|
const getFieldValues = operand => {
|
|
9
|
+
const mapValuesFromList = value => {
|
|
10
|
+
if (value.operandType === OPERAND_TYPE_VALUE) {
|
|
11
|
+
return value.value;
|
|
12
|
+
}
|
|
13
|
+
// we only support EMPTY keyword atm, hence making sure if operandType is a KEYWORD, then its an EMPTY keyword
|
|
14
|
+
if (value.operandType === OPERAND_TYPE_KEYWORD && value.value === OPERAND_EMPTY) {
|
|
15
|
+
return value.value;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
};
|
|
9
19
|
switch (operand.operandType) {
|
|
10
20
|
case OPERAND_TYPE_LIST:
|
|
11
|
-
return operand.values.map(
|
|
21
|
+
return operand.values.map(mapValuesFromList).filter(value => !!value);
|
|
12
22
|
case OPERAND_TYPE_VALUE:
|
|
13
23
|
return operand.value ? [operand.value] : [];
|
|
14
24
|
case OPERAND_TYPE_KEYWORD:
|
|
@@ -22,7 +22,7 @@ import { AccessRequired } from '../../common/error-state/access-required';
|
|
|
22
22
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
23
23
|
import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
24
24
|
import { NoResults } from '../../common/error-state/no-results';
|
|
25
|
-
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
25
|
+
import { EmptyState, IssueLikeDataTableView, scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
26
26
|
import LinkRenderType from '../../issue-like-table/render-type/link';
|
|
27
27
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
28
28
|
import { InitialStateView } from '../initial-state-view';
|
|
@@ -46,7 +46,11 @@ const contentContainerStyles = css({
|
|
|
46
46
|
display: 'grid',
|
|
47
47
|
maxHeight: '420px',
|
|
48
48
|
overflow: 'auto',
|
|
49
|
-
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}
|
|
49
|
+
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}`,
|
|
50
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
51
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
52
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
53
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
50
54
|
});
|
|
51
55
|
const placeholderSmartLinkStyles = css({
|
|
52
56
|
backgroundColor: `var(--ds-surface-raised, ${N0})`,
|
|
@@ -15,14 +15,16 @@ const FooterWrapper = styled.div`
|
|
|
15
15
|
padding: 0 ${"var(--ds-space-200, 16px)"};
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
border-radius: inherit;
|
|
18
|
+
border-top-left-radius: 0;
|
|
19
|
+
border-top-right-radius: 0;
|
|
18
20
|
background: ${`var(--ds-background-input, ${N0})`};
|
|
21
|
+
border-top: 2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`};
|
|
19
22
|
`;
|
|
20
23
|
const TopBorderWrapper = styled.div`
|
|
21
24
|
display: flex;
|
|
22
25
|
box-sizing: border-box;
|
|
23
26
|
justify-content: space-between;
|
|
24
27
|
padding: ${"var(--ds-space-250, 20px)"} 0;
|
|
25
|
-
border-top: 2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`};
|
|
26
28
|
`;
|
|
27
29
|
const ItemCounterWrapper = styled.div`
|
|
28
30
|
display: flex;
|
|
@@ -27,6 +27,7 @@ import i18nEN from '../../../i18n/en';
|
|
|
27
27
|
import { PermissionError } from '../../../services/cmdbService.utils';
|
|
28
28
|
import { AccessRequired } from '../../../ui/common/error-state/access-required';
|
|
29
29
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
30
|
+
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
30
31
|
import { AssetsSearchContainer } from '../search-container';
|
|
31
32
|
import { AssetsSearchContainerLoading } from '../search-container/loading-state';
|
|
32
33
|
import { modalMessages } from './messages';
|
|
@@ -34,7 +35,11 @@ import { RenderAssetsContent } from './render-assets-content';
|
|
|
34
35
|
var modalBodyWrapperStyles = css({
|
|
35
36
|
display: 'grid',
|
|
36
37
|
height: '420px',
|
|
37
|
-
overflow: 'auto'
|
|
38
|
+
overflow: 'auto',
|
|
39
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
40
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
41
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
42
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
38
43
|
});
|
|
39
44
|
var modalBodyErrorWrapperStyles = css({
|
|
40
45
|
alignItems: 'center'
|
|
@@ -16,16 +16,17 @@ var SkeletonComponent = function SkeletonComponent(_ref) {
|
|
|
16
16
|
var tableBodyStyles = css({
|
|
17
17
|
borderBottom: 0
|
|
18
18
|
});
|
|
19
|
+
var padding = "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)");
|
|
19
20
|
var cellStyles = css({
|
|
20
|
-
|
|
21
|
+
padding: padding,
|
|
21
22
|
borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
22
23
|
borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
23
24
|
'&:first-child': {
|
|
24
|
-
paddingLeft: "var(--ds-space-100,
|
|
25
|
+
paddingLeft: "var(--ds-space-100, 8px)"
|
|
25
26
|
},
|
|
26
27
|
'&:last-child': {
|
|
27
28
|
borderRight: 0,
|
|
28
|
-
paddingRight: "var(--ds-space-100,
|
|
29
|
+
paddingRight: "var(--ds-space-100, 8px)"
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
var baseColumns = [{
|
|
@@ -115,7 +116,8 @@ export default (function (_ref4) {
|
|
|
115
116
|
return jsx(TableHeading, {
|
|
116
117
|
key: key,
|
|
117
118
|
style: {
|
|
118
|
-
width: width
|
|
119
|
+
width: width,
|
|
120
|
+
padding: padding
|
|
119
121
|
}
|
|
120
122
|
}, jsx(Skeleton, {
|
|
121
123
|
appearance: "darkGray",
|