-
Notifications
You must be signed in to change notification settings - Fork 5
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: スポンサー一覧ページを作成する #170
Conversation
メタ情報のレビューをお願いします 🙏 メタ情報
レビュー観点
|
タイトル、私はいいと思います。専用OGPは不要(トップと同じでOK)です。 |
…numSponsor: SponsorPlans = sponsorList[2]'
b1822c1
to
340092f
Compare
という点に違和感を感じました。
これをそのまま表現して なお、having の箇所は SQL の Having 句にインスパイアされています。 補足デメリットこの手の後ろから修飾する言葉は、ループで回したりするときに、多少違和感が生まれます。 例) (できれば xxxSponsorPlans で終わりたいという意味) その他の案「〇〇を持っている」として with を使うこともあります。
ただし、この場合には、配列の要素ひとつひとつに sponsors が含まれている印象を持たせてしまうと思います。
というものが帰って来そうな印象を受けます。今回のように「絞り込む」用途では having を使う方がよいと思います。 |
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.
不安な部分
を書いてくださっていたのでレビューしやすかったです 👍
当該箇所にコメントしたので確認してください〜
:key="sponsor.sys.id" | ||
class="sponsor" | ||
> | ||
<a :href="sponsor.fields.url" target="_blank" rel="noopener"> | ||
<nuxt-link :to="`/sponsors/#sponsor_${sponsor.sys.id}`"> |
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.
HTML の id 属性が数字から始まる場合、アンカーがうまく動作しないことがあったため sponsor_ プレフィックスを入れました。
あー、なるほど 👍
そすねー、自分もどうやって知ったんだっけなあ 🤔
結論
分かんない。途中まで調べたけど結局最後まで辿り着けませんでした。
後日、分かったら共有しますね〜
以下調べたログ
RFC3986
URI については RFC 3986 で定義されていますね。
RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax
https://tools.ietf.org/html/rfc3986
RFC3986 で fragment
あるいは fragment identifier
と表記されているので、そちらの用語で調べた方がほしい情報に辿り着きやすそうです。
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
RFC2046
The fragment's format and resolution is therefore
dependent on the media type [RFC2046] of a potentially retrieved
representation, even though such a retrieval is only performed if the
URI is dereferenced.
という記述があり、つまり、fragment の format は RFC2046 に依存しているよ、と。
で、RFC2046 の中から、フラグメント識別子のフォーマットに関する記述を探してみたのですが、全然わからねえ...
} | ||
} | ||
expect( | ||
// Getters の型を備えたスタブを準備するのが大変でコストに見合わないため @ts-ignore |
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.
ゲッターをモックするケース
第2引数として利用するゲッターが(Store から利用する場合に引数なしで)値を返す場合はモックしたほうがハンドリングしやすいと思います。
Vuex 公式ドキュメントにはその例が載っていますね。
その他の例
ゲッターをモックしないケース
一方で、今回のケースのように、第2引数として利用するゲッターが(Store から利用する場合に)引数を要する関数の場合は、モックしないほうが「第2引数のゲッターの内容を変更したときに自動的に追従してくれる」というメリットがあると思います。
getters.sponsorPlansToHaveSponsor(state, {
sponsorsByPlan: getters.sponsorsByPlan(state)
})
src/types/sponsors.ts
Outdated
} | ||
} | ||
|
||
export interface SponsorPlans { |
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.
あえてこのファイルの中に入れるのであれば
export interface SponsorPlans { | |
export interface SponsorPlan { |
ですが(単数形にする)、この SponsorPlan は Contentful に独立したモデルとして登録しても良いくらいのものなので(アプリが既に完成しているので、今回は API 定義を変更しないほうがよいですが)、
types/sponsorPlan.ts に定義しても良いかなと思いました(自分だったらそうする)
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.
}) | ||
|
||
test('plan と一致するスポンサー情報のみ取得できる', () => { | ||
const platinumSponsor: SponsorPlans = sponsorList[2] |
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.
配列についてテストしているので、下記のような感じでどうでしょう?
const platinumSponsors = [sponsorList[2]]
expect(getters.sponsorsByPlan(state)('platinum')).toEqual(
platinumSponsors
)
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.
Co-Authored-By: INOUE Takuya <inouetakuya5@gmail.com>
…into add-sponsor-details
f2bf02b
to
ee58d71
Compare
ee58d71
to
60e9470
Compare
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.
細かい点をコメントしましたが、lazyload だけマストで対応していただいて、後は want 扱いで OK です〜(あともうひと息だ!:relaxed:
]) | ||
}) | ||
|
||
test('スポンサープランの詳細が表示される', () => { |
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.
👍
test('リンクがスポンサー一覧ページのアンカーになっている', () => { | ||
const platinumSponsorSysId: string = sponsorList[2].sys.id | ||
const platinumSponsorWrapper = wrapper.find('.platinum') | ||
expect(platinumSponsorWrapper.find(RouterLinkStub).props().to).toBe( |
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.
細かいですが、
expect(platinumSponsorWrapper.find(RouterLinkStub).props().to).toBe( | |
expect(wrapper.find('.platinum').find(RouterLinkStub).props().to).toBe( |
というふうに繋げて書いても良いかも(お任せします)
@@ -2,12 +2,14 @@ import speakersData from '../../../fixtures/contentful/speakers' | |||
import timeTableSectionsData from '../../../fixtures/contentful/timeTableSections' | |||
import eventContainersData from '../../../fixtures/contentful/eventContainers' | |||
import eventContainerPartsData from '../../../fixtures/contentful/eventContainerParts' | |||
import sponsorsData from '../../../fixtures/contentful/sponsorList' |
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.
他と合わせて下記で良さそうです。
import sponsorsData from '../../../fixtures/contentful/sponsorList' | |
import sponsorsData from '../../../fixtures/contentful/sponsors' |
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<img |
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.
このページは画像の数が多いので lazyload にしてもらいたいです〜 🙏
あと「トップに戻る」との余白が小さすぎるようなので、ここだけマストで対応お願いします 🙏 (次の PR があるようなので lazyload はそちらに回してよいと思いました) もう日にちが日にちなので、ここの対応だけ済ませて出しちゃいましょう〜! |
…できるが production 環境では margin 0 auto に上書きされてしまう
…tentful/sponsors.ts
rry さんから連絡があり、体調を崩してしまったとのことでしたので、代わりにコミットしました〜。マージします! |
@inouetakuya おいちゃんさんすみません、風邪でダウンしていたところ作業していただいて大変申し訳ございませんでした!!! 🙇♀ 無事マージできたようで良かったです、ありがとうございます。 |
resolve: #132
TODO
レビューポイント
この PR で対応しないこと
#132 (comment)
こちらのコメントのとおり、この PR では lg サイズ以上の index のインタラクションについては対応せず、別 PR で開発を進める予定です。
参考
close: #165
デザインカンプはこちら↓
https://www.figma.com/file/BpIgcZdusbS3CgPHQhhK79T7/Vue-Fes-Japan-2019-Web?node-id=1080%3A3423