You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "hughhhh (via GitHub)" <gi...@apache.org> on 2023/09/30 22:58:25 UTC
[GitHub] [superset] hughhhh opened a new pull request, #25473: fix(tags: Update loading + pagination for Tags Page
hughhhh opened a new pull request, #25473:
URL: https://github.com/apache/superset/pull/25473
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### 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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1342993815
##########
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx:
##########
@@ -72,48 +73,46 @@ interface TaggedObjects {
interface AllEntitiesTableProps {
search?: string;
setShowTagModal: (show: boolean) => void;
+ objects: TaggedObjects[];
}
export default function AllEntitiesTable({
search = '',
setShowTagModal,
+ objects,
}: AllEntitiesTableProps) {
type objectType = 'dashboard' | 'chart' | 'query';
- const [objects, setObjects] = useState<TaggedObjects>({
- dashboard: [],
- chart: [],
- query: [],
- });
- const [isLoading, setLoading] = useState<boolean>(true);
+ const [isLoading, setLoading] = useState<boolean>(false);
const showListViewObjs =
objects.dashboard.length > 0 ||
objects.chart.length > 0 ||
objects.query.length > 0;
useEffect(() => {
+ console.log(search);
Review Comment:
```suggestion
```
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "hughhhh (via GitHub)" <gi...@apache.org>.
hughhhh commented on PR #25473:
URL: https://github.com/apache/superset/pull/25473#issuecomment-1749273505
@yousoph @kasiazjc can you take a look at the page at 5 vs. 10 in our shortcut ticket and let me know what you think
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "hughhhh (via GitHub)" <gi...@apache.org>.
hughhhh merged PR #25473:
URL: https://github.com/apache/superset/pull/25473
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1342994166
##########
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx:
##########
@@ -72,48 +73,46 @@ interface TaggedObjects {
interface AllEntitiesTableProps {
search?: string;
setShowTagModal: (show: boolean) => void;
+ objects: TaggedObjects[];
}
export default function AllEntitiesTable({
search = '',
setShowTagModal,
+ objects,
}: AllEntitiesTableProps) {
type objectType = 'dashboard' | 'chart' | 'query';
- const [objects, setObjects] = useState<TaggedObjects>({
- dashboard: [],
- chart: [],
- query: [],
- });
- const [isLoading, setLoading] = useState<boolean>(true);
+ const [isLoading, setLoading] = useState<boolean>(false);
const showListViewObjs =
objects.dashboard.length > 0 ||
objects.chart.length > 0 ||
objects.query.length > 0;
useEffect(() => {
+ console.log(search);
if (search === '') {
return;
}
- setLoading(true);
+ // setLoading(true);
- fetchObjects(
- { tags: search, types: null },
- (data: TaggedObject[]) => {
- const objects = { dashboard: [], chart: [], query: [] };
- data.forEach(function (object) {
- const object_type = object.type;
- objects[object_type].push(object);
- });
- setObjects(objects);
- setLoading(false);
- },
- (error: Response) => {
- addDangerToast('Error Fetching Tagged Objects');
- logging.log(error.text);
- },
- );
+ // fetchObjects(
+ // { tags: search, types: null },
+ // (data: TaggedObject[]) => {
+ // const objects = { dashboard: [], chart: [], query: [] };
+ // data.forEach(function (object) {
+ // const object_type = object.type;
+ // objects[object_type].push(object);
+ // });
+ // setObjects(objects);
+ // setLoading(false);
+ // },
+ // (error: Response) => {
+ // addDangerToast('Error Fetching Tagged Objects');
+ // logging.log(error.text);
+ // },
+ // );
Review Comment:
was this intentional?
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1346368159
##########
superset-frontend/src/pages/AllEntities/index.tsx:
##########
@@ -114,13 +135,34 @@ function AllEntities() {
};
const items = [description, owner, lastModified];
+ const fetchTaggedObjects = () => {
+ setLoading(true);
+ fetchObjects(
+ { tags: tag?.name || '', types: null },
+ (data: TaggedObject[]) => {
+ const objects = { dashboard: [], chart: [], query: [] };
+ data.forEach(function (object) {
+ const object_type = object.type;
+ objects[object_type].push(object);
+ });
+ setObjects(objects);
+ setLoading(false);
+ },
+ (error: Response) => {
+ addDangerToast('Error Fetching Tagged Objects');
+ },
+ );
+ };
+
useEffect(() => {
// fetch single tag met
if (tagId) {
+ setLoading(true);
fetchSingleTag(
tagId,
(tag: Tag) => {
setTag(tag);
+ setLoading(false);
},
(error: Response) => {
addDangerToast(t('Error Fetching Tagged Objects'));
Review Comment:
you might need to add `setLoading(false);` here to prevent the spinner kept spinning
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1346368728
##########
superset-frontend/src/pages/AllEntities/index.tsx:
##########
@@ -114,13 +135,34 @@ function AllEntities() {
};
const items = [description, owner, lastModified];
+ const fetchTaggedObjects = () => {
+ setLoading(true);
+ fetchObjects(
+ { tags: tag?.name || '', types: null },
+ (data: TaggedObject[]) => {
+ const objects = { dashboard: [], chart: [], query: [] };
+ data.forEach(function (object) {
+ const object_type = object.type;
+ objects[object_type].push(object);
+ });
+ setObjects(objects);
+ setLoading(false);
+ },
+ (error: Response) => {
+ addDangerToast('Error Fetching Tagged Objects');
Review Comment:
you might need to add `setLoading(false);` here to prevent the spinner kept spinning
##########
superset-frontend/src/pages/AllEntities/index.tsx:
##########
@@ -114,13 +135,34 @@ function AllEntities() {
};
const items = [description, owner, lastModified];
+ const fetchTaggedObjects = () => {
+ setLoading(true);
+ fetchObjects(
+ { tags: tag?.name || '', types: null },
+ (data: TaggedObject[]) => {
+ const objects = { dashboard: [], chart: [], query: [] };
+ data.forEach(function (object) {
+ const object_type = object.type;
+ objects[object_type].push(object);
+ });
+ setObjects(objects);
+ setLoading(false);
+ },
+ (error: Response) => {
+ addDangerToast('Error Fetching Tagged Objects');
+ },
+ );
+ };
+
useEffect(() => {
// fetch single tag met
if (tagId) {
+ setLoading(true);
fetchSingleTag(
tagId,
(tag: Tag) => {
setTag(tag);
+ setLoading(false);
},
(error: Response) => {
addDangerToast(t('Error Fetching Tagged Objects'));
Review Comment:
same as above
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on PR #25473:
URL: https://github.com/apache/superset/pull/25473#issuecomment-1743394487
@hughhhh would you mind filling out the PR description.
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "hughhhh (via GitHub)" <gi...@apache.org>.
hughhhh commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1345015498
##########
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx:
##########
@@ -30,6 +30,7 @@ import { EmptyStateBig } from 'src/components/EmptyState';
import { fetchObjects } from '../tags/tags';
const MAX_TAGS_TO_SHOW = 3;
+const PAGE_SIZE = 5;
Review Comment:
design wants this to be 10 since there are 3 tables on the 1 page
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on code in PR #25473:
URL: https://github.com/apache/superset/pull/25473#discussion_r1343220574
##########
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx:
##########
@@ -30,6 +30,7 @@ import { EmptyStateBig } from 'src/components/EmptyState';
import { fetchObjects } from '../tags/tags';
const MAX_TAGS_TO_SHOW = 3;
+const PAGE_SIZE = 5;
Review Comment:
Should this be 50, like before?
--
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
Re: [PR] fix(tags): Update loading + pagination for Tags Page [superset]
Posted by "yousoph (via GitHub)" <gi...@apache.org>.
yousoph commented on PR #25473:
URL: https://github.com/apache/superset/pull/25473#issuecomment-1749320633
> @yousoph @kasiazjc can you take a look at the page at 5 vs. 10 in our shortcut ticket and let me know what you think
10 looked good to us!
--
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