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

fix(other): column name in created content on profile page #17029

Merged
merged 2 commits into from
Oct 11, 2021

Conversation

jinghua-qa
Copy link
Member

@jinghua-qa jinghua-qa commented Oct 8, 2021

SUMMARY

fix column name in created content on profile p

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screen Shot 2021-10-07 at 11 34 51 PM

After:

Screen Shot 2021-10-08 at 11 12 53 AM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

@superset-github-bot superset-github-bot bot added the preset:QA Preset QA team label Oct 8, 2021
@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #17029 (9a7761b) into master (ea70038) will decrease coverage by 0.22%.
The diff coverage is 56.79%.

❗ Current head 9a7761b differs from pull request most recent head d1ff789. Consider uploading reports for the commit d1ff789 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17029      +/-   ##
==========================================
- Coverage   76.93%   76.70%   -0.23%     
==========================================
  Files        1030     1031       +1     
  Lines       55088    55157      +69     
  Branches     7480     7501      +21     
==========================================
- Hits        42383    42310      -73     
- Misses      12454    12595     +141     
- Partials      251      252       +1     
Flag Coverage Δ
hive ?
javascript 70.88% <55.97%> (-0.02%) ⬇️
presto ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...frontend/src/profile/components/CreatedContent.tsx 87.50% <ø> (ø)
superset-frontend/src/setup/setupErrorMessages.ts 0.00% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/index.tsx 43.57% <0.00%> (-0.23%) ⬇️
...mponents/nativeFilters/FiltersConfigModal/utils.ts 70.37% <33.33%> (-0.52%) ⬇️
...onfigModal/FiltersConfigForm/FiltersConfigForm.tsx 71.60% <35.71%> (-2.23%) ⬇️
.../src/explore/components/controls/SelectControl.jsx 77.61% <75.00%> (-1.08%) ⬇️
...ts/nativeFilters/FiltersConfigModal/FilterTabs.tsx 85.71% <77.77%> (-0.96%) ⬇️
...e/components/controls/SelectAsyncControl/index.tsx 80.48% <80.00%> (-0.60%) ⬇️
...nents/ErrorMessage/DatasetNotFoundErrorMessage.tsx 88.88% <88.88%> (ø)
...eFilters/FiltersConfigModal/FiltersConfigModal.tsx 90.16% <92.00%> (+1.59%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea70038...d1ff789. Read the comment docs.

@zhaoyongjie zhaoyongjie changed the title fix(profile): fix column name in created content on profile page fix(other): column name in created content on profile page Oct 8, 2021
@zhaoyongjie zhaoyongjie changed the title fix(other): column name in created content on profile page fix(other): column name in created content on profile page Oct 8, 2021
@zhaoyongjie zhaoyongjie self-requested a review October 8, 2021 07:22
Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

Hello @jinghua-qa. It's great that you are contributing! There is a problem with this change though. As you can see from your screenshot the date is gone. This is because you need to change the mutator function as well, which takes care of populating the date.

Specifically:

favorited: moment.utc(dash.dttm).fromNow(),

To be changed with created

To be changed with _created

The same goes for the other mutator function in this file.

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Oct 8, 2021
@jinghua-qa
Copy link
Member Author

jinghua-qa commented Oct 8, 2021

Hello @jinghua-qa. It's great that you are contributing! There is a problem with this change though. As you can see from your screenshot the date is gone. This is because you need to change the mutator function as well, which takes care of populating the date.

Specifically:

favorited: moment.utc(dash.dttm).fromNow(),

To be changed with created

To be changed with _created

The same goes for the other mutator function in this file.

Thank you for catching that, i make change accordingly~
Screen Shot 2021-10-08 at 11 12 53 AM

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

LGTM! Awesome job!

@zhaoyongjie zhaoyongjie merged commit f2d41dc into apache:master Oct 11, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
)

* fix: fix name in created content on profile page

* add more fix on mutater
@eschutho eschutho added the v1.4 label Nov 23, 2021
eschutho pushed a commit that referenced this pull request Nov 23, 2021
* fix: fix name in created content on profile page

* add more fix on mutater

(cherry picked from commit f2d41dc)
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
)

* fix: fix name in created content on profile page

* add more fix on mutater
@tenglong3158
Copy link

tenglong3158 commented Feb 8, 2022

@expose("/created_dashboards/<int:user_id>/", methods=["GET"])
def created_dashboards( # pylint: disable=no-self-use
self, user_id: int
) -> FlaskResponse:
Dash = Dashboard
qry = (
db.session.query(Dash)
.filter( # pylint: disable=comparison-with-callable
or_(Dash.created_by_fk == user_id, Dash.changed_by_fk == user_id)
)
.order_by(Dash.changed_on.desc())
)
payload = [
{
"id": o.id,
"dashboard": o.dashboard_link(),
"title": o.dashboard_title,
"url": o.url,
"dttm": o.changed_on,
}
for o in qry.all()
]
return json_success(json.dumps(payload, default=utils.json_int_dttm_ser))

@expose("/created_slices", methods=["GET"])
@expose("/created_slices/<int:user_id>/", methods=["GET"])
def created_slices( # pylint: disable=no-self-use
self, user_id: Optional[int] = None
) -> FlaskResponse:
"""List of slices created by this user"""
if not user_id:
user_id = g.user.get_id()
qry = (
db.session.query(Slice)
.filter( # pylint: disable=comparison-with-callable
or_(Slice.created_by_fk == user_id, Slice.changed_by_fk == user_id)
)
.order_by(Slice.changed_on.desc())
)
payload = [
{
"id": o.id,
"title": o.slice_name,
"url": o.slice_url,
"dttm": o.changed_on,
"viz_type": o.viz_type,
}
for o in qry.all()
]
return json_success(json.dumps(payload, default=utils.json_int_dttm_ser))

The column name should be the modification time, not the creation time, is that right? @zhaoyongjie @jinghua-qa

@ad-m
Copy link
Contributor

ad-m commented Feb 8, 2022

@tenglong3158
Copy link

Thank you @ad-m ! I'll revise the comment now.

@mistercrunch mistercrunch added 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:QA Preset QA team size/S v1.4 🍒 1.4.0 🍒 1.4.1 🍒 1.4.2 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants