-
Notifications
You must be signed in to change notification settings - Fork 1
[feature]: Define periods for cat-option-combo sections #88
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
Changes from 3 commits
007156e
e5473f9
eba4168
79417bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,14 +31,17 @@ export interface DataEntryItemProps { | |
columnDataElements?: DataElement[]; | ||
cocId: string; | ||
rows?: Row[]; | ||
lockException?: boolean; // If true, the input will not be disabled if expired | ||
|
||
} | ||
|
||
function isInputExpired( | ||
period: string | undefined, | ||
dataFormPeriod: string, | ||
dataInputPeriods: dataInputPeriodsType, | ||
expiryDays: number | ||
expiryDays: number, | ||
lockException: boolean | ||
) { | ||
if (lockException) return false; | ||
const periodToCheck = period ?? dataFormPeriod; | ||
|
||
const dataInputPeriod = dataInputPeriods?.find(p => p.period.id === periodToCheck); | ||
|
@@ -234,7 +237,7 @@ export function checkDisabledRule(options: UseApplyRulesProps): boolean { | |
} | ||
|
||
const DataEntryItem: React.FC<DataEntryItemProps> = props => { | ||
const { dataElement, dataFormInfo, manualyDisabled: handDisabled, rows } = props; | ||
const { dataElement, dataFormInfo, manualyDisabled: handDisabled, rows, lockException } = props; | ||
const [dataValue, state, notifyChange] = useUpdatableDataValueWithFeedback(props); | ||
|
||
const { type } = dataValue; | ||
|
@@ -244,7 +247,8 @@ const DataEntryItem: React.FC<DataEntryItemProps> = props => { | |
props.period, | ||
dataFormInfo.period, | ||
dataFormInfo.metadata.dataForm.dataInputPeriods, | ||
dataFormInfo.metadata.dataForm.expiryDays | ||
dataFormInfo.metadata.dataForm.expiryDays, | ||
lockException ?? false | ||
) | ||
: handDisabled; | ||
const config = dataFormInfo.metadata.dataForm.options.dataElements[dataElement.id]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a
getReferencedPeriods
method in this class:This is being used to fetch dataValues including all the periods, can we check if we need to include the
"grid-with-cat-option-combos"
, here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we would need to add
"grid-with-cat-option-combos"
here 👍