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

imprv: Make updatedAt SWR #4954

Merged
merged 8 commits into from Dec 23, 2021
Merged

imprv: Make updatedAt SWR #4954

merged 8 commits into from Dec 23, 2021

Conversation

kaori-tokashiki
Copy link
Contributor

@kaori-tokashiki kaori-tokashiki commented Dec 20, 2021

Task

  • #82972 updatedAtをSWR化する

Note

  • SWRに置き換えられたコンポーネント
    • PageContentFooter
    • GrowiSubNabigation
    • TrashPageAlert

View

  • GrowiSubNabigation

Screen Shot 2021-12-20 at 14 48 57

  • PageContentFooter

Screen Shot 2021-12-20 at 14 49 06

  • TrashPageAlert

Screen Shot 2021-12-20 at 14 28 40

@kaori-tokashiki kaori-tokashiki changed the title Imprv/82972 make updated at swr Imprv/82972 make updatedAt swr Dec 20, 2021
@kaori-tokashiki kaori-tokashiki changed the title Imprv/82972 make updatedAt swr imprv: 82972 make updatedAt swr Dec 20, 2021
@kaori-tokashiki kaori-tokashiki self-assigned this Dec 20, 2021
@@ -20,7 +20,7 @@
data-page-created-at="{% if page %}{{ page.createdAt|datetz('Y/m/d H:i:s') }}{% endif %}"
data-page-creator="{% if page && page.creator %}{{ page.creator|json }}{% endif %}"
data-page-last-update-username="{% if page && page.lastUpdateUser %}{{ page.lastUpdateUser.name }}{% endif %}"
data-page-updated-at="{% if page %}{{ page.updatedAt|datetz('Y/m/d H:i:s') }}{% endif %}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

1行目に {% if page %}があるので、 この中ではif文必要ないと判断し削除しました。

@@ -60,7 +63,7 @@ const AuthorInfo = (props) => {
};

AuthorInfo.propTypes = {
date: PropTypes.string.isRequired,
date: PropTypes.instanceOf(Date),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

undifinedが帰ってくる可能性があるのでisRequiredをつけていません

Comment on lines +19 to +21
const nullinfoLabelForFooter = mode === 'create'
? 'Created by'
: 'Updated by';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • nullの場合の表示です

Screen Shot 2021-12-23 at 18 21 35

Screen Shot 2021-12-23 at 18 21 29

769542-25e7-480d-8479-51ff4a9c90b7.png">

@yuki-takei yuki-takei changed the title imprv: 82972 make updatedAt swr imprv: Make updatedAt SWR Dec 23, 2021
@yuki-takei yuki-takei merged commit 575d43e into master Dec 23, 2021
@yuki-takei yuki-takei deleted the imprv/82972-make-updatedAt-swr branch December 23, 2021 09:30
@github-actions github-actions bot mentioned this pull request Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants