feat: add creatives table and sectors page #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As requested in the FE test, I added the creatives table in Library page and added a new sectors page.
I created the corresponding
.domain
,.repository
,.page
and. widget
files and added them trying to follow current project structure. I tried to reuse as much components as I could, in order to not duplicated things.I had to update
schemas.graphql
andschemas.ts
since thelistFolder
BE service was replaced byfolder
. So I had to adjust the query name and add the new types.I added a date formatter tool to format dates. This tool uses the locale to format the date. By default it uses
en-US
locale but by passing user's locale as the second parameter, you can get the date formatted in user's locale. I also added some unit test for this.I had to remove
omick
dependency frompackage.json
since it wasn't available in yarn repository. Nonetheless, that dependency was not being used.This is the first time I see this kind of project structure for a React project. It took me a while to understand where each component lives. Even though I see the value provided by this folder structure, I think for a React project there's a more simple approach.
Another thing I found interesting is the use of
genql
together withswr
to communicate with the GQL server. Having to create several files in order to call a GQL query (for instance). I think the same thing could be addressed withapollo client
with lot less code.