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: add new empty pages #40

Merged
merged 4 commits into from
Jun 7, 2024
Merged

feat: add new empty pages #40

merged 4 commits into from
Jun 7, 2024

Conversation

yamashita-kenngo
Copy link
Contributor

@yamashita-kenngo yamashita-kenngo commented Jun 7, 2024

Summary by CodeRabbit

  • 新機能

    • ダッシュボードヘッダーとナビゲーションオプション、ログアウトボタンを表示する新しいHeaderコンポーネントを追加。
    • アカウント情報を表示するAccountPageコンポーネントを追加。
    • テナントページを表示するTenantPageコンポーネントを追加。
    • 設定ページを表示するSettingPageコンポーネントを追加。
    • 商品ページを表示するProductPageコンポーネントを追加。
  • 改善

    • ログイン後のリダイレクトURLを/dashboardから/dashboard/accountに変更。
    • ダッシュボードルートの構造を改善し、特定のコンポーネントを各ルートに割り当て。
  • テスト

    • HeaderAccountPageProductPageSettingPageTenantPageコンポーネントのテストケースを追加。

Copy link

coderabbitai bot commented Jun 7, 2024

Warning

Rate limit exceeded

@yamashita-kenngo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 27 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 8ab8868 and b5feb42.

ウォークスルー

この変更では、ダッシュボードのナビゲーションと認証機能を強化するために、新しいコンポーネントやルートが追加されました。特に、Headerコンポーネントの追加と複数のページ (AccountPage, TenantPage, SettingPage, ProductPage) の導入が含まれています。これにより、ユーザーはより直感的にナビゲーションでき、認証チェックも強化されました。

変更点

ファイルパス 変更概要
app/src/contents/common/header.tsx 新しいHeaderコンポーネントの追加。
app/src/index.tsx インポートパスの変更と新しいルートの追加。
app/src/pages/account/account.tsx AccountPageコンポーネントの追加とアカウント情報取得機能の実装。
app/src/pages/login/login.tsx インポートパスの変更とリダイレクトURLの更新。
app/src/pages/product/product.tsx ProductPageコンポーネントの追加。
app/src/pages/setting/setting.tsx SettingPageコンポーネントの追加。
app/src/pages/tenant/tenant.tsx TenantPageコンポーネントの追加。
app/src/service/auth.ts signOut関数のインポート修正。
app/src/contents/common/header.test.tsx Headerコンポーネントのテスト追加。
app/src/pages/account/account.test.tsx AccountPageコンポーネントのテスト更新。
app/src/pages/product/product.test.tsx Productコンポーネントのテスト追加。
app/src/pages/setting/setting.test.tsx Settingコンポーネントのテスト追加。
app/src/pages/tenant/tenant.test.tsx Tenantコンポーネントのテスト追加。

うさぎが跳ねる、コードの中で、
新しいページが増えたよ、わくわくの波。
アカウント、テナント、設定も、
ダッシュボードは輝く星たち。
ナビゲーションもスムーズに、
みんなの笑顔が見えるかな。


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jun 7, 2024

Visit the preview URL for this PR (updated for commit b5feb42):

https://autonomy-tegata-dev--pr40-feat-add-empty-pages-qftg00iy.web.app

