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

fix: [DHIS2-16317] Incorrect error message on orgUnit type data element #3484

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -13,7 +13,7 @@ const getStyles = () => ({

type OrgUnitValue = {
id: string,
displayName: string,
name: string,
path: string,
}

Expand Down Expand Up @@ -44,15 +44,15 @@ class SingleOrgUnitSelectFieldPlain extends React.Component<Props, State> {
const { classes } = this.props;
return (
<div className={classes.selectedOrgUnitContainer}>
<Chip onRemove={this.onDeselectOrgUnit}>{selectedOrgUnit.displayName}</Chip>
<Chip onRemove={this.onDeselectOrgUnit}>{selectedOrgUnit.name}</Chip>
</div>
);
}

onSelectOrgUnit = (orgUnit: Object) => {
this.props.onBlur({
id: orgUnit.id,
displayName: orgUnit.displayName,
name: orgUnit.displayName,
path: orgUnit.path,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '../../../NewRelationship/TeiRelationship/SearchResults/TeiRelationshipSearchResults.component';
import { ResultsPageSizeContext } from '../../../shared-contexts';
import { RegisterTei } from '../RegisterTei';
import { useOrganisationUnit } from '../../../../../dataQueries';
import { useCoreOrgUnit } from '../../../../../metadataRetrieval/coreOrgUnit';

export const TrackedEntityRelationshipsWrapper = ({
trackedEntityTypeId,
Expand All @@ -29,7 +29,7 @@ export const TrackedEntityRelationshipsWrapper = ({
}: Props) => {
const dispatch = useDispatch();
const { relationshipTypes, isError } = useTEIRelationshipsWidgetMetadata();
const { orgUnit: initialOrgUnit } = useOrganisationUnit(orgUnitId, 'id,displayName,code');
const { orgUnit: initialOrgUnit } = useCoreOrgUnit(orgUnitId);

const onSelectFindMode = ({ findMode, relationshipConstraint }: OnSelectFindModeProps) => {
dispatch(selectFindMode({
Expand Down
Loading