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

Homepage updates #3431

Merged
merged 7 commits into from
Apr 19, 2024
Merged

Homepage updates #3431

merged 7 commits into from
Apr 19, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Mar 29, 2024

Resolves (most of) #3290

@marcelgerber
Copy link
Member

marcelgerber commented Apr 2, 2024

Hi! I don't think adding a method to find grapherId-based explorers is a natural contender for #3428.
We currently have this weird conundrum that most of our explorer code is based off file system reads, but some of the "analytics"-like requests are served from the DB instead (which should have the same content -- eventually).

Here's a query you can use to find the number of non-grapherId views:

SELECT COUNT(*)
FROM explorers,
     json_table(config, "$.blocks[*]"
                COLUMNS (
                    type TEXT PATH "$.type",
                    NESTED PATH "$.block[*]"
                        COLUMNS (grapherId INT PATH "$.grapherId")
                    )
     ) t1
WHERE isPublished = 1
  AND type = "graphers"
  AND grapherId IS NULL

Maybe @danyx23 has a good idea how best to incorporate this query into the baking process, or where to put it?

@danyx23
Copy link
Contributor

danyx23 commented Apr 2, 2024

Nice query, @marcelgerber :). I think putting this into the db folder, maybe in a new file, and calling it during baking sounds like a pretty good solution.

@ikesau ikesau marked this pull request as ready for review April 16, 2024 20:37
Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

Very nice!

db/model/Gdoc/GdocHomepage.ts Outdated Show resolved Hide resolved
site/search/searchClient.ts Outdated Show resolved Hide resolved
@ikesau ikesau merged commit aff9e76 into master Apr 19, 2024
20 of 22 checks passed
@ikesau ikesau deleted the homepage-updates branch April 19, 2024 23:07
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.

3 participants