Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ export const InfoIcon = (props) => {
};

/* Edit Permission Module Infinite Scroll */
export const CustomInfinteScroll = (props) => {
export const CustomInfiniteScroll = (props) => {
const { data, removeUsrGrp, scrollableDiv } = props;
const [count, setCount] = useState({
startIndex: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { toast } from "react-toastify";
import { cloneDeep, find, findIndex, isEmpty, map, reverse } from "lodash";
import { AccessResult } from "Utils/XAEnums";
import {
CustomInfinteScroll,
CustomInfiniteScroll,
commonBreadcrumb,
serverError
} from "Utils/XAUtils";
Expand Down Expand Up @@ -414,6 +414,7 @@ const EditPermission = () => {
placeholder="Select Groups"
isMulti
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
<Button
size="sm"
Expand Down Expand Up @@ -461,6 +462,7 @@ const EditPermission = () => {
placeholder="Select Users"
isMulti
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>

<Button
Expand Down Expand Up @@ -502,7 +504,7 @@ const EditPermission = () => {
></Spinner>
</div>
) : (
<CustomInfinteScroll
<CustomInfiniteScroll
data={selectedGrp}
removeUsrGrp={handleRemoveGrp}
scrollableDiv="scrollableGrpDiv"
Expand All @@ -528,7 +530,7 @@ const EditPermission = () => {
></Spinner>
</div>
) : (
<CustomInfinteScroll
<CustomInfiniteScroll
data={selectedUsr}
removeUsrGrp={handleRemoveUsr}
scrollableDiv="scrollableUsrDiv"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,25 @@ export default function AddUpdatePolicyForm() {
}}
defaultOptions={defaultPolicyLabelOptions}
styles={selectInputCustomStyles}
// Add this prop to trim the visual "Create" label
formatCreateLabel={(inputValue) =>
`Create "${inputValue.trim()}"`
}
// Add this prop to trim the value when a tag is created
onCreateOption={(inputValue) => {
const policyLabelVal = inputValue.trim();
if (policyLabelVal) {
input.onChange([
...input.value,
{
label: policyLabelVal,
value: policyLabelVal
}
]);
}
}}
tabSelectsValue={false}
placeholder="Add Policy Labels"
/>
</Col>
</FormB.Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ export default function PolicyPermissionItem(props) {
styles={customStyles}
cacheOptions
isMulti
tabSelectsValue={false}
placeholder="Select Roles"
/>
</div>
)}
Expand Down Expand Up @@ -402,6 +404,8 @@ export default function PolicyPermissionItem(props) {
styles={customStyles}
cacheOptions
isMulti
tabSelectsValue={false}
placeholder="Select Groups"
/>
</div>
)}
Expand Down Expand Up @@ -433,6 +437,8 @@ export default function PolicyPermissionItem(props) {
styles={customStyles}
cacheOptions
isMulti
tabSelectsValue={false}
placeholder="Select Users"
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export default function TagBasePermissionItem(props) {
isClearable={false}
isSearchable={true}
placeholder="Select Service Name"
tabSelectsValue={false}
/>
</FormB.Group>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ function UserAccessLayout() {
]}
menuPlacement="auto"
placeholder="Select Policy Type"
tabSelectsValue={false}
/>
)}
</Field>
Expand All @@ -558,6 +559,7 @@ function UserAccessLayout() {
menuPlacement="auto"
placeholder="Select Component Type"
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
)}
</Field>
Expand Down Expand Up @@ -596,6 +598,7 @@ function UserAccessLayout() {
loadOptions={fetchPolicyLabels}
placeholder="Select Policy Label"
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
)}
</Field>
Expand All @@ -617,6 +620,7 @@ function UserAccessLayout() {
menuPlacement="auto"
placeholder="Select Zone Name"
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
)}
</Field>
Expand Down Expand Up @@ -654,6 +658,7 @@ function UserAccessLayout() {
onChange={(e) =>
onChangeSearchBy(e, input, values)
}
tabSelectsValue={false}
/>
)}
</Field>
Expand Down Expand Up @@ -814,6 +819,7 @@ function SearchByAsyncSelect(props) {
DropdownIndicator: () => null,
IndicatorSeparator: () => null
}}
tabSelectsValue={false}
/>
)}
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export default function ResourceComp(props) {
}
isSearchable={false}
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
</span>
<RenderValidateField name={`resourceName-${levelKey}`} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ export default function ResourceSelectComp(props) {
filterOption={customFilterOptions}
isLoading={isLoading}
styles={selectInputCustomStyles}
formatCreateLabel={(inputValue) => `Create "${inputValue.trim()}"`}
onCreateOption={(inputValue) => {
const trimmedValue = inputValue.trim();
if (trimmedValue) {
const newOption = { label: trimmedValue, value: trimmedValue };
const currentValue = input.value || [];
const newValue = isArray(currentValue)
? [...currentValue, newOption]
: [newOption];
input.onChange(newValue);
}
}}
tabSelectsValue={false}
placeholder="Add policy Resources"
/>
{formValues &&
formValues[`resourceName-${levelKey}`]?.mandatory &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Users"
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down Expand Up @@ -918,6 +919,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Groups"
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down Expand Up @@ -962,6 +964,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Roles"
tabSelectsValue={false}
/>
{meta.touched && meta.error && (
<span className="invalid-field">
Expand Down Expand Up @@ -1011,6 +1014,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Users"
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down Expand Up @@ -1055,6 +1059,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Groups"
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down Expand Up @@ -1099,6 +1104,7 @@ const SecurityZoneForm = () => {
}}
isClearable={true}
placeholder="Select Roles"
tabSelectsValue={false}
/>
{meta.error && meta.touched && (
<span className="invalid-field">
Expand Down Expand Up @@ -1140,6 +1146,7 @@ const SecurityZoneForm = () => {
isClearable={true}
placeholder="Select Tag Services"
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down Expand Up @@ -1177,6 +1184,7 @@ const SecurityZoneForm = () => {
isSearchable={true}
placeholder="Select Resource Services"
styles={selectInputCustomStyles}
tabSelectsValue={false}
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export default function ServiceAuditFilter(props) {
isMulti
styles={selectInputCustomStyles}
placeholder="Select Roles"
tabSelectsValue={false}
/>
</div>
)}
Expand Down Expand Up @@ -469,6 +470,7 @@ export default function ServiceAuditFilter(props) {
isMulti
styles={selectInputCustomStyles}
placeholder="Select Groups"
tabSelectsValue={false}
/>
</div>
)}
Expand Down Expand Up @@ -509,6 +511,7 @@ export default function ServiceAuditFilter(props) {
isMulti
styles={selectInputCustomStyles}
placeholder="Select Users"
tabSelectsValue={false}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ class ServiceDefinitions extends Component {
})}
menuPlacement="auto"
placeholder="Select Zone Name"
tabSelectsValue={false}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -984,16 +984,12 @@ class ServiceForm extends Component {
undefined
);

SelectField = ({ input, ...rest }) => (
<Select {...input} {...rest} searchable />
);

AsyncSelectField = ({ input, ...rest }) => (
<AsyncSelect {...input} {...rest} cacheOptions />
<AsyncSelect {...input} {...rest} cacheOptions tabSelectsValue={false} />
);

AsyncCreatableSelectField = ({ input, ...rest }) => (
<AsyncCreatableSelect {...input} {...rest} />
<AsyncCreatableSelect {...input} {...rest} tabSelectsValue={false} />
);

fetchUsers = async (inputValue) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export const TopNavBar = (props) => {
menuPlacement="auto"
placeholder="Select Service Name"
hideSelectedOptions
tabSelectsValue={false}
/>
{!isKMSRole && (
<React.Fragment>
Expand All @@ -223,6 +224,7 @@ export const TopNavBar = (props) => {
placeholder="Select Zone Name"
isClearable
hideSelectedOptions
tabSelectsValue={false}
/>
</React.Fragment>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,8 @@ function RoleForm() {
data-name="usersSelect"
data-cy="usersSelect"
styles={selectInputCustomStyles}
tabSelectsValue={false}
placeholder="Select Users"
/>
</div>
<div className="col-sm-3">
Expand Down Expand Up @@ -741,6 +743,8 @@ function RoleForm() {
data-name="groupsSelect"
data-cy="groupsSelect"
styles={selectInputCustomStyles}
tabSelectsValue={false}
placeholder="Select Groups"
/>
</div>
<div className="col-sm-3">
Expand Down Expand Up @@ -848,6 +852,8 @@ function RoleForm() {
data-name="rolesSelect"
data-cy="rolesSelect"
styles={selectInputCustomStyles}
tabSelectsValue={false}
placeholder="Select Roles"
/>
</div>
<div className="col-sm-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ function UserForm(props) {
isEditView && userInfo && isExternalOrFederatedUser ? true : false
}
styles={selectInputCustomStyles}
tabSelectsValue={false}
placeholder="Select Groups"
/>
);
};
Expand Down Expand Up @@ -710,6 +712,7 @@ function UserForm(props) {
options={userRoleListData()}
onChange={(e) => getUserRole(e, input)}
isDisabled={disabledUserRoleField()}
tabSelectsValue={false}
></Select>
)}
></Field>
Expand Down
Loading