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

🎉 UI updates for standardized explorer names, explore tagging, and an explorer-tiles component #3158

Merged
merged 16 commits into from
Feb 16, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Jan 31, 2024

The UI complement to owid/owid-content#36

Charts page:

image

Explorer Tiles component:

image

Explorer page:

image

Explorer prominent link:

image

Summary by CodeRabbit

  • New Features

    • Added a new "Explorer Tags" management page in the Admin interface, enabling viewing, editing, and deleting of tags associated with explorers.
    • Introduced navigation to the "Explorer Tags" page from the Admin sidebar under the "Explorers" section.
    • Added functionality for displaying explorer tiles in articles, including titles, subtitles, and links to charts or data explorers.
    • Implemented a new route for fetching all explorer tags.
  • Enhancements

    • Improved explorer page by adding support for an explorerSubtitle.
    • Enhanced styling for explorer download links and explorer tiles within articles.
  • Refactor

    • Simplified admin and API router configurations by removing unnecessary code and streamlining route definitions.
    • Updated database interactions to support new explorer tags functionality.
    • Refactored Gdoc handling to support explorer tiles and improve data processing.
  • Bug Fixes

    • Corrected logic for setting descriptions in ProminentLink component to handle various scenarios more effectively.
  • Database Changes

    • Introduced a migration for creating a new explorer_tags table to manage explorer-tag associations.

Copy link

coderabbitai bot commented Jan 31, 2024

Walkthrough

Walkthrough

The update introduces a comprehensive feature for managing explorer tags within an administrative interface. It includes the creation of a new page for tag management, enhancements to existing components for navigation and display, and backend adjustments for data handling. The changes streamline the process of linking explorers to tags, improve the user interface for managing these associations, and refine data fetching and processing mechanisms across the system.

Changes

File(s) Change Summary
adminSiteClient/AdminApp.tsx, .../AdminSidebar.tsx Added navigation and sidebar entry for the new ExplorerTagsPage.
adminSiteClient/ExplorerTagsPage.tsx Introduced a component for managing explorer tags.
adminSiteServer/adminRouter.tsx, .../apiRouter.ts Adjusted routes for tag handling and simplified existing routes.
db/db.ts, db/migration/...-ExplorerTags.ts Database enhancements for explorer tags, including new functions and a migration for a new table.
db/model/Gdoc/..., packages/@ourworldindata/types/src/gdocTypes/... Modified Gdoc handling to support explorer tiles and tags.
explorer/Explorer.tsx, explorer/ExplorerConstants.ts, ... Updated explorer components for tag management and display adjustments.
site/..., baker/... Site and baking process updates to accommodate new tag functionalities and explorer tiles.
packages/@ourworldindata/types/src/index.ts, .../utils/src/Util.ts Introduced new types and utility functions for handling explorer tiles.

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@ikesau ikesau force-pushed the explorer-name-standardization branch from 10026dc to 37e7c98 Compare February 13, 2024 21:09
@ikesau ikesau changed the title 🎉 Update all places where explorerTitle is used to transition to new title format 🎉 UI updates for standardized explorer names, explore tagging, and an explorer-tiles component Feb 13, 2024
@ikesau ikesau marked this pull request as ready for review February 13, 2024 21:11
@ikesau
Copy link
Member Author

ikesau commented Feb 13, 2024

@coderabbitai review

explorer/Explorer.tsx Outdated Show resolved Hide resolved
adminSiteServer/apiRouter.ts Show resolved Hide resolved
adminSiteServer/apiRouter.ts Show resolved Hide resolved
db/model/Gdoc/rawToEnriched.ts Outdated Show resolved Hide resolved
adminSiteServer/apiRouter.ts Show resolved Hide resolved
site/gdocs/components/ExplorerTiles.tsx Outdated Show resolved Hide resolved
site/gdocs/components/ExplorerTiles.tsx Outdated Show resolved Hide resolved
adminSiteServer/adminRouter.tsx Outdated Show resolved Hide resolved
adminSiteClient/ExplorerTagsPage.tsx Show resolved Hide resolved
adminSiteClient/ExplorerTagsPage.tsx Show resolved Hide resolved
@@ -554,22 +566,28 @@ export class GdocBase extends BaseEntity implements OwidGdocBaseInterface {
title: resolvedTitle,
resolvedUrl: `${BAKED_GRAPHER_URL}/${resolvedSlug}`,
thumbnail: `${BAKED_GRAPHER_EXPORTS_BASE_URL}/${resolvedSlug}.svg`,
tags: [],
Copy link
Member Author

Choose a reason for hiding this comment

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

Not doing anything with chart tags atm. Can add them when we need them

Copy link
Member

@mlbrgl mlbrgl left a comment

Choose a reason for hiding this comment

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

@ikesau I'm seeing a failing test (can repro locally)

Copy link
Member

@mlbrgl mlbrgl left a comment

Choose a reason for hiding this comment

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

It is so nice not to have to thread explorers throughout the codebase, well done! 🙌

Run locally, works as expected 🤝

I don't know how often this'll happen but it might be visually better to align the titles here
Screenshot 2024-02-15 at 10 35 35

Mardown making its way into prominent links (I couldn't go all the way with running mirror_explorers locally so I'm not sure if that would fix it so I'm raising it here)
Screenshot 2024-02-15 at 11 21 58

Comment on lines +47 to +53
<ul>
<li>
<Link to="/explorer-tags">
<FontAwesomeIcon icon={faTag} /> Explorer Tags
</Link>
</li>
</ul>
Copy link
Member

Choose a reason for hiding this comment

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

probably nothing to change now

this is a bit unexpected - but maybe unavoidable given the git/db limbo. When first encountering this, it gave me the impression that "explorer tags" were different from the regular ones.

Also given how seldom this is going to be used beyond the first tagging effort, it seems like there is a mismatch with the prime real estate this menu item will be permanently using.

Maybe worth considering complementing this with a more contextual link to /explorer-tags on every explorer row?

Comment on lines +258 to +260
return res.send({
explorers: await db.getExplorerTags(db.knexInstance()),
})
Copy link
Member

Choose a reason for hiding this comment

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

not absolutely necessary now, but maybe wrap in read-only transaction?

db/model/Gdoc/GdocBase.ts Show resolved Hide resolved
db/model/Gdoc/rawToEnriched.ts Outdated Show resolved Hide resolved
db/db.ts Outdated Show resolved Hide resolved
>
{icon}
<div className="explorer-tile__text-container">
<p className="h3-bold explorer-tile__title">
Copy link
Member Author

Choose a reason for hiding this comment

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

Add background blur to this

@ikesau ikesau merged commit 0151ad6 into master Feb 16, 2024
16 of 17 checks passed
@ikesau ikesau deleted the explorer-name-standardization branch February 16, 2024 16:46
@ikesau ikesau mentioned this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants