Skip to content

Conversation

deeonwuli
Copy link
Contributor

📌 References

📝 Implementation

  • Add support for periods config in "grid-with-cat-option-combos" view type
"viewType": "grid-with-cat-option-combos",
"periods": {
  "endOffset": -1,
  "startOffset": -1,
  "type": "relative-interval"
}

Single and multiple periods are supported.

🎨 Screenshots

Screen.Recording.2025-09-22.at.16.35.06.mov

🔥 Notes to the tester

#869ahn9en

Copy link
Contributor

@eperedo eperedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @deeonwuli, just minor things about fetching dataValues for all the periods and the new lockException prop for inputs

Also can you share an example to test this on dev, please? I could not found any config. in the dataStore for this dataSet. Thanks!

columnDataElements?: DataElement[];
cocId: string;
rows?: Row[];
lockException?: boolean; // If true, the input will not be disabled if expired
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm missing something but if the period is expired and we force an input to be enabled user can't enter data due to an exception from the API, right?

Not wrong, just to be sure I understand how this works.

export interface SectionWithPeriods extends SectionBase {
viewType: "grid-with-periods";
viewType: "grid-with-periods" | "grid-with-cat-option-combos";
periods: string[];
Copy link
Contributor

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:

static getReferencedPeriods(dataForm: DataForm, basePeriod: Period): Period[] {
        return _(dataForm.sections)
            .flatMap(section => {
                switch (section.viewType) {
                    case "grid-with-periods":
                        return section.periods;
                    case "grid-indicators-calculated":
                        return section.periods;
                    default:
                        return [];
                }
            })
            .uniq()
            .concat([basePeriod])
            .sortBy()
            .value();
    }

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants