-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feat/work experience average section rating api #1383
Conversation
There was a problem hiding this 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 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不能這樣寫,否則這樣若出現0就會有問題
There was a problem hiding this comment.
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 解構出來的 averageSectionRating
,undefined
或 null
,兩者都會有,我想一下怎麼改
-
先前 averageSectionRating 不為 0 的討論串
feat: 工作心得列表卡片修改 & 工作心得單篇頁面改版 #1354 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
咦,我看 code 應該只會有 undefined,竟然會有 null, undefined 都跑出來了
麻煩 @YongChenSu 可以分別給我
undefined 的 case
null 的 case
我覺得應該要再釐清一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mark86092 看起來是進到單篇 experiences
會出現 undefined
There was a problem hiding this comment.
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 的給我嗎?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我先釐清一下,或許可以自己解決
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正,尚未推上去,發現是我沒將 averageSectionRating
加到 queryRelatedExperiencesGql
中。
趁機釐清一下,頁面資料來源
); | ||
}; | ||
</div> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected code change ?
|
手機版的排版,看起來有點跑版 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@YongChenSu 不過我剛剛看評價單篇頁面,每一個面向的評分並沒有顯示 https://www.figma.com/design/okGUQmeosjVn2hMRBNrx75/Goodjob?node-id=994-18660&t=cnw928gIFmQtTPiQ-0 |
一開始是不是沒有提到要做這部分?不過沒關係 但我會先做導流,今天應該可以發導流 PR。 |
有的,PRD 裡面有,這個 PR 原本的票其實指的就是要做單篇的。反而是卡片的我忘記開票,然後你做完了 😆 |
Close #1374
這個 PR 是?
1. 新增 averageSectionRating api return key-value,並 parse 到小數點後第二位。Screenshots
評價大、小螢幕版面
單篇上半部,大、小螢幕版面
單篇下半部,大、小螢幕版面
我應該如何手動測試?
分享工作心得(評價) > 留下多個不同面向的分數
ex: 留下三個面向,分別為 4 分、3、3 分,那麼 averageSectionRating 會是 (4 + 3 + 3) / 3 =
3.33
分