Skip to content

feat(main): button for writing rules page #386

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

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

majahendzel-va
Copy link
Contributor

@majahendzel-va majahendzel-va commented Feb 20, 2025

Summary by CodeRabbit

  • New Features

    • Introduced article writing guidelines on the “Become Author” page in both English and Polish. The new section provides practical tips alongside clear call-to-action buttons.
    • Enhanced advertisement sections by splitting them into two interactive components—one linking to external tips and another navigating to detailed writing rules.
  • Refactor

    • Streamlined advertisement content for improved flexibility and accessibility, enhancing the overall user experience.

Copy link

cloudflare-workers-and-pages bot commented Feb 20, 2025

Deploying angular-love-client with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f14b3e
Status: ✅  Deploy successful!
Preview URL: https://fafa7b8b.angular-love-client.pages.dev
Branch Preview URL: https://feat-writing-rules-button.angular-love-client.pages.dev

View logs

@majahendzel-va majahendzel-va force-pushed the feat/writing-rules-button branch 2 times, most recently from 756ac1b to 318e6e3 Compare February 21, 2025 11:57
Copy link

Deploying angular-love-client with  Cloudflare Pages  Cloudflare Pages

Latest commit: 318e6e3
Status: ✅  Deploy successful!
Preview URL: https://b5d12edd.angular-love-client.pages.dev
Branch Preview URL: https://feat-writing-rules-button.angular-love-client.pages.dev

View logs

@majahendzel-va majahendzel-va force-pushed the feat/writing-rules-button branch from 318e6e3 to 0f14b3e Compare February 26, 2025 16:00
Copy link

coderabbitai bot commented Feb 26, 2025

Walkthrough

The changes extend the blog’s authoring section by adding a new "articleWritingRules" configuration in both English and Polish locale files. The author page is updated to display two distinct advertisement components—one linking externally via Typeform and another performing local navigation using Angular’s router. Additionally, the advertisement component itself has been refactored to allow dynamic content projection with the <ng-content> directive. New imports for routing and localization have also been introduced, and an accessibility-focused input property (ariaLabel) has been added to the advertisement component.

Changes

Files Change Summary
apps/blog/src/assets/i18n/en.json
apps/blog/src/assets/i18n/pl.json
Added a new articleWritingRules section under becomeAuthorPage with keys title, description, and buttonText (localized for English and Polish).
libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.html
libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.ts
Expanded the author page to include two advertisement components with distinct navigation behaviors (one external, one local) and added new imports (RouterLink, AlLocalizePipe).
libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.html
libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.ts
Refactored the advertisement component to remove static content in favor of <ng-content> for flexible content projection, updated aria-labelledby via a method, removed the unused TranslocoDirective, and added an ariaLabel input property.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant B as BecomeAuthorPage
    participant A1 as Advertisement (External)
    participant A2 as Advertisement (Local)
    participant R as AngularRouter

    U->>B: Load Become Author Page
    B->>A1: Render External Advertisement (Typeform URL)
    B->>A2: Render Local Advertisement (Writing Rules)
    U->>A1: Click External Advertisement Button
    A1->>U: Redirect to Typeform URL
    U->>A2: Click Local Advertisement Button
    A2->>R: Trigger Angular Routing
    R->>U: Navigate to Writing Rules Page
Loading

Poem

I’m a rabbit, coding with glee,
New tips and ads now hop on the tree.
Translations and routes, a digital race,
Content flows with dynamic grace.
With every change, I dance and cheer—
Hopping through code, my days are clear! 🐰💕

Tip

CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.

✨ Finishing Touches
  • 📝 Generate Docstrings

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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

@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: 0

🧹 Nitpick comments (1)
apps/blog/src/assets/i18n/en.json (1)

46-50: Add a period to the end of the description for consistency.

The descriptions in other sections of the i18n file typically end with a period, but the new "articleWritingRules" description doesn't. Consider adding one for consistency.

-      "description": "Hey! Here are some practical tips to help you get started and make your writing stand out",
+      "description": "Hey! Here are some practical tips to help you get started and make your writing stand out.",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 062cd08 and 0f14b3e.

📒 Files selected for processing (6)
  • apps/blog/src/assets/i18n/en.json (1 hunks)
  • apps/blog/src/assets/i18n/pl.json (1 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.html (1 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.ts (2 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.html (1 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.ts (1)

2-2: LGTM - Good addition of necessary imports.

The addition of RouterLink and AlLocalizePipe imports is appropriate for implementing the writing rules button functionality. Good job organizing the imports and updating the component's imports array accordingly.

Also applies to: 5-5, 24-25

libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.ts (1)

1-1: Good use of the modern input() API and enhanced accessibility.

The component has been properly refactored to:

  1. Use the new signal-based input() API
  2. Include an ariaLabel property that enhances accessibility
  3. Remove the TranslocoDirective which is no longer needed due to content projection

This makes the component more reusable and accessible.

Also applies to: 12-12, 17-19

libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.html (1)

2-9: Well-implemented content projection with accessibility support.

The template has been refactored to use content projection via <ng-content />, making the component more flexible and reusable. Good use of:

  1. Container queries with @container
  2. Proper accessibility attributes with [attr.aria-labelledby]="ariaLabel()"
  3. Responsive layout with flex utilities

This is a solid improvement to the component architecture.

apps/blog/src/assets/i18n/pl.json (1)

49-53: New "articleWritingRules" Translation Section Verification
The new "articleWritingRules" section correctly includes the keys "title", "description", and "buttonText". The language is clear and aligns with the intended user guidance for writing rules. Ensure that these keys remain consistent with their counterparts in the English JSON file.

libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.html (2)

12-40: First Advertisement Component – External Link
The first advertisement component is well structured. It properly uses the <al-become-author-advertisement> component with an ariaLabel of 'author-ad-title'. The title, description, and button text are dynamically populated with the translation function t(), and the external link (targeting a Typeform URL) is set appropriately with target="_blank". This implementation promotes accessibility and clarity in design.


41-69: Second Advertisement Component – Local Navigation for Writing Rules
The second advertisement component is implemented effectively. The use of [routerLink]="'/writing-rules' | alLocalize" ensures that local navigation is dynamically localized. The ariaLabel of 'writing-rules-ad-title' and corresponding id on the <h3> element correctly support accessibility. All translation keys reference the new "articleWritingRules" section consistently. Please verify that the local route /writing-rules is correctly configured in the application routing.

@DDonochVA DDonochVA merged commit 6080a70 into main Mar 5, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request May 8, 2025
@coderabbitai coderabbitai bot mentioned this pull request May 29, 2025
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.

2 participants