Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UISACQCOMP-215: ECS - Add isLoading prop for holdings #809

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions lib/ConsortiumFieldInventory/ConsortiumFieldInventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ ConsortiumFieldInventory.propTypes = {
filterLocations: PropTypes.func,
holdingName: PropTypes.string.isRequired,
isNonInteractive: PropTypes.bool,
isLoading: PropTypes.bool,
labelless: PropTypes.bool,
locationName: PropTypes.string.isRequired,
locations: PropTypes.arrayOf(PropTypes.shape({
Expand Down
6 changes: 4 additions & 2 deletions lib/FieldHolding/FieldHolding.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
name,
onChange,
isDisabled = false,
isLoading = false,
isNonInteractive = false,
required = false,
tenantId,
}) => {
const {
isLoading,
isLoading: isHoldingsLoading,
holdings,
} = useInstanceHoldings(instanceId, { tenantId });

Expand All @@ -64,7 +65,7 @@

setSelectedLocation(location);
}
}, []);

Check warning on line 68 in lib/FieldHolding/FieldHolding.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

React Hook useEffect has missing dependencies: 'initialHoldingId', 'locationFieldName', 'locationsMap', and 'values'. Either include them or remove the dependency array

Check warning on line 68 in lib/FieldHolding/FieldHolding.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

React Hook useEffect has missing dependencies: 'initialHoldingId', 'locationFieldName', 'locationsMap', and 'values'. Either include them or remove the dependency array

useEffect(() => {
const isInitialAffiliation = tenantId === initialTenantId;
Expand Down Expand Up @@ -120,7 +121,7 @@

const isLookupTriggerVisible = !(isDisabled || isNonInteractive);

if (isLoading) return <Loading />;
if (isLoading || isHoldingsLoading) return <Loading />;

return (
selectedLocation
Expand Down Expand Up @@ -172,6 +173,7 @@
filterLocations: PropTypes.func,
instanceId: PropTypes.string.isRequired,
isDisabled: PropTypes.bool,
isLoading: PropTypes.bool,
isNonInteractive: PropTypes.bool,
labelId: PropTypes.string,
locationFieldName: PropTypes.string.isRequired,
Expand Down
3 changes: 3 additions & 0 deletions lib/FieldInventory/FieldInventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const FieldInventory = ({
filterHoldings,
filterLocations,
instanceId,
isLoading = false,
isNonInteractive,
locations,
locationIds,
Expand All @@ -35,6 +36,7 @@ export const FieldInventory = ({
locationLabelId={locationLabelId}
name={holdingName}
isDisabled={disabled}
isLoading={isLoading}
isNonInteractive={isNonInteractive}
onChange={onChange}
required={required}
Expand Down Expand Up @@ -77,6 +79,7 @@ FieldInventory.propTypes = {

filterHoldings: PropTypes.func,
filterLocations: PropTypes.func,
isLoading: PropTypes.bool,
isNonInteractive: PropTypes.bool,
onChange: PropTypes.func.isRequired,
required: PropTypes.bool,
Expand Down
Loading