You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/12/01 13:06:13 UTC
[GitHub] [superset] villebro opened a new pull request, #22302: feat(welcome): make examples tab customizable
villebro opened a new pull request, #22302:
URL: https://github.com/apache/superset/pull/22302
### SUMMARY
Currently the Welcome page features an "Examples" tab for Dashboards and Charts. While this is ok for test environments utilizing the examples datasets/charts/dashboards, this is of little utility in production environments. To make the Welcome page more useful in Production environments, this PR adds a simple configuration option `WELCOME_PAGE_LAST_TAB` to show "All" charts/dashboards that would be accessible via the list view, and also makes it possible to define a custom title and filters for more custom use cases.
We also introduce a simple React hook for retrieving bootstrap data to avoid duplicating the same logic all over the codebase. I will open a separate PR to refactor existing code to use this, ultimately aiming to make bootstrap data dynamic.
### AFTER
By changing `WELCOME_PAGE_LAST_TAB` to "all", the last tab displays all dashboards/charts that the users would see in their respective list views:

By creating the following custom tab config, the last tab only shows charts/dashboards created by user number 10:
```python
WELCOME_PAGE_LAST_TAB = ("Xyz", [{"col": 'created_by', "opr": 'rel_o_m', "value": 10}])
```

### BEFORE
Previously only examples were available in the dashboard and chart sections:
<img width="1068" alt="image" src="https://user-images.githubusercontent.com/33317356/205060211-283994a3-874a-4bd1-b394-4e64a8bea2a7.png">
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048794554
##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -185,13 +191,35 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
'welcome.main.replacement',
);
+ useEffect(() => {
+ const lastTab = bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB;
+ const [customTitle, customFilter] =
+ typeof lastTab === 'object' ? lastTab : [undefined, undefined];
+ if (customTitle && customFilter) {
+ setOtherTabTitle(t(customTitle));
+ setOtherTabFilters(customFilter);
+ } else if (lastTab === 'all') {
+ setOtherTabTitle(t('All'));
+ setOtherTabFilters([]);
+ } else {
+ setOtherTabTitle(t('Examples'));
+ setOtherTabFilters([
+ {
+ col: 'created_by',
+ opr: 'rel_o_m',
+ value: 0,
+ },
+ ]);
+ }
+ }, [bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB]);
+
useEffect(() => {
const activeTab = getItem(LocalStorageKeys.homepage_activity_filter, null);
setActiveState(collapseState.length > 0 ? collapseState : DEFAULT_TAB_ARR);
- getRecentAcitivtyObjs(user.userId!, recent, addDangerToast)
+ getRecentAcitivtyObjs(user.userId!, recent, addDangerToast, otherTabFilters)
.then(res => {
const data: ActivityData | null = {};
- data.Examples = res.examples;
+ data.Other = res.other;
Review Comment:
I know that you just followed an existing pattern, but is there any reason why we're using PascalCase for object property here?
##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -185,13 +191,35 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
'welcome.main.replacement',
);
+ useEffect(() => {
+ const lastTab = bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB;
+ const [customTitle, customFilter] =
+ typeof lastTab === 'object' ? lastTab : [undefined, undefined];
+ if (customTitle && customFilter) {
+ setOtherTabTitle(t(customTitle));
+ setOtherTabFilters(customFilter);
+ } else if (lastTab === 'all') {
+ setOtherTabTitle(t('All'));
+ setOtherTabFilters([]);
+ } else {
+ setOtherTabTitle(t('Examples'));
+ setOtherTabFilters([
+ {
+ col: 'created_by',
+ opr: 'rel_o_m',
+ value: 0,
+ },
+ ]);
+ }
+ }, [bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB]);
+
useEffect(() => {
const activeTab = getItem(LocalStorageKeys.homepage_activity_filter, null);
setActiveState(collapseState.length > 0 ? collapseState : DEFAULT_TAB_ARR);
- getRecentAcitivtyObjs(user.userId!, recent, addDangerToast)
+ getRecentAcitivtyObjs(user.userId!, recent, addDangerToast, otherTabFilters)
.then(res => {
const data: ActivityData | null = {};
- data.Examples = res.examples;
+ data.Other = res.other;
Review Comment:
I know that you just followed an existing pattern, but is there any reason why we're using PascalCase for object property here? Looks kinda weird
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049296172
##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -185,13 +191,35 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
'welcome.main.replacement',
);
+ useEffect(() => {
+ const lastTab = bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB;
+ const [customTitle, customFilter] =
+ typeof lastTab === 'object' ? lastTab : [undefined, undefined];
Review Comment:
Thanks for catching this. Not sure what I've been thinking here other than I must have been thinking about the individual filters rather than the array containing the filters π€¦
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1333751273
# [Codecov](https://codecov.io/gh/apache/superset/pull/22302?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#22302](https://codecov.io/gh/apache/superset/pull/22302?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9521de9) into [master](https://codecov.io/gh/apache/superset/commit/3ffe7828a75eeb16af88798ab6ae01bbb835d770?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3ffe782) will **decrease** coverage by `11.26%`.
> The diff coverage is `61.22%`.
> :exclamation: Current head 9521de9 differs from pull request most recent head 47c1f16. Consider uploading reports for the commit 47c1f16 to get more accurate results
```diff
@@ Coverage Diff @@
## master #22302 +/- ##
===========================================
- Coverage 66.79% 55.52% -11.27%
===========================================
Files 1846 1846
Lines 70286 70298 +12
Branches 7683 7688 +5
===========================================
- Hits 46948 39035 -7913
- Misses 21346 29269 +7923
- Partials 1992 1994 +2
```
| Flag | Coverage Ξ | |
|---|---|---|
| mysql | `?` | |
| postgres | `?` | |
| presto | `52.45% <100.00%> (+<0.01%)` | :arrow_up: |
| python | `57.43% <100.00%> (-23.67%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `50.86% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/22302?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Ξ | |
|---|---|---|
| [...Filters/FilterBar/FilterControls/FilterControl.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlckNvbnRyb2wudHN4) | `29.03% <ΓΈ> (ΓΈ)` | |
| [...Filters/FilterBar/FilterControls/FilterDivider.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlckRpdmlkZXIudHN4) | `84.00% <ΓΈ> (ΓΈ)` | |
| [...Filters/FilterBar/FiltersDropdownContent/index.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlcnNEcm9wZG93bkNvbnRlbnQvaW5kZXgudHN4) | `25.00% <ΓΈ> (ΓΈ)` | |
| [...s/FilterBar/FiltersOutOfScopeCollapsible/index.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlcnNPdXRPZlNjb3BlQ29sbGFwc2libGUvaW5kZXgudHN4) | `20.00% <0.00%> (ΓΈ)` | |
| [superset-frontend/src/preamble.ts](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ByZWFtYmxlLnRz) | `44.00% <ΓΈ> (ΓΈ)` | |
| [superset-frontend/src/views/CRUD/utils.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvdXRpbHMudHN4) | `66.66% <ΓΈ> (ΓΈ)` | |
| [superset/views/base.py](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvYmFzZS5weQ==) | `60.82% <ΓΈ> (-15.47%)` | :arrow_down: |
| [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | `74.28% <50.00%> (ΓΈ)` | |
| [...rontend/src/components/DropdownContainer/index.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRHJvcGRvd25Db250YWluZXIvaW5kZXgudHN4) | `74.62% <66.66%> (-3.95%)` | :arrow_down: |
| [...set-frontend/src/views/CRUD/welcome/ChartTable.tsx](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9DaGFydFRhYmxlLnRzeA==) | `62.00% <66.66%> (ΓΈ)` | |
| ... and [301 more](https://codecov.io/gh/apache/superset/pull/22302/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: Weβre building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048890808
##########
superset-frontend/src/utils/getBootstrapData.ts:
##########
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BootstrapData } from 'src/types/bootstrapTypes';
+
+export default function getBootstrapData(): BootstrapData {
+ const appContainer = document.getElementById('app');
+ const dataBootstrap = appContainer?.getAttribute('data-bootstrap') || '{}';
+
+ return JSON.parse(dataBootstrap);
Review Comment:
```suggestion
const dataBootstrap = appContainer?.getAttribute('data-bootstrap');
return dataBootstrap ? JSON.parse(dataBootstrap) : {};
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1334019209
This is a great tweak, and I appreciate all the cleanup work along the way. I also appreciate that the default config keeps the default functionality the same, so it's a seamless transition.
My only curiosity is if you think it's worth considering making ALL the tabs configurable... I can see just as many users not being concerned about "Favorites" or wanting to add a fourth tab fo their own (e.g. "My Team"). The config could be an array of tab definitions, perhaps... though on the other hand that might be pushing it in terms of complexity for a config option ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048796476
##########
superset/config.py:
##########
@@ -1420,6 +1421,17 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
"port": internet_port,
}
+# By default, the Welcome page features example charts and dashboards. This can be
+# changed to show all charts/dashboards the user has access to, or a custom view
+# by providing the title and a FAB filter:
+# WELCOME_PAGE_LAST_TAB = (
+# "Xyz",
+# [{"col": 'created_by', "opr": 'rel_o_m', "value": 10}],
+# )
+WELCOME_PAGE_LAST_TAB: Union[
+ Literal["examples", "all"], Tuple[str, List[Dict[str, Any]]]
Review Comment:
Should we use more strict typing for FAB filter?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1343427060
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049940155
##########
superset-frontend/src/utils/getBootstrapData.ts:
##########
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BootstrapData } from 'src/types/bootstrapTypes';
+
+export default function getBootstrapData(): BootstrapData {
Review Comment:
Yes - I'd love to see us get started on this stuff by making the theme object from bootstrap data dynamic so we can start working on a dark mode toggle π
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048785036
##########
superset-frontend/src/views/CRUD/welcome/ChartTable.tsx:
##########
@@ -177,13 +179,13 @@ function ChartTable({
},
},
];
- if (examples) {
+ if (otherTabData) {
menuTabs.push({
- name: 'Examples',
- label: t('Examples'),
+ name: 'Other',
Review Comment:
same for line 89 actually (`initialFilter === 'Mine'`) and other similar snippets
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1050478608
##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -185,13 +191,35 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
'welcome.main.replacement',
);
+ useEffect(() => {
+ const lastTab = bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB;
+ const [customTitle, customFilter] =
+ typeof lastTab === 'object' ? lastTab : [undefined, undefined];
+ if (customTitle && customFilter) {
+ setOtherTabTitle(t(customTitle));
+ setOtherTabFilters(customFilter);
+ } else if (lastTab === 'all') {
+ setOtherTabTitle(t('All'));
+ setOtherTabFilters([]);
+ } else {
+ setOtherTabTitle(t('Examples'));
+ setOtherTabFilters([
+ {
+ col: 'created_by',
+ opr: 'rel_o_m',
+ value: 0,
+ },
+ ]);
+ }
+ }, [bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB]);
+
useEffect(() => {
const activeTab = getItem(LocalStorageKeys.homepage_activity_filter, null);
setActiveState(collapseState.length > 0 ? collapseState : DEFAULT_TAB_ARR);
- getRecentAcitivtyObjs(user.userId!, recent, addDangerToast)
+ getRecentAcitivtyObjs(user.userId!, recent, addDangerToast, otherTabFilters)
.then(res => {
const data: ActivityData | null = {};
- data.Examples = res.examples;
+ data.Other = res.other;
Review Comment:
Good point, I'm changing it to camelCase
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1051875928
##########
superset/examples/birth_names.py:
##########
@@ -206,26 +193,16 @@ def create_slices(tbl: SqlaTable, admin_owner: bool) -> Tuple[List[Slice], List[
],
}
- admin = get_admin_user()
- if admin_owner:
- slice_props = dict(
- datasource_id=tbl.id,
- datasource_type=DatasourceType.TABLE,
- owners=[admin],
- created_by=admin,
- )
- else:
- slice_props = dict(
- datasource_id=tbl.id,
- datasource_type=DatasourceType.TABLE,
- owners=[],
- created_by=admin,
- )
+ slice_kwargs = {
+ "datasource_id": tbl.id,
+ "datasource_type": DatasourceType.TABLE,
+ "owners": [],
+ }
Review Comment:
Replace "props" with "kwargs" and `dict()` with `{}` to make this more pythonic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1341046134
@rusackas it turns out making ithis more generic would require a pretty substantial refactor, so I propose tackling that in a separate PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] jinghua-qa commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
jinghua-qa commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1359248598
> @jinghua-qa I've created an eph env http://54.245.133.177:8080/ where you can verify that the welcome page works as expected with the defaults (should display "Examples" charts/dashboards). Note the following:
>
> * I've created a chart and dashboard in the eph env to show that the "Mine" tab is working as expected. I've also favorited one own and one example chart/dashboard
> * Previous to this PR, the birth names dataset, charts and dashboards were displayed as being created by Admin user. That's now changed so that the birth names examples don't have a creator (same as the other examples).
Thank you Ville for the testing instruction!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048792328
##########
superset-frontend/src/views/CRUD/welcome/Welcome.tsx:
##########
@@ -185,13 +191,35 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
'welcome.main.replacement',
);
+ useEffect(() => {
+ const lastTab = bootstrapData.common?.conf.WELCOME_PAGE_LAST_TAB;
+ const [customTitle, customFilter] =
+ typeof lastTab === 'object' ? lastTab : [undefined, undefined];
Review Comment:
Should we rather check `Array.isArray(lastTab)`? I think we expect `lastTab` to be an array here and `typeof lastTab === 'object'` will return true for other values as well (for example `typeof null === 'object' ` returns true)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049043764
##########
superset-frontend/src/types/bootstrapTypes.ts:
##########
@@ -74,11 +83,78 @@ export type ChartResponse = {
result: ChartData[];
};
+export interface BrandProps {
+ path: string;
+ icon: string;
+ alt: string;
+ tooltip: string;
+ text: string;
+}
+
+export interface NavBarProps {
+ show_watermark: boolean;
+ bug_report_url?: string;
+ version_string?: string;
+ version_sha?: string;
+ build_number?: string;
+ documentation_url?: string;
+ languages: Languages;
+ show_language_picker: boolean;
+ user_is_anonymous: boolean;
+ user_info_url: string;
+ user_login_url: string;
+ user_logout_url: string;
+ user_profile_url: string | null;
+ locale: string;
+}
+
+export interface MenuObjectChildProps {
+ label: string;
+ name?: string;
+ icon?: string;
+ index?: number;
+ url?: string;
+ isFrontendRoute?: boolean;
+ perm?: string | boolean;
+ view?: string;
+ disable?: boolean;
+}
+
+export interface MenuObjectProps extends MenuObjectChildProps {
+ childs?: (MenuObjectChildProps | string)[];
+ isHeader?: boolean;
+}
+
+export interface MenuData {
+ menu: MenuObjectProps[];
+ brand: BrandProps;
+ navbar_right: NavBarProps;
+ settings: MenuObjectProps[];
+ environment_tag: {
+ text: string;
+ color: string;
+ };
+}
+
export interface CommonBootstrapData {
- flash_messages: string[][];
+ flash_messages: FlashMessage[];
conf: JsonObject;
locale: Locale;
- feature_flags: Record<string, boolean>;
+ feature_flags: FeatureFlagMap;
Review Comment:
Great work improving type safety!
##########
superset-frontend/src/views/CRUD/welcome/ChartTable.tsx:
##########
@@ -177,13 +179,13 @@ function ChartTable({
},
},
];
- if (examples) {
+ if (otherTabData) {
menuTabs.push({
- name: 'Examples',
- label: t('Examples'),
+ name: 'Other',
Review Comment:
+1
##########
superset-frontend/src/utils/getBootstrapData.ts:
##########
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BootstrapData } from 'src/types/bootstrapTypes';
+
+export default function getBootstrapData(): BootstrapData {
Review Comment:
I'm really anxious for the SPA work to be completed so we can only load this data once, store it in Redux and offer a selector for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049938716
##########
superset-frontend/src/dashboard/util/findTabIndexByComponentId.test.js:
##########
@@ -4,7 +4,7 @@
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
- * 'License'); you may not use this file except in compliance
+ * "License"); you may not use this file except in compliance
Review Comment:
Bycatch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1334041584
> This is a great tweak, and I appreciate all the cleanup work along the way. I also appreciate that the default config keeps the default functionality the same, so it's a seamless transition.
>
> My only curiosity is if you think it's worth considering making ALL the tabs configurable... I can see just as many users not being concerned about "Favorites" or wanting to add a fourth tab fo their own (e.g. "My Team"). The config could be an array of tab definitions, perhaps... though on the other hand that might be pushing it in terms of complexity for a config option ;)
That's a REALLY good idea. Let me see if this could be done easily.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1355082346
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1356741044
@villebro Ephemeral environment spinning up at http://35.87.47.150:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1356740432
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1343431487
@rusackas Ephemeral environment spinning up at http://54.203.164.117:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1352656134
Thanks for the valuable reviews @kgabryje and @michael-s-molina ! β€οΈ I'll address the comments shortly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1051876648
##########
superset-frontend/src/views/CRUD/utils.test.tsx:
##########
@@ -228,3 +232,165 @@ test('checkUploadExtensions should return valid upload extensions', () => {
checkUploadExtensions(randomExtensionThree, uploadExtensionTest),
).toBeFalsy();
});
+
+test('getFilterValues', () => {
Review Comment:
While testing I found a bug in my refactored filter logic, so I added tests to make sure this util works as expected in all relevant cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1355485617
@villebro Ephemeral environment spinning up at http://52.36.216.8:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1357170612
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro merged pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro merged PR #22302:
URL: https://github.com/apache/superset/pull/22302
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1355475296
/testenv up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049949972
##########
superset/config.py:
##########
@@ -1420,6 +1421,17 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
"port": internet_port,
}
+# By default, the Welcome page features example charts and dashboards. This can be
+# changed to show all charts/dashboards the user has access to, or a custom view
+# by providing the title and a FAB filter:
+# WELCOME_PAGE_LAST_TAB = (
+# "Xyz",
+# [{"col": 'created_by', "opr": 'rel_o_m', "value": 10}],
+# )
+WELCOME_PAGE_LAST_TAB: Union[
+ Literal["examples", "all"], Tuple[str, List[Dict[str, Any]]]
Review Comment:
Good thinking! I actually already tried it, but I wasn't able to find a type for the Filter in the current FAB codebase (typing work is still ongoing). Once the type is added upstream I'll try to update these `Dict[str, Any]` to proper `TypedDict`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049044173
##########
superset-frontend/src/views/CRUD/welcome/ChartTable.tsx:
##########
@@ -177,13 +179,13 @@ function ChartTable({
},
},
];
- if (examples) {
+ if (otherTabData) {
menuTabs.push({
- name: 'Examples',
- label: t('Examples'),
+ name: 'Other',
Review Comment:
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048785036
##########
superset-frontend/src/views/CRUD/welcome/ChartTable.tsx:
##########
@@ -177,13 +179,13 @@ function ChartTable({
},
},
];
- if (examples) {
+ if (otherTabData) {
menuTabs.push({
- name: 'Examples',
- label: t('Examples'),
+ name: 'Other',
Review Comment:
same for line 89 actually (`initialFilter === 'Mine'`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] kgabryje commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
kgabryje commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1048784540
##########
superset-frontend/src/views/CRUD/welcome/ChartTable.tsx:
##########
@@ -177,13 +179,13 @@ function ChartTable({
},
},
];
- if (examples) {
+ if (otherTabData) {
menuTabs.push({
- name: 'Examples',
- label: t('Examples'),
+ name: 'Other',
Review Comment:
nit: shouldn't we use an enum here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1357173111
@villebro Ephemeral environment spinning up at http://54.245.133.177:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1049941568
##########
superset-frontend/src/views/CRUD/utils.tsx:
##########
@@ -442,3 +438,64 @@ export const uploadUserPerms = (
canUploadData: canUploadCSV || canUploadColumnar || canUploadExcel,
};
};
+
+export function getFilterValues(
+ tab: TableTab,
+ welcomeTable: WelcomeTable,
+ user?: User,
+ otherTabFilters?: Filter[],
+): FilterValue[] {
Review Comment:
this util is a bit of a monster, but it's a compilation of the filter logic that was scattered around the subcomponents of the Welcome component.
##########
superset-frontend/src/views/CRUD/utils.tsx:
##########
@@ -442,3 +438,64 @@ export const uploadUserPerms = (
canUploadData: canUploadCSV || canUploadColumnar || canUploadExcel,
};
};
+
+export function getFilterValues(
+ tab: TableTab,
+ welcomeTable: WelcomeTable,
+ user?: User,
+ otherTabFilters?: Filter[],
+): FilterValue[] {
Review Comment:
this util is a bit of a monster, but it's a compilation of the filter logic that was scattered throughout the subcomponents of the Welcome component.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1355092965
@villebro Ephemeral environment spinning up at http://52.33.10.25:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a diff in pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22302:
URL: https://github.com/apache/superset/pull/22302#discussion_r1050100586
##########
superset-frontend/src/views/CRUD/utils.tsx:
##########
@@ -442,3 +438,64 @@ export const uploadUserPerms = (
canUploadData: canUploadCSV || canUploadColumnar || canUploadExcel,
};
};
+
+export function getFilterValues(
+ tab: TableTab,
+ welcomeTable: WelcomeTable,
+ user?: User,
+ otherTabFilters?: Filter[],
+): FilterValue[] {
Review Comment:
Thanks for centralizing the logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] villebro commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
villebro commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1357200759
@jinghua-qa I've created an eph env http://54.245.133.177:8080/ where you can verify that the welcome page works as expected with the defaults (should display "Examples" charts/dashboards). Note the following:
- I've created a chart and dashboard in the eph env to show that the "Mine" tab is working as expected. I've also favorited one own and one example chart/dashboard
- Previous to this PR, the birth names dataset, charts and dashboards were displayed as being created by Admin user. That's now changed so that the birth names examples don't have a creator (same as the other examples).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1360951080
Ephemeral environment shutdown and build artifacts deleted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #22302: feat(welcome): make examples tab customizable
Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #22302:
URL: https://github.com/apache/superset/pull/22302#issuecomment-1343430444
cc @eric-briscoe for a potential reviewer as well
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org