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

Feat/work experience average section rating api #1383

Merged
merged 7 commits into from
Aug 18, 2024

Conversation

YongChenSu
Copy link
Collaborator

@YongChenSu YongChenSu commented Jul 28, 2024

Close #1374

這個 PR 是?

1. 新增 averageSectionRating api return key-value,並 parse 到小數點後第二位。

  1. 新增 averageSectionRating api return key-value,並 parse 到小數點後第一位
  2. 修正不同尺寸螢幕大小,跑版問題。

Screenshots

  • 評價大、小螢幕版面
    2024-08-18 14 42 44

  • 單篇上半部,大、小螢幕版面
    2024-08-18 14 43 13

  • 單篇下半部,大、小螢幕版面
    2024-08-18 14 43 32

我應該如何手動測試?

分享工作心得(評價) > 留下多個不同面向的分數

ex: 留下三個面向,分別為 4 分、3、3 分,那麼 averageSectionRating 會是 (4 + 3 + 3) / 3 = 3.33

peteranny
peteranny previously approved these changes Jul 28, 2024
Copy link
Contributor

@peteranny peteranny left a comment

Choose a reason for hiding this comment

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

兩個建議

@@ -71,7 +70,7 @@ const ExperienceEntry = ({
)}
</div>
)}
{averageSectionRating !== null ? (
{averageSectionRating ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

不能這樣寫,否則這樣若出現0就會有問題

Copy link
Collaborator Author

@YongChenSu YongChenSu Jul 28, 2024

Choose a reason for hiding this comment

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

我有想過這個問題,但是不是不會有 0 的狀況出現啊?不過這樣寫,是很信任後端來的資料不為 0,好像也不是很好。

如果改成 averageSectionRating !== undefined,這樣寫由於 averageSectionRating 已經從 data 解構出來,averageSectionRating 有可能是 undefined,這樣改覺得好嗎?

喔,抱歉,發現我上面有講錯,ExperienceEntry 解構出來的 averageSectionRatingundefinednull,兩者都會有,我想一下怎麼改

Copy link
Contributor

Choose a reason for hiding this comment

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

image

這個 comment 當初是在討論 null / undefined,我覺得 averageSectionRating 會不存在才是重點

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

喔,抱歉,發現我上面有講錯,ExperienceEntry 解構出來的 averageSectionRatingundefinednull,兩者都會有,我想一下怎麼改

image

Copy link
Contributor

@mark86092 mark86092 Jul 28, 2024

Choose a reason for hiding this comment

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

咦,我看 code 應該只會有 undefined,竟然會有 null, undefined 都跑出來了

https://github.com/goodjoblife/WorkTimeSurvey-backend/compare/master...dev#diff-50883af379f9b860b4e4d913841f23c6008626ddfc4af43efbe3d6edf4d761a8R767

麻煩 @YongChenSu 可以分別給我

undefined 的 case
null 的 case

我覺得應該要再釐清一下

Copy link
Collaborator Author

@YongChenSu YongChenSu Jul 28, 2024

Choose a reason for hiding this comment

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

@mark86092 看起來是進到單篇 experiences 會出現 undefined
2024-07-28 22 48 46

Copy link
Contributor

@mark86092 mark86092 Jul 28, 2024

Choose a reason for hiding this comment

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

我們先從 api response 來看好了

(1) null case 的 experience id
(2) undefined case 的 experience id

麻煩 @YongChenSu 可以找這兩個 case 的給我嗎?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

我先釐清一下,或許可以自己解決

Copy link
Collaborator Author

@YongChenSu YongChenSu Aug 5, 2024

Choose a reason for hiding this comment

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

已修正,尚未推上去,發現是我沒將 averageSectionRating 加到 queryRelatedExperiencesGql 中。

趁機釐清一下,頁面資料來源

  1. 評價列表這一頁,是 sever side render,averageSectionRating 是從 work-experiences 來的
    Screen Shot 2024-08-05 at 8 43 53 PM
  2. 進到單篇,最上面的完整的評價,是 sever side render,averageSectionRating 是從 queryExperienceGql 來的
    image
  3. 進到單篇,下面的評價列表,averageSectionRating 是從 queryRelatedExperiencesGql 來的
    Screen Shot 2024-08-05 at 9 35 49 PM

src/components/common/OverallRating/index.js Outdated Show resolved Hide resolved
);
};
</div>
);
Copy link
Contributor

Choose a reason for hiding this comment

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

unexpected code change ?

@barry800414
Copy link
Contributor

barry800414 commented Aug 11, 2024

@YongChenSu

Screenshot 2024-08-10 at 9 50 10 PM

  1. 面試經驗跟評價的卡片裡面的 👍 icon 大小不太一致
    Figma 裡面的應該是一致的

  2. 評價卡片的 👍 ,沒有與面試經驗卡片的 👍 一樣向右對齊

@barry800414
Copy link
Contributor

barry800414 commented Aug 11, 2024

@YongChenSu

Screenshot 2024-08-10 at 9 53 50 PM

手機版的排版,看起來有點跑版

Figma

Copy link
Contributor

@barry800414 barry800414 left a comment

Choose a reason for hiding this comment

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

LGTM

@barry800414
Copy link
Contributor

@YongChenSu 不過我剛剛看評價單篇頁面,每一個面向的評分並沒有顯示
你會再另外開一個 PR 嗎?

Screenshot 2024-08-18 at 2 39 19 PM

https://www.figma.com/design/okGUQmeosjVn2hMRBNrx75/Goodjob?node-id=994-18660&t=cnw928gIFmQtTPiQ-0

@YongChenSu
Copy link
Collaborator Author

YongChenSu commented Aug 18, 2024

@YongChenSu 不過我剛剛看評價單篇頁面,每一個面向的評分並沒有顯示 你會再另外開一個 PR 嗎?

Screenshot 2024-08-18 at 2 39 19 PM https://www.figma.com/design/okGUQmeosjVn2hMRBNrx75/Goodjob?node-id=994-18660&t=cnw928gIFmQtTPiQ-0

一開始是不是沒有提到要做這部分?不過沒關係
我會確認一下,評價單篇的每一個面向的分數是否可以取得了,接續完成後發 PR。

但我會先做導流,今天應該可以發導流 PR。

@YongChenSu YongChenSu merged commit 8024c43 into dev Aug 18, 2024
8 checks passed
@YongChenSu YongChenSu deleted the feat/work-experience-averageSectionRating-api branch August 18, 2024 07:07
@barry800414
Copy link
Contributor

barry800414 commented Aug 18, 2024

有的,PRD 裡面有,這個 PR 原本的票其實指的就是要做單篇的。反而是卡片的我忘記開票,然後你做完了 😆

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.

[前端][M1] 工作心得單篇頁面接 API [前端][M1] 工作心得列表卡片修改
4 participants