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

Fixing issue #237 #238

Merged
merged 6 commits into from
Aug 31, 2023
Merged

Fixing issue #237 #238

merged 6 commits into from
Aug 31, 2023

Conversation

BSd3v
Copy link
Collaborator

@BSd3v BSd3v commented Aug 31, 2023

where grid components werent passed down to detail grids

@BSd3v BSd3v linked an issue Aug 31, 2023 that may be closed by this pull request
@BSd3v BSd3v requested a review from alexcjohnson August 31, 2023 15:12
@@ -413,6 +413,9 @@ export default class DashAgGrid extends Component {
? this.suppressGetDetail(value.detailColName)
: this.callbackGetDetail;
}
if ('detailGridOptions' in value) {
value.detailGridOptions.components = this.state.components;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't be mutating value (here or in the block above value.getDetailRowData = ..., sorry I hadn't noticed this before) - so we should do something like:

let adjustedVal = value;
if ('suppressCallback' in value) {
    adjustedVal = {
        ...adjustedval,
        getDetailRowData: value.suppressCallback
                        ? this.suppressGetDetail(value.detailColName)
                        : this.callbackGetDetail
    };
}
if ('detailGridOptions' in value) {
    adjustedVal = {
        ...adjustedVal,
        detailGridOptions: {
            ...value.detailGridOptions,
            components: this.state.components
        }
    };
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can also do this with https://ramdajs.com/docs/#assoc and assocPath if you prefer, might be more compact.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

💃

@BSd3v BSd3v merged commit ef06128 into plotly:dev Aug 31, 2023
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.

[Bug] Components not working in the Detail Grid
2 participants