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

Add Global mode to CategoryWidget & PieWidget #370

Conversation

Clebal
Copy link
Contributor

@Clebal Clebal commented Apr 7, 2022

No description provided.

@Clebal Clebal requested a review from VictorVelarde April 7, 2022 07:12
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #219449: CategoryWidget & PieWidget - global (remote) mode.

@Clebal Clebal requested review from Josmorsot and bbecquet April 7, 2022 07:13
Copy link
Contributor

@bbecquet bbecquet left a comment

Choose a reason for hiding this comment

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

LGTM

: formatOperationColumn(operationColumn || column, joinOperation)
}) as value`;

return `SELECT COALESCE(${column}, 'null') as name, ${selectValueClause} FROM ${formatTableNameWithFilters(
Copy link
Contributor

@Josmorsot Josmorsot Apr 18, 2022

Choose a reason for hiding this comment

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

Just to confirm, what databases should support this feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any of them. Do you know any incompatibility here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nop, but it would be nice to involve Data team in these queries verification. Can you gather them (not just this one) and pass them to @Jesus89 please?

Copy link
Contributor

@Josmorsot Josmorsot left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -10,7 +10,7 @@ export default function useWidgetFetch(
{ id, dataSource, params, global, onError }
) {
// State
const [data, setData] = useState(null);
const [data, setData] = useState();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change here Sergio?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/CartoDB/carto-react/pull/370/files#diff-b6744b2ddd16d9987012b38f43d5800cd351e453fd471af46f6dbb649801e738R59

As you can see in that line, we define a default value. A default value can only be assigned in destructuring when it's undefined, not null.

Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

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

LGTM, just add changelog entry please

Let's coordinate to see how we can merge (& test) a group of several widgets together. Most probably: Formula, Category and Histogram first

@VictorVelarde VictorVelarde changed the title CategoryWidget & PieWidget - Global mode Add Global mode to CategoryWidget & PieWidget Apr 18, 2022
@VictorVelarde VictorVelarde self-requested a review April 18, 2022 14:36
Sergio Clebal added 4 commits April 19, 2022 10:11
… of github.com:CartoDB/carto-react into feature/sc-219449/categorywidget-piewidget-global-remote-mode
… of github.com:CartoDB/carto-react into feature/sc-219449/categorywidget-piewidget-global-remote-mode
@Clebal Clebal merged commit 4a6fbdb into feature/sc-219448/formulawidget-remote-mode-for-global Apr 19, 2022
@Clebal Clebal deleted the feature/sc-219449/categorywidget-piewidget-global-remote-mode branch April 19, 2022 08:21
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.

4 participants