(expires Fri, 14 Jun 2024 09:41:58 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 372cb972329a2dd7e3813bc6bde2f0d317d6488e

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 77eca43 and 8ab8868.

Files selected for processing (13)
  • app/src/contents/common/header.test.tsx (1 hunks)
  • app/src/contents/common/header.tsx (1 hunks)
  • app/src/index.tsx (2 hunks)
  • app/src/pages/account/account.test.tsx (2 hunks)
  • app/src/pages/account/account.tsx (1 hunks)
  • app/src/pages/login/login.tsx (2 hunks)
  • app/src/pages/product/product.test.tsx (1 hunks)
  • app/src/pages/product/product.tsx (1 hunks)
  • app/src/pages/setting/setting.test.tsx (1 hunks)
  • app/src/pages/setting/setting.tsx (1 hunks)
  • app/src/pages/tenant/tenant.test.tsx (1 hunks)
  • app/src/pages/tenant/tenant.tsx (1 hunks)
  • app/src/service/auth.ts (1 hunks)
Files skipped from review due to trivial changes (5)
  • app/src/pages/login/login.tsx
  • app/src/pages/product/product.test.tsx
  • app/src/pages/product/product.tsx
  • app/src/pages/setting/setting.tsx
  • app/src/service/auth.ts
Additional comments not posted (8)
app/src/pages/tenant/tenant.tsx (1)

1-13: コードの変更点に問題は見当たりません。新しいTenantPageコンポーネントが正しく追加されています。

app/src/pages/account/account.test.tsx (1)

7-7: AccountPageのインポートは正しく行われています。

app/src/contents/common/header.test.tsx (1)

1-25: Headerコンポーネントのテストが適切に設定されています。問題は見当たりません。

app/src/pages/setting/setting.test.tsx (1)

11-19: 設定コンポーネントのテストセットアップとクリーンアップが適切に行われています。

app/src/index.tsx (1)

5-11: インポートパスが新しいディレクトリ構造に適切に更新されています。

app/src/pages/account/account.tsx (1)

9-32: AccountPage コンポーネントが適切に定義されており、SolidJSのリアクティブ機能を正しく使用しています。

app/src/contents/common/header.tsx (2)

3-23: ヘッダーコンポーネントのナビゲーション処理が適切に行われています。


43-49: ログアウトボタンが signOutUser 関数を正しく呼び出し、ホームページにリダイレクトします。

app/src/pages/account/account.test.tsx Show resolved Hide resolved
app/src/pages/tenant/tenant.test.tsx Outdated Show resolved Hide resolved
app/src/pages/tenant/tenant.test.tsx Show resolved Hide resolved
app/src/index.tsx Outdated Show resolved Hide resolved
Comment on lines 34 to 58
async function getAccountInfo(): Promise<Account | null> {
const user = await getCurrentUser();
const uid = user?.uid;
const collectionName = "accounts";
const queryObj: QueryObj = {
field: "id",
operator: "==",
value: uid,
};
const result = await getDocumentsWithQuery(
firestore,
collectionName,
queryObj,
);
if (result instanceof Error) {
return null;
}
if (result.length === 0) {
return null;
}
if (result.length > 1) {
return null;
}
return result[0] as Account;
}
Copy link

@coderabbitai coderabbitai bot Jun 7, 2024

Choose a reason for hiding this comment

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

getAccountInfo 関数のエラーハンドリングを簡略化するためのリファクタリングを提案します。

- if (result instanceof Error) {
-   return null;
- }
- if (result.length === 0) {
-   return null;
- }
- if (result.length > 1) {
-   return null;
- }
+ if (result instanceof Error || result.length !== 1) {
+   return null;
+ }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
async function getAccountInfo(): Promise<Account | null> {
const user = await getCurrentUser();
const uid = user?.uid;
const collectionName = "accounts";
const queryObj: QueryObj = {
field: "id",
operator: "==",
value: uid,
};
const result = await getDocumentsWithQuery(
firestore,
collectionName,
queryObj,
);
if (result instanceof Error) {
return null;
}
if (result.length === 0) {
return null;
}
if (result.length > 1) {
return null;
}
return result[0] as Account;
}
async function getAccountInfo(): Promise<Account | null> {
const user = await getCurrentUser();
const uid = user?.uid;
const collectionName = "accounts";
const queryObj: QueryObj = {
field: "id",
operator: "==",
value: uid,
};
const result = await getDocumentsWithQuery(
firestore,
collectionName,
queryObj,
);
if (result instanceof Error || result.length !== 1) {
return null;
}
return result[0] as Account;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

対応
b5feb42

Copy link

Choose a reason for hiding this comment

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

@yamashita-kenngo, ありがとうございます!提案された変更を適用していただき、感謝いたします。他にレビューが必要な点があれば、お知らせください。🐰


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

@yamashita-kenngo yamashita-kenngo merged commit 93f0ca0 into main Jun 7, 2024
2 checks passed
@yamashita-kenngo yamashita-kenngo deleted the feat-add-empty-pages branch June 7, 2024 09:43
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.

1 participant