pixel-react 1.0.3 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.yarn/install-state.gz +0 -0
- package/lib/components/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- package/lib/components/AddResourceButton/type.d.ts +13 -10
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +1 -1
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +1 -0
- package/lib/components/InputWithDropdown/types.d.ts +4 -0
- package/lib/components/MenuOption/types.d.ts +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/types.d.ts +5 -1
- package/lib/components/StateDropdown/StateDropdown.d.ts +3 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StateDropdown/StateDropdownTypes.d.ts +11 -0
- package/lib/components/StateDropdown/index.d.ts +1 -0
- package/lib/components/StatusButton/StatusButton.d.ts +4 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/StatusButton/index.d.ts +1 -0
- package/lib/components/StatusButton/types.d.ts +35 -0
- package/lib/components/Tabs/Tabs.d.ts +1 -1
- package/lib/components/Tabs/Tabs.stories.d.ts +1 -0
- package/lib/components/Tabs/types.d.ts +6 -2
- package/lib/index.d.ts +84 -11
- package/lib/index.esm.js +339 -86
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +342 -86
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +0 -3
- package/src/assets/Themes/BaseTheme.scss +45 -16
- package/src/assets/Themes/DarkTheme.scss +48 -10
- package/src/assets/icons/active_license_icon.svg +3 -0
- package/src/assets/icons/delete.svg +2 -16
- package/src/assets/icons/delete_info.svg +17 -0
- package/src/assets/icons/details.svg +3 -0
- package/src/assets/icons/edit_icon.svg +5 -0
- package/src/assets/icons/expired_license_icon.svg +3 -0
- package/src/assets/icons/expiringSoon_license_icon.svg +3 -0
- package/src/assets/icons/export_collection_icon.svg +13 -0
- package/src/assets/icons/hide_icon.svg +9 -0
- package/src/assets/icons/impactList.svg +6 -0
- package/src/assets/icons/run_icon.svg +26 -0
- package/src/assets/icons/view_icon.svg +3 -0
- package/src/assets/utils/functionUtils.ts +5 -5
- package/src/components/AddButton/AddButton.scss +38 -0
- package/src/components/AddButton/AddButton.stories.tsx +24 -0
- package/src/components/AddButton/AddButton.tsx +25 -0
- package/src/components/AddButton/index.ts +1 -0
- package/src/components/AddButton/types.ts +4 -0
- package/src/components/AddResourceButton/type.ts +42 -10
- package/src/components/Button/index.ts +1 -1
- package/src/components/Icon/iconList.ts +24 -2
- package/src/components/Input/Input.stories.tsx +1 -1
- package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +59 -2
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +3 -1
- package/src/components/InputWithDropdown/types.ts +4 -0
- package/src/components/MenuOption/types.ts +1 -1
- package/src/components/Search/Search.scss +70 -72
- package/src/components/Select/Select.tsx +29 -25
- package/src/components/Select/types.ts +5 -1
- package/src/components/StateDropdown/StateDropdown.stories.tsx +99 -0
- package/src/components/StateDropdown/StateDropdown.tsx +218 -0
- package/src/components/StateDropdown/StateDropdownTypes.tsx +21 -0
- package/src/components/StateDropdown/index.ts +1 -0
- package/src/components/StatusButton/StatusButton.scss +90 -0
- package/src/components/StatusButton/StatusButton.stories.tsx +91 -0
- package/src/components/StatusButton/StatusButton.tsx +40 -0
- package/src/components/StatusButton/index.ts +1 -0
- package/src/components/StatusButton/types.ts +45 -0
- package/src/components/Table/Table.scss +2 -2
- package/src/components/Tabs/Tabs.scss +3 -0
- package/src/components/Tabs/Tabs.stories.tsx +31 -0
- package/src/components/Tabs/Tabs.tsx +6 -1
- package/src/components/Tabs/types.ts +6 -2
- package/src/index.ts +7 -0
- package/vite.config.js +0 -8
- package/lib/index.css +0 -404
- package/lib/index.esm.css +0 -404
@@ -1,87 +1,85 @@
|
|
1
1
|
@use '../../assets/styles/fonts';
|
2
2
|
|
3
|
-
|
4
3
|
.ff-search-container {
|
4
|
+
display: flex;
|
5
|
+
align-items: center;
|
6
|
+
justify-content: space-between;
|
7
|
+
.ff-search-icon {
|
5
8
|
display: flex;
|
6
9
|
align-items: center;
|
7
|
-
justify-content:
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
.ff-icon-container {
|
17
|
-
svg {
|
18
|
-
path {
|
19
|
-
fill: var(--brand-color)
|
20
|
-
}
|
21
|
-
}
|
10
|
+
justify-content: center;
|
11
|
+
cursor: pointer;
|
12
|
+
border: 1px solid var(--border-color);
|
13
|
+
border-radius: 4px;
|
14
|
+
padding: 4px;
|
15
|
+
.ff-icon-container {
|
16
|
+
svg {
|
17
|
+
path {
|
18
|
+
fill: var(--brand-color);
|
22
19
|
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
.ff-search-input {
|
24
|
+
@extend .fontXs;
|
25
|
+
border: none;
|
26
|
+
color: var(--tooltip-bg-color);
|
27
|
+
line-height: 12px;
|
28
|
+
visibility: hidden;
|
29
|
+
transition: width 0.4s ease;
|
30
|
+
&:focus {
|
31
|
+
outline: none;
|
32
|
+
border: none;
|
23
33
|
}
|
24
|
-
.ff-search-input {
|
25
|
-
@extend .fontXs;
|
26
|
-
border: none;
|
27
|
-
color: var(--tooltip-bg-color);
|
28
|
-
line-height: 12px;
|
29
|
-
visibility: hidden;
|
30
|
-
transition: width 0.4s ease;
|
31
|
-
&:focus {
|
32
|
-
outline: none;
|
33
|
-
border: none;
|
34
|
-
}
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
}
|
35
|
+
&:hover {
|
36
|
+
border: none;
|
39
37
|
}
|
40
|
-
|
41
|
-
|
38
|
+
}
|
39
|
+
&.disabled {
|
40
|
+
opacity: 0.5;
|
41
|
+
}
|
42
|
+
&.expanded {
|
43
|
+
border: 1px solid var(--border-color);
|
44
|
+
border-radius: 4px;
|
45
|
+
.ff-vertical-line {
|
46
|
+
height: 8px;
|
47
|
+
width: 1px;
|
48
|
+
position: relative;
|
49
|
+
right: 2px;
|
50
|
+
border-radius: 1px;
|
51
|
+
margin: 8px 0px;
|
52
|
+
background-color: var(--border-color);
|
42
53
|
}
|
43
|
-
|
44
|
-
|
45
|
-
border-radius: 4px;
|
46
|
-
.ff-vertical-line {
|
47
|
-
height: 8px;
|
48
|
-
width: 1px;
|
49
|
-
position: relative;
|
50
|
-
right: 2px;
|
51
|
-
border-radius: 1px;
|
52
|
-
margin: 8px 0px;
|
53
|
-
background-color: var(--border-color);
|
54
|
-
}
|
55
|
-
.ff-search-input {
|
56
|
-
visibility: visible;
|
57
|
-
|
58
|
-
&::placeholder {
|
59
|
-
color: var(--ff-search-filed-placeholder-text);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
.ff-search-icon {
|
63
|
-
padding: 4px;
|
64
|
-
border: none;
|
65
|
-
cursor: default;
|
54
|
+
.ff-search-input {
|
55
|
+
visibility: visible;
|
66
56
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
57
|
+
&::placeholder {
|
58
|
+
color: var(--ff-search-filed-placeholder-text);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
.ff-search-icon {
|
62
|
+
padding: 4px;
|
63
|
+
border: none;
|
64
|
+
cursor: default;
|
65
|
+
}
|
66
|
+
.ff-search-clear-button {
|
67
|
+
display: grid;
|
68
|
+
place-items: center;
|
69
|
+
cursor: pointer;
|
70
|
+
width: 22px;
|
71
|
+
}
|
72
|
+
.ff-search-close-icon {
|
73
|
+
margin: 4px;
|
74
|
+
cursor: pointer;
|
77
75
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
}
|
84
|
-
}
|
76
|
+
.ff-icon-container {
|
77
|
+
svg {
|
78
|
+
path {
|
79
|
+
fill: var(--ff-search-filed-close-Icon);
|
80
|
+
}
|
85
81
|
}
|
82
|
+
}
|
86
83
|
}
|
84
|
+
}
|
87
85
|
}
|
@@ -114,6 +114,7 @@ const Select = ({
|
|
114
114
|
borderRadius = true,
|
115
115
|
showBorder = true,
|
116
116
|
required = false,
|
117
|
+
optionsRequired = true,
|
117
118
|
}: SelectProps) => {
|
118
119
|
const initialState: SelectState = useMemo(
|
119
120
|
() => ({
|
@@ -291,17 +292,18 @@ const Select = ({
|
|
291
292
|
{label}
|
292
293
|
</div>
|
293
294
|
)}
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
295
|
+
{optionsRequired && (
|
296
|
+
<Icon
|
297
|
+
name="arrow_up"
|
298
|
+
height={7}
|
299
|
+
width={12}
|
300
|
+
className={classNames('ff-select-arrow', {
|
301
|
+
'ff-select-arrow--down': isIconClick,
|
302
|
+
'ff-select-arrow--no-label': !showLabel,
|
303
|
+
})}
|
304
|
+
color={iconColor}
|
305
|
+
/>
|
306
|
+
)}
|
305
307
|
<fieldset
|
306
308
|
className={classNames('ff-select-fieldset', {
|
307
309
|
'ff-select-fieldset--no-label': !showLabel,
|
@@ -347,20 +349,22 @@ const Select = ({
|
|
347
349
|
</Typography>
|
348
350
|
)}
|
349
351
|
|
350
|
-
|
351
|
-
{
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
352
|
+
{optionsRequired && (
|
353
|
+
<div ref={DropDownRef}>
|
354
|
+
{showOptions &&
|
355
|
+
createPortal(
|
356
|
+
<Dropdown
|
357
|
+
onSelectBlur={onSelectBlur}
|
358
|
+
onSelectOptionSelector={onSelectOptionSelector}
|
359
|
+
dropdownPosition={dropdownPosition}
|
360
|
+
options={options}
|
361
|
+
optionZIndex={optionZIndex}
|
362
|
+
inputRef={InputRef}
|
363
|
+
/>,
|
364
|
+
document.body
|
365
|
+
)}
|
366
|
+
</div>
|
367
|
+
)}
|
364
368
|
</div>
|
365
369
|
);
|
366
370
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ReactNode } from
|
1
|
+
import { ReactNode } from 'react';
|
2
2
|
|
3
3
|
export interface SelectProps {
|
4
4
|
/*
|
@@ -60,6 +60,10 @@ export interface SelectProps {
|
|
60
60
|
* Provide the boolean value if the select component is required or not
|
61
61
|
*/
|
62
62
|
required?: boolean;
|
63
|
+
/**
|
64
|
+
* optionsRequired:false prop removes options from dropdown & shows static label only
|
65
|
+
*/
|
66
|
+
optionsRequired?: boolean;
|
63
67
|
}
|
64
68
|
|
65
69
|
export interface DrowdownPosition {
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import StateDropdown from './StateDropdown';
|
3
|
+
|
4
|
+
const meta: Meta<typeof StateDropdown> = {
|
5
|
+
title: 'Components/StateDropdown',
|
6
|
+
component: StateDropdown,
|
7
|
+
parameters: {
|
8
|
+
layout: 'centered',
|
9
|
+
},
|
10
|
+
tags: ['autodocs'],
|
11
|
+
};
|
12
|
+
|
13
|
+
type Story = StoryObj<typeof StateDropdown>;
|
14
|
+
|
15
|
+
export const Disable: Story = {
|
16
|
+
args: {
|
17
|
+
value: 'New',
|
18
|
+
handleStateValueClick: () => {},
|
19
|
+
handleDropdownOptionsClick: () => {},
|
20
|
+
isOnlyReviewer: false,
|
21
|
+
nodeObj: { label: 'New', value: 'New' },
|
22
|
+
isReviewer: true,
|
23
|
+
isApprovePage: false,
|
24
|
+
disabled: true,
|
25
|
+
userHasOnlyViewAccess: true,
|
26
|
+
},
|
27
|
+
};
|
28
|
+
|
29
|
+
export const Review: Story = {
|
30
|
+
args: {
|
31
|
+
value: 'Review',
|
32
|
+
handleStateValueClick: () => {},
|
33
|
+
handleDropdownOptionsClick: () => {},
|
34
|
+
isOnlyReviewer: false,
|
35
|
+
nodeObj: { label: 'Review', value: 'Review' },
|
36
|
+
isReviewer: true,
|
37
|
+
isApprovePage: true,
|
38
|
+
disabled: false,
|
39
|
+
userHasOnlyViewAccess: false,
|
40
|
+
},
|
41
|
+
};
|
42
|
+
|
43
|
+
export const Reject: Story = {
|
44
|
+
args: {
|
45
|
+
value: 'Rejected',
|
46
|
+
handleStateValueClick: () => {},
|
47
|
+
handleDropdownOptionsClick: () => {},
|
48
|
+
isOnlyReviewer: false,
|
49
|
+
nodeObj: { label: 'Rejected', value: 'Rejected' },
|
50
|
+
isReviewer: false,
|
51
|
+
isApprovePage: false,
|
52
|
+
disabled: false,
|
53
|
+
userHasOnlyViewAccess: false,
|
54
|
+
},
|
55
|
+
};
|
56
|
+
|
57
|
+
export const Approved: Story = {
|
58
|
+
args: {
|
59
|
+
value: 'Approved',
|
60
|
+
handleStateValueClick: () => {},
|
61
|
+
handleDropdownOptionsClick: () => {},
|
62
|
+
isOnlyReviewer: false,
|
63
|
+
nodeObj: { label: 'Approved', value: 'Approved' },
|
64
|
+
isReviewer: false,
|
65
|
+
isApprovePage: false,
|
66
|
+
disabled: false,
|
67
|
+
userHasOnlyViewAccess: true,
|
68
|
+
},
|
69
|
+
};
|
70
|
+
|
71
|
+
export const NewState: Story = {
|
72
|
+
render: () => {
|
73
|
+
const value = 'New';
|
74
|
+
const state = {
|
75
|
+
label: 'New',
|
76
|
+
value: 'New',
|
77
|
+
};
|
78
|
+
|
79
|
+
const handleDropdownOptionsClick = () => {};
|
80
|
+
|
81
|
+
const handleStateValueClick = () => {};
|
82
|
+
|
83
|
+
return (
|
84
|
+
<StateDropdown
|
85
|
+
value={value}
|
86
|
+
nodeObj={state}
|
87
|
+
isReviewer={false}
|
88
|
+
isApprovePage={false}
|
89
|
+
handleStateValueClick={handleStateValueClick}
|
90
|
+
handleDropdownOptionsClick={handleDropdownOptionsClick}
|
91
|
+
disabled={false}
|
92
|
+
isOnlyReviewer={false}
|
93
|
+
userHasOnlyViewAccess={false}
|
94
|
+
/>
|
95
|
+
);
|
96
|
+
},
|
97
|
+
};
|
98
|
+
|
99
|
+
export default meta;
|
@@ -0,0 +1,218 @@
|
|
1
|
+
import Select from './../Select/Select';
|
2
|
+
import { StateDropdownProps } from './StateDropdownTypes';
|
3
|
+
|
4
|
+
const StateDropdown = ({
|
5
|
+
value,
|
6
|
+
nodeObj,
|
7
|
+
isReviewer = false,
|
8
|
+
isApprovePage = false,
|
9
|
+
handleStateValueClick,
|
10
|
+
handleDropdownOptionsClick,
|
11
|
+
disabled = false,
|
12
|
+
isOnlyReviewer = false,
|
13
|
+
userHasOnlyViewAccess = false,
|
14
|
+
}: StateDropdownProps) => {
|
15
|
+
let currentState = value.toUpperCase();
|
16
|
+
let content;
|
17
|
+
let options;
|
18
|
+
const isReviewerAndClickedOnReviewState: boolean =
|
19
|
+
isReviewer && !isApprovePage && currentState === 'REVIEW' && !nodeObj;
|
20
|
+
let selectedOption: { label: string; value: string } = {
|
21
|
+
label: '',
|
22
|
+
value: '',
|
23
|
+
};
|
24
|
+
|
25
|
+
if (isOnlyReviewer && !isApprovePage) {
|
26
|
+
options = [
|
27
|
+
{
|
28
|
+
label: 'New',
|
29
|
+
value: 'New',
|
30
|
+
},
|
31
|
+
{
|
32
|
+
label: 'Approve',
|
33
|
+
value: 'Approve',
|
34
|
+
},
|
35
|
+
];
|
36
|
+
} else if (!isReviewer && !isApprovePage) {
|
37
|
+
options = [
|
38
|
+
{
|
39
|
+
label: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
40
|
+
value: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
41
|
+
},
|
42
|
+
{
|
43
|
+
label: 'Approve',
|
44
|
+
value: 'Approve',
|
45
|
+
},
|
46
|
+
];
|
47
|
+
} else if (isReviewerAndClickedOnReviewState) {
|
48
|
+
options = [
|
49
|
+
{
|
50
|
+
label: 'Review',
|
51
|
+
value: 'Review',
|
52
|
+
},
|
53
|
+
{
|
54
|
+
label: 'Approve',
|
55
|
+
value: 'Approve',
|
56
|
+
},
|
57
|
+
];
|
58
|
+
} else if (isReviewer && !isApprovePage) {
|
59
|
+
options = [
|
60
|
+
{
|
61
|
+
label: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
62
|
+
value: currentState === 'REJECTED' ? 'Rejected' : 'New',
|
63
|
+
},
|
64
|
+
{
|
65
|
+
label: 'Review',
|
66
|
+
value: 'Review',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
label: 'Approve',
|
70
|
+
value: 'Approve',
|
71
|
+
},
|
72
|
+
];
|
73
|
+
} else if (isReviewer && isApprovePage) {
|
74
|
+
options = [
|
75
|
+
{
|
76
|
+
label: 'Review',
|
77
|
+
value: 'Review',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
label: 'Approve',
|
81
|
+
value: 'Approve',
|
82
|
+
},
|
83
|
+
{
|
84
|
+
label: 'Reject',
|
85
|
+
value: 'Reject',
|
86
|
+
},
|
87
|
+
];
|
88
|
+
} else {
|
89
|
+
options = [
|
90
|
+
{
|
91
|
+
label: 'New',
|
92
|
+
value: 'New',
|
93
|
+
},
|
94
|
+
{
|
95
|
+
label: 'Review',
|
96
|
+
value: 'Review',
|
97
|
+
},
|
98
|
+
];
|
99
|
+
}
|
100
|
+
|
101
|
+
let handleSelectedOption: (value: string) => {
|
102
|
+
label: string;
|
103
|
+
value: string;
|
104
|
+
} = (value) => {
|
105
|
+
return { label: value, value: value };
|
106
|
+
};
|
107
|
+
if (currentState === 'REVIEW') {
|
108
|
+
selectedOption = handleSelectedOption(value);
|
109
|
+
} else if (currentState === 'NEW' && !isApprovePage) {
|
110
|
+
selectedOption = handleSelectedOption(value);
|
111
|
+
} else if (currentState === 'REJECTED' && !isApprovePage) {
|
112
|
+
selectedOption = handleSelectedOption(value);
|
113
|
+
} else {
|
114
|
+
selectedOption = handleSelectedOption(value);
|
115
|
+
}
|
116
|
+
|
117
|
+
if (
|
118
|
+
((currentState === 'NEW' && !isApprovePage) ||
|
119
|
+
(isApprovePage && currentState === 'REVIEW') ||
|
120
|
+
isReviewerAndClickedOnReviewState ||
|
121
|
+
(currentState === 'REJECTED' && !isApprovePage)) &&
|
122
|
+
!userHasOnlyViewAccess
|
123
|
+
) {
|
124
|
+
content = !disabled ? (
|
125
|
+
<Select
|
126
|
+
label={value}
|
127
|
+
disabled={disabled}
|
128
|
+
onChange={handleDropdownOptionsClick}
|
129
|
+
optionsList={options}
|
130
|
+
selectedOption={selectedOption}
|
131
|
+
showLabel={false}
|
132
|
+
showBorder={true}
|
133
|
+
/>
|
134
|
+
) : (
|
135
|
+
<Select
|
136
|
+
label={value}
|
137
|
+
disabled={true}
|
138
|
+
onChange={handleDropdownOptionsClick}
|
139
|
+
optionsList={options}
|
140
|
+
selectedOption={selectedOption}
|
141
|
+
showLabel={false}
|
142
|
+
showBorder={true}
|
143
|
+
/>
|
144
|
+
);
|
145
|
+
} else if (
|
146
|
+
currentState === 'REVIEW' &&
|
147
|
+
(!isApprovePage || userHasOnlyViewAccess)
|
148
|
+
) {
|
149
|
+
content = (
|
150
|
+
<Select
|
151
|
+
label={value}
|
152
|
+
disabled={true}
|
153
|
+
onChange={handleDropdownOptionsClick}
|
154
|
+
optionsList={options}
|
155
|
+
selectedOption={selectedOption}
|
156
|
+
showLabel={false}
|
157
|
+
showBorder={true}
|
158
|
+
/>
|
159
|
+
);
|
160
|
+
} else if (currentState === 'APPROVED') {
|
161
|
+
content = (
|
162
|
+
<Select
|
163
|
+
label={value}
|
164
|
+
disabled={true}
|
165
|
+
onChange={handleDropdownOptionsClick}
|
166
|
+
optionsList={options}
|
167
|
+
selectedOption={selectedOption}
|
168
|
+
showLabel={false}
|
169
|
+
showBorder={true}
|
170
|
+
/>
|
171
|
+
);
|
172
|
+
} else if (currentState === 'REJECTED' && userHasOnlyViewAccess) {
|
173
|
+
content = (
|
174
|
+
<Select
|
175
|
+
label={value}
|
176
|
+
disabled={true}
|
177
|
+
onChange={handleDropdownOptionsClick}
|
178
|
+
optionsList={options}
|
179
|
+
selectedOption={selectedOption}
|
180
|
+
showLabel={false}
|
181
|
+
showBorder={true}
|
182
|
+
/>
|
183
|
+
);
|
184
|
+
} else if (currentState === 'NEW' && userHasOnlyViewAccess) {
|
185
|
+
content = (
|
186
|
+
<Select
|
187
|
+
label={value}
|
188
|
+
disabled={true}
|
189
|
+
onChange={handleDropdownOptionsClick}
|
190
|
+
optionsList={options}
|
191
|
+
selectedOption={selectedOption}
|
192
|
+
showLabel={false}
|
193
|
+
showBorder={true}
|
194
|
+
/>
|
195
|
+
);
|
196
|
+
} else {
|
197
|
+
content = '';
|
198
|
+
}
|
199
|
+
|
200
|
+
return (
|
201
|
+
<div
|
202
|
+
onClick={() => {
|
203
|
+
if (
|
204
|
+
value.toLowerCase() === 'review' &&
|
205
|
+
!userHasOnlyViewAccess &&
|
206
|
+
!isApprovePage &&
|
207
|
+
!isReviewer
|
208
|
+
) {
|
209
|
+
handleStateValueClick();
|
210
|
+
}
|
211
|
+
}}
|
212
|
+
>
|
213
|
+
{content}
|
214
|
+
</div>
|
215
|
+
);
|
216
|
+
};
|
217
|
+
|
218
|
+
export default StateDropdown;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
export interface StateDropdownProps{
|
2
|
+
|
3
|
+
value:string;
|
4
|
+
|
5
|
+
nodeObj:{};
|
6
|
+
|
7
|
+
isReviewer:boolean;
|
8
|
+
|
9
|
+
isApprovePage:boolean;
|
10
|
+
|
11
|
+
handleDropdownOptionsClick:()=>void;
|
12
|
+
|
13
|
+
disabled:boolean;
|
14
|
+
|
15
|
+
isOnlyReviewer:boolean;
|
16
|
+
|
17
|
+
userHasOnlyViewAccess:boolean;
|
18
|
+
|
19
|
+
handleStateValueClick:()=>void;
|
20
|
+
}
|
21
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './StateDropdown';
|
@@ -0,0 +1,90 @@
|
|
1
|
+
@mixin status-colors($bg-color, $text-color) {
|
2
|
+
background-color: $bg-color;
|
3
|
+
color: $text-color;
|
4
|
+
}
|
5
|
+
|
6
|
+
.ff-status-button {
|
7
|
+
border: none;
|
8
|
+
border-radius: 4px;
|
9
|
+
padding: 0 4px;
|
10
|
+
cursor: pointer;
|
11
|
+
width: 76px;
|
12
|
+
height: 16px;
|
13
|
+
|
14
|
+
&__text {
|
15
|
+
color: inherit;
|
16
|
+
white-space: nowrap;
|
17
|
+
overflow: hidden;
|
18
|
+
text-overflow: ellipsis;
|
19
|
+
max-width: 76px;
|
20
|
+
text-transform: capitalize;
|
21
|
+
}
|
22
|
+
|
23
|
+
&--passed {
|
24
|
+
@include status-colors(
|
25
|
+
var(--status-button-bg-passed),
|
26
|
+
var(--status-button-text-passed)
|
27
|
+
);
|
28
|
+
}
|
29
|
+
|
30
|
+
&--failed {
|
31
|
+
@include status-colors(
|
32
|
+
var(--status-button-bg-failed),
|
33
|
+
var(--status-button-text-failed)
|
34
|
+
);
|
35
|
+
}
|
36
|
+
|
37
|
+
&--running {
|
38
|
+
@include status-colors(
|
39
|
+
var(--status-button-bg-running),
|
40
|
+
var(--status-button-text-running)
|
41
|
+
);
|
42
|
+
}
|
43
|
+
|
44
|
+
&--skipped {
|
45
|
+
@include status-colors(
|
46
|
+
var(--status-button-bg-skipped),
|
47
|
+
var(--status-button-text-skipped)
|
48
|
+
);
|
49
|
+
}
|
50
|
+
|
51
|
+
&--warning {
|
52
|
+
@include status-colors(
|
53
|
+
var(--status-button-bg-warning),
|
54
|
+
var(--status-button-text-warning)
|
55
|
+
);
|
56
|
+
}
|
57
|
+
|
58
|
+
&--terminated {
|
59
|
+
@include status-colors(
|
60
|
+
var(--status-button-bg-terminated),
|
61
|
+
var(--status-button-text-terminated)
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
65
|
+
&--partially-executed {
|
66
|
+
@include status-colors(
|
67
|
+
var(--status-button-bg-partiallyExecuted),
|
68
|
+
var(--status-button-text-partiallyExecuted)
|
69
|
+
);
|
70
|
+
}
|
71
|
+
|
72
|
+
&--aborted {
|
73
|
+
@include status-colors(
|
74
|
+
var(--status-button-bg-aborted),
|
75
|
+
var(--status-button-text-aborted)
|
76
|
+
);
|
77
|
+
}
|
78
|
+
|
79
|
+
&--not-executed {
|
80
|
+
@include status-colors(
|
81
|
+
var(--status-button-bg-notExecuted),
|
82
|
+
var(--status-button-text-notExecuted)
|
83
|
+
);
|
84
|
+
}
|
85
|
+
|
86
|
+
&:disabled {
|
87
|
+
opacity: 50%;
|
88
|
+
cursor: not-allowed;
|
89
|
+
}
|
90
|
+
}
|