| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
* add Jest test
* add a Cypress test in article pages spec
|
| |
|
|
|
|
|
| |
* remove next/router dependency
* remove pageTitle since it is defined in MDX
* reduce statements by grouping messages
* mock response with MSW and add test for sendEmail
|
| |
|
|
|
|
|
|
| |
* use GraphQL API instead of REST (the inconvenient however is that we
now need an authorization token...)
* move fetcher in services
* add tests
* mock response using MSW
|
| |
|
|
|
|
| |
* add useTopic and useTopicsList hooks to refresh data
* add a table of contents
* add Cypress tests
|
| |
|
|
|
|
|
|
|
|
|
| |
* add a table of contents (however posts heading are
not included)
* rename posts list section title
* add a useThematic hook to refresh thematic contents
* add a useThematicLists hook to refresh thematics list
* add a `notIn` filter in thematics list fetcher to directly
remove unwanted thematics
* add Cypress tests
|
| |
|
|
|
|
|
|
|
|
|
| |
* use rehype to update code blocks class names
* fix widget heading level (after a level 1 it should always be a level
2 and not 3)
* replace Spinner with LoadingPage and LoadingPageComments components to
keep layout coherent
* refactor useArticle and useComments hooks
* fix URLs in JSON LD schema
* add Cypress tests
|
| |
|
|
|
|
|
|
|
| |
* move custom homepage components that does not require props to the
MDX file (links should not need to be translated here but where they
are defined)
* move SEO title and meta desc to MDX file
* make Page component the wrapper instead of using a React fragment
* fix MDX module types
|
| |
|
|
|
|
|
|
|
|
| |
When I refactored the fetchers and convertors in #f111685 I forgot to
convert WPThematicPreview and WPTopicPreview so the thematics and
topics pages was broken.
I also:
* removed the ToC added by error in #70b4f63
* fix heading styles
* fix website url in topics pages
|
| |
|
|
|
|
| |
* some nodes was missing in topicQuery
* a node was mispelled in topicsListQuery
* add tests for all topics fetchers
|
| |
|
|
|
|
| |
* some nodes was queried but missing in the Thematic type and
vice versa, it is now fixed
* add tests for all thematics fetchers
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
If we use fetchPostsCount inside fetchAllPostsSlugs, we might have
problems to test fetchAllPostsSlugs failure. So it is better to let
the consumer pass the posts count as an argument. The same applies
to thematics and topics.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The Typescript mapped types was useful for autocompletion in fetchers
but their are harder to maintain. I think it's better to keep each
query close to its fetcher to have a better understanding of the
fetched data. So I:
* colocate queries with their own fetcher
* colocate mutations with their own mutator
* remove Typescript mapped types for queries and mutations
* move data convertors inside graphql services
* rename most of data types and fetchers
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since #be4d907 the ids was no longer addded to headings in
useHeadingsTree hook. It was a bad practice to manipulate the DOM
that way. However, I did not move the implementation elsewhere...
To fix this, I now use rehype-slug on both markdown contents and
html string coming from WordPress.
I'm not sure the dynamic imports are really useful here since the
table of contents is on almost all pages but Jest was failing with
regular import because of ESM. It is the only thing that makes the
tests functional again so... However if we want to test the
`updateContentTree` function, Jest fails for the same reason. So I
decided to not test this function. I've already spend too much time
on this issue.
Another problem: the ToC on projects page. Currently we use the ref
on the body but the page contents are imported dynamically so the
hook is executed before the contents are loaded. It makes the ToC
empty... We should refactor the pages so we can use the ref
directly on the imported contents.
|
| |
|
|
|
|
|
| |
It does not make sense to re-export an existing object through a hook.
On some pages both the hook and the object was imported...
It is better to use the CONFIG (previously settings) object directly
and by doing it we avoid potential errors because of conditional hooks.
|
| |
|
|
|
|
|
| |
* return a tuple instead of an object
* add a validator function as parameter (if the stored value
is manually changed, it is not safe to cast its type)
* add tests
|
| |
|
|
|
|
| |
Next expect a default export for pages so only those components should
use default exports. Everything else should use named exports to
reduce the number of import statements.
|
| |
|
|
|
|
| |
Using paths aliases starting with "@" can be confusing and can lead to
conflict with existings modules. I prefer to use relative paths to
avoid extra configuration in tools because of these aliases.
|
| |
|
|
|
|
|
|
|
| |
Previously, only the first 10 comments was loaded. So I update the
fetching method to retrieve all the comments on a post.
Also, I choose to order comments on client side because of a bug
with WPGraphQL.
Finally, I renamed the Comment type to SingleComment to avoid conflict
with existing types.
|
| |
|
|
|
|
|
| |
The api file in services was not really readable. So I move the types
and I also rewrite a little the fetch function.
I also rename most of the type to avoid conflict with preexisting
types (like Node) and to keep consistency.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* add logo to topics pages and links
* add Prism styles to articles
* and a few other adjustements
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Since I'm using new components, I will also rewrite the GraphQL queries
so it is easier to start from scratch.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* refactor: replace postBy query
postBy is now deprecated in WPGraphQL v1.7
* refactor: update post comments query
PostBy is deprecated and it is now possible to use the post ID to query
comments.
* refactor: update get topic by slug query
topicBy is deprecated
* refactor: update get thematic by slug query
thematicBy is deprecated
|
| |
|
|
|
|
|
|
|
| |
* chore: add a Pagination component
* chore: add blog pages
* chore: fallback to page number based navigation if JS disabled
* chore: update translation
|
| |
|
|
|
|
| |
It will be useful with Docker. Instead of cloning the project with a
different configuration, I can manage two different configuration
thanks to dotenv and some checking inside the app.
|
| | |
|
| |
|
|
|
| |
The comments list was static before. If an user posted a comment, even
after it was approved, the comments list was keeping the old state.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Instead of using post slug and an environment variable to fetch repo
data, I use the given repo in each project MDX file. It allows me to
fetch data from another user/organization if needed.
To make it work, I no longer provide the full URL in MDX file. The new
format is: "User/repo-slug".
I also replaced the fetch method with SWR to improve caching and to
avoid React complaining about cleanup useEffect.
|
| |
|
|
|
| |
I change the name in graphql endpoint, so I decided to repercute this
change here.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
By default WPGraphQL gets only the 10 first items if first is not
specified. So some subjects was not displayed.
I also add an order by title to the query. So I no longer need to sort
arrays inside components.
|