-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(ojoi): Fixing bugs found in demo #15130
Conversation
WalkthroughThe changes primarily involve updating GraphQL query parameters, adding pagination, refining CSS for responsive design, and restructuring the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant Frontend
participant Backend
participant Database
User->>Frontend: Request Advert Details
Frontend->>Backend: ADVERT_QUERY with OfficialJournalOfIcelandAdvertSingleParams
Backend->>Database: Fetch Advert Details
Database->>Backend: Return Advert Details
Backend->>Frontend: Return Advert Details
Frontend->>User: Display Advert Details
User->>Frontend: Request Department List
Frontend->>Backend: DEPARTMENT_QUERY with OfficialJournalOfIcelandAdvertSingleParams
Backend->>Database: Fetch Department List
Database->>Backend: Return Department List
Backend->>Frontend: Return Department List
Frontend->>User: Display Department List
User->>Frontend: Navigate to Regular Signature
Frontend->>Frontend: Render RegularSignature Component
Frontend->>User: Display RegularSignature Form
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (2)
libs/clients/official-journal-of-iceland/public/src/lib/officialJournalOfIcelandClient.service.ts (1)
40-49
: Consider replacingconsole.log
andconsole.error
with a more robust logging framework.libs/application/templates/official-journal-of-iceland/src/fields/AdvertModal.tsx (1)
Line range hint
71-71
: Specify button type to prevent form submission.- <button onClick={closeModal}> + <button type="button" onClick={closeModal}>Ensure that the button does not inadvertently submit forms by explicitly setting its type to "button".
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (20)
- apps/web/screens/queries/OfficialJournalOfIceland.ts (1 hunks)
- libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts (3 hunks)
- libs/api/domains/official-journal-of-iceland/src/lib/models/advert.response.ts (2 hunks)
- libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts (1 hunks)
- libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts (3 hunks)
- libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts (3 hunks)
- libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts (1 hunks)
- libs/application/templates/official-journal-of-iceland/src/components/signatures/Regular.tsx (4 hunks)
- libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (1 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/Advert.css.ts (2 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (8 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/AdvertModal.tsx (4 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/Preview.tsx (2 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (7 hunks)
- libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (1 hunks)
- libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (2 hunks)
- libs/application/templates/official-journal-of-iceland/src/lib/constants.ts (1 hunks)
- libs/application/templates/official-journal-of-iceland/src/lib/dataSchema.ts (2 hunks)
- libs/clients/official-journal-of-iceland/public/src/clientConfig.json (31 hunks)
- libs/clients/official-journal-of-iceland/public/src/lib/officialJournalOfIcelandClient.service.ts (2 hunks)
Files skipped from review due to trivial changes (2)
- libs/application/templates/official-journal-of-iceland/src/components/htmlEditor/HTMLEditor.css.ts
- libs/clients/official-journal-of-iceland/public/src/clientConfig.json
Additional context used
Path-based instructions (18)
libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/Advert.css.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.response.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/clients/official-journal-of-iceland/public/src/lib/officialJournalOfIcelandClient.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/lib/constants.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/Preview.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
apps/web/screens/queries/OfficialJournalOfIceland.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/AdvertModal.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/lib/dataSchema.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/official-journal-of-iceland/src/components/signatures/Regular.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Biome
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts
[error] 35-35: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 42-42: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 49-49: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 56-56: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 63-63: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 70-70: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 77-77: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 84-84: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
[error] 91-91: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.libs/application/templates/official-journal-of-iceland/src/fields/AdvertModal.tsx
[error] 71-71: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
Additional comments not posted (43)
libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts (1)
1-7
: LGTM! TheAdvertSingleParams
class is well-defined with appropriate GraphQL decorators.libs/application/templates/official-journal-of-iceland/src/fields/Advert.css.ts (2)
4-11
: Responsive design improvements ininputWrapper
are well-implemented.
32-34
: Enhancements to themodal
style improve usability by enabling vertical scrolling and setting a specific height.libs/api/domains/official-journal-of-iceland/src/lib/models/advert.response.ts (2)
13-15
: Addition oftype
field inAdvertTypeResponse
enhances data specificity.
46-48
: Addition ofdepartment
field inAdvertDepartmentResponse
improves data handling.libs/clients/official-journal-of-iceland/public/src/lib/officialJournalOfIcelandClient.service.ts (1)
27-29
: New methodsdepartment
andtype
are correctly implemented for API interactions.Also applies to: 35-37
libs/application/templates/official-journal-of-iceland/src/components/signatures/Signatures.css.ts (3)
29-33
: Responsive design adjustment for smaller screens is correctly implemented.
40-44
: Responsive design adjustment for smaller screens is correctly implemented.
59-60
: Styling adjustments for the remove button are appropriate for maintaining layout consistency.libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts (4)
28-30
: Method update aligns with the new data model changes.
46-48
: Method update aligns with the new data model changes.
50-50
: Method update correctly handles the new structure for multiple types.
58-58
: Method update improves data handling by mapping advert status.libs/application/templates/official-journal-of-iceland/src/fields/Summary.tsx (2)
6-6
: Updated GraphQL queries are correctly implemented to match backend changes.Also applies to: 33-33
41-42
: Improved date handling logic usingMINIMUM_WEEKDAYS
enhances the accuracy of date estimations.Also applies to: 62-64
libs/application/templates/official-journal-of-iceland/src/fields/Preview.tsx (3)
16-16
: Ensure that theTYPE_QUERY
is correctly defined and matches the expected GraphQL schema.Verification successful
The
TYPE_QUERY
is correctly defined in thequeries.ts
file and is used appropriately in thePreview.tsx
file to fetch data related toAdvertType
. The query is executed using theuseQuery
hook from Apollo Client, and the fetched data is utilized within the component.
TYPE_QUERY
is defined inqueries.ts
and matches the expected GraphQL schema.TYPE_QUERY
is imported and used correctly inPreview.tsx
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of `TYPE_QUERY` in the GraphQL queries file. cat libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts | grep -A 10 "export const TYPE_QUERY"Length of output: 396
Script:
#!/bin/bash # Description: Verify the usage of `TYPE_QUERY` in the Preview.tsx file. grep -A 10 "TYPE_QUERY" libs/application/templates/official-journal-of-iceland/src/fields/Preview.tsxLength of output: 543
23-31
: Check the data structure used in theuseQuery
response to ensure it matches the expected schema, especially theofficialJournalOfIcelandType
field.Verification successful
The
TYPE_QUERY
definition inlibs/application/templates/official-journal-of-iceland/src/graphql/queries.ts
matches the expected schema structure used in theuseQuery
hook. TheofficialJournalOfIcelandType
field contains a nestedtype
field with thetitle
property.
libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts
:export const TYPE_QUERY = gql` query AdvertType($params: OfficialJournalOfIcelandAdvertSingleParams!) { officialJournalOfIcelandType(params: $params) { type { id title slug department { id title slug } } } } `Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the data structure returned by `TYPE_QUERY`. ast-grep --lang typescript --pattern $'query TYPE_QUERY { $$$ officialJournalOfIcelandType { type { title } } }'Length of output: 648
Script:
#!/bin/bash # Description: Verify the data structure returned by `TYPE_QUERY`. ast-grep --lang graphql --pattern $'{ officialJournalOfIcelandType { type { title } } }'Length of output: 222
Script:
#!/bin/bash # Description: Locate the definition of `TYPE_QUERY` and verify its structure. rg 'TYPE_QUERY' --glob '*.graphql' --glob '*.ts' --glob '*.tsx'Length of output: 700
Script:
#!/bin/bash # Description: Display the contents of the file containing the `TYPE_QUERY` definition. cat libs/application/templates/official-journal-of-iceland/src/graphql/queries.tsLength of output: 3775
66-66
: Confirm that thetype
variable is being used correctly within theHTMLEditor
component and that it aligns with the expected data types and structure.libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts (3)
61-65
: Check that thetype
method is correctly implemented and matches the service method it calls.Verification successful
The
type
method in theOfficialJournalOfIcelandResolver
correctly calls thetype
method in theOfficialJournalOfIcelandService
, which in turn calls thetype
method in theOfficialJournalOfIcelandClientService
. This chain of method calls appears to be correctly implemented.
OfficialJournalOfIcelandResolver
callsthis.ojoiService.type(params)
.OfficialJournalOfIcelandService
callsthis.ojoiService.type(params)
.No issues were found with the implementation of the
type
method in the resolver or the service.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the `type` method in the resolver. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandResolver { $$$ type($_) { return this.ojoiService.type($_) } $$$ }'Length of output: 8314
Script:
#!/bin/bash # Description: Verify the `type` method in the OfficialJournalOfIcelandService. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandService { $$$ type($_) { $$$ } $$$ }'Length of output: 7956
Tools
Biome
[error] 63-63: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
35-35
: Ensure that theadvert
method correctly handles theAdvertSingleParams
and aligns with the service method it calls.Verification successful
The
advert
method in theOfficialJournalOfIcelandService
class was located and it appears to handle theAdvertSingleParams
correctly. Here are the relevant lines from the search results:
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts: async advert(params: AdvertSingleParams): Promise<AdvertResponse> {
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts: const { advert } = await this.ojoiService.advert(params)
This confirms that the
advert
method in the resolver correctly calls the service method and handles theAdvertSingleParams
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the `advert` method in the resolver. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandResolver { $$$ advert($_) { return this.ojoiService.advert($_) } $$$ }'Length of output: 8318
Script:
#!/bin/bash # Description: Locate and review the `advert` method in the `OfficialJournalOfIcelandService` class. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandService { $$$ advert($_) { $$$ } $$$ }'Length of output: 121
Script:
#!/bin/bash # Description: Search for the `advert` method across all TypeScript files. rg 'advert' --type tsLength of output: 32763
Tools
Biome
[error] 35-35: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
7-21
: Confirm that all newly imported models are used correctly in the resolver methods and match the expected GraphQL schema.Verification successful
The newly imported models are correctly used in the resolver methods:
AdvertSingleParams
is used in theadvert
anddepartment
methods.AdvertsInput
is used in theadverts
method.AdvertResponse
,AdvertsResponse
, andAdvertDepartmentResponse
are used as return types for the respective methods.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of new models in resolver methods. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandResolver { $$$ @Query($_) { $$$ } $$$ }'Length of output: 626
Script:
#!/bin/bash # Description: Verify the usage of new models in resolver methods. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandResolver { @Query($_) { $$$ } }'Length of output: 602
Script:
#!/bin/bash # Description: Verify the usage of new models in resolver methods. ast-grep --lang typescript --pattern $'class OfficialJournalOfIcelandResolver { $_($_) { $$$ } }'Length of output: 106
Script:
#!/bin/bash # Description: Search for the OfficialJournalOfIcelandResolver class and its methods. rg 'class OfficialJournalOfIcelandResolver' -A 20Length of output: 2590
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts (2)
20-22
: Confirm that thepageSize
field is correctly added to theAdvertsInput
class and is used appropriately in queries.Verification successful
The
pageSize
field is correctly added to theAdvertsInput
class in theadvert.input.ts
file. Additionally, thepageSize
field is used in various parts of the codebase, including GraphQL queries and other TypeScript files.
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts
: ThepageSize
field is defined within theAdvertsInput
class.- Multiple instances of
pageSize
usage across the codebase, confirming its integration.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `pageSize` in GraphQL queries. ast-grep --lang typescript --pattern $'class AdvertsInput { $$$ pageSize: $_, $$$ }'Length of output: 91
Script:
#!/bin/bash # Locate the AdvertsInput class definition ast-grep --lang typescript --pattern 'class AdvertsInput { $$$ }' # Verify the presence of the pageSize field within the AdvertsInput class ast-grep --lang typescript --pattern 'class AdvertsInput { $$$ pageSize?: number $$$ }' # Search for the usage of the pageSize field in GraphQL queries rg 'pageSize' --type tsLength of output: 23419
Line range hint
54-69
: Ensure that the newAdvertSingleParams
class and the updatedQueryParams
class are correctly defined and used in GraphQL queries.Verification successful
The
AdvertSingleParams
andQueryParams
classes are correctly defined and used in the codebase. Here are the relevant locations:
AdvertSingleParams
class:
- Definition:
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts
libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts
- Usage:
libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts
apps/web/screens/queries/OfficialJournalOfIceland.ts
QueryParams
class:
- Definition:
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts
- Usage:
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.service.ts
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts
The classes are correctly defined and used in the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new `AdvertSingleParams` class and the updated `QueryParams` class. ast-grep --lang typescript --pattern $'@InputType($_) { $$$ class AdvertSingleParams { $$$ } $$$ class QueryParams { $$$ } $$$ }'Length of output: 686
Script:
#!/bin/bash # Verify the presence and definition of the AdvertSingleParams class ast-grep --lang typescript --pattern $'@InputType($_) class AdvertSingleParams { $$$ }' # Verify the presence and definition of the QueryParams class ast-grep --lang typescript --pattern $'@InputType($_) class QueryParams { $$$ }'Length of output: 170
Script:
#!/bin/bash # Search for the definition of the AdvertSingleParams class rg 'class AdvertSingleParams' --typescript # Search for the definition of the QueryParams class rg 'class QueryParams' --typescript # Search for the usage of AdvertSingleParams in GraphQL queries rg 'AdvertSingleParams' --typescript # Search for the usage of QueryParams in GraphQL queries rg 'QueryParams' --typescriptLength of output: 1897
Script:
#!/bin/bash # Search for the definition of the AdvertSingleParams class rg 'class AdvertSingleParams' --type ts # Search for the definition of the QueryParams class rg 'class QueryParams' --type ts # Search for the usage of AdvertSingleParams in GraphQL queries rg 'AdvertSingleParams' --type ts # Search for the usage of QueryParams in GraphQL queries rg 'QueryParams' --type tsLength of output: 13090
apps/web/screens/queries/OfficialJournalOfIceland.ts (1)
40-40
: Ensure that theADVERT_QUERY
is correctly updated to use theOfficialJournalOfIcelandAdvertSingleParams
and matches the expected GraphQL schema.Verification successful
The
OfficialJournalOfIcelandAdvertSingleParams
input type is correctly defined in the GraphQL schema filessingle.input.ts
andadvert.input.ts
. TheADVERT_QUERY
inOfficialJournalOfIceland.ts
is correctly using this input type.
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts
libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of `ADVERT_QUERY` in the GraphQL queries file. cat apps/web/screens/queries/OfficialJournalOfIceland.ts | grep -A 20 "export const ADVERT_QUERY"Length of output: 545
Script:
#!/bin/bash # Description: Verify the definition of `OfficialJournalOfIcelandAdvertSingleParams` in the GraphQL schema files. rg "OfficialJournalOfIcelandAdvertSingleParams" --type graphqlLength of output: 94
Script:
#!/bin/bash # Description: Verify the definition of `OfficialJournalOfIcelandAdvertSingleParams` in the GraphQL schema files. rg "OfficialJournalOfIcelandAdvertSingleParams"Length of output: 898
Script:
#!/bin/bash # Description: Display the definition of `OfficialJournalOfIcelandAdvertSingleParams` in `single.input.ts` and `advert.input.ts`. rg --context 10 "@InputType('OfficialJournalOfIcelandAdvertSingleParams')" libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.tsLength of output: 234
Script:
#!/bin/bash # Description: Display the definition of `OfficialJournalOfIcelandAdvertSingleParams` in `single.input.ts` and `advert.input.ts`. rg "@InputType('OfficialJournalOfIcelandAdvertSingleParams')" libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.tsLength of output: 221
Script:
#!/bin/bash # Description: Display the definition of `OfficialJournalOfIcelandAdvertSingleParams` in `single.input.ts` and `advert.input.ts`. rg "OfficialJournalOfIcelandAdvertSingleParams" libs/api/domains/official-journal-of-iceland/src/lib/models/single.input.ts libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.tsLength of output: 465
libs/application/templates/official-journal-of-iceland/src/graphql/queries.ts (2)
60-60
: Update GraphQL query parameter type to match new input model.The change from
OfficialJournalOfIcelandAdvertQuery
toOfficialJournalOfIcelandAdvertSingleParams
aligns with the updated GraphQL schema and input model requirements.
133-160
: Add new GraphQL queries for department and type.The addition of
DEPARTMENT_QUERY
andTYPE_QUERY
with the newOfficialJournalOfIcelandAdvertSingleParams
parameter type is consistent with the changes in the data model and will support more granular data fetching.libs/application/templates/official-journal-of-iceland/src/fields/AdvertModal.tsx (3)
7-7
: Add pagination to the advert modal.The inclusion of the
Pagination
component enhances UX by allowing users to navigate through large sets of data efficiently.
Line range hint
38-50
: Implement state management for pagination and search.The use of
useState
for managingpage
andsearch
states, along with the debounced search function, provides a responsive and efficient user interaction in the advert modal.
113-129
: Integrate pagination component into the UI.The integration of the
Pagination
component within the modal's UI allows for a seamless and intuitive navigation experience for the end-users.libs/application/templates/official-journal-of-iceland/src/lib/dataSchema.ts (2)
31-34
: Make fields optional in the advert schema.Changing these fields to optional in the
advert
schema aligns with the requirements to make the application more flexible and user-friendly by reducing the number of mandatory fields.
180-186
: Update publishing schema to make fields optional.The modifications to make
date
andcontentCategories
optional in thepublishing
schema are appropriate, providing flexibility in data entry and aligning with the less stringent data collection requirements.libs/application/templates/official-journal-of-iceland/src/fields/Publishing.tsx (3)
59-67
: Implement logic to calculate the minimum and default dates.The logic to set
minDate
anddefaultDate
based on current time and predefined business rules (like adding weekdays) is a good practice for ensuring data validity and enhancing user experience.
93-93
: Set a large page size for category fetching.Setting a large
pageSize
for fetching categories ensures that all possible categories are retrieved in a single query, reducing the need for pagination and simplifying the UI logic.
197-197
: Set default values and constraints for the date picker.Configuring the
DatePickerController
with default values and constraints such asminDate
andmaxDate
ensures that the user input is valid and within the expected range.libs/application/templates/official-journal-of-iceland/src/fields/Advert.tsx (7)
25-25
: Import statement for styles added.This change is straightforward and necessary for applying the new styles.
45-53
: Refactored thedepartments
array to exclude departments with the slug 'tolublod'.This change effectively filters out unwanted departments, improving the data quality presented to the user.
109-116
: Added anonCompleted
callback to the GraphQL query to update the types state.This is a good use of the
onCompleted
callback to ensure state is updated only after the query completes successfully.
Line range hint
173-190
: Enhanced the department selection UI with new styling and logic to reset the type when a new department is selected.This change improves user experience by ensuring that irrelevant types are cleared when the department changes.
197-205
: Conditional rendering added for loading state in the type selection UI.Proper handling of loading states enhances user experience by providing feedback during data fetching.
Line range hint
241-261
: Added a new input field for the advertisement template with dynamic updating.This addition allows users to specify a template for the advertisement, enhancing the flexibility of the advertisement creation process.
261-261
: Integration of theHTMLEditor
component for the document field.This integration allows for rich text editing of the document field, which is a significant usability improvement.
libs/application/templates/official-journal-of-iceland/src/components/signatures/Regular.tsx (2)
155-192
: Updated UI components for institution and date inputs with improved styling and error handling.These changes enhance the clarity and usability of the form inputs, aligning with the overall design improvements.
Line range hint
226-271
: Enhanced member input handling with new UI components and error management.The updates provide a more robust and user-friendly interface for managing signature details, improving error visibility and interaction.
libs/api/domains/official-journal-of-iceland/src/lib/officialJournalOfIceland.resolver.ts
Show resolved
Hide resolved
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/application/templates/official-journal-of-iceland/src/components/signatures/Regular.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/application/templates/official-journal-of-iceland/src/components/signatures/Regular.tsx
@coderabbitai resolve |
Actions performedComments resolved and changes approved. |
libs/api/domains/official-journal-of-iceland/src/lib/models/advert.input.ts
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 9 Total Test Services: 0 Failed, 9 Passed Test Services
🔻 Code Coverage Decreases vs Default Branch (1)
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15130 +/- ##
==========================================
+ Coverage 37.06% 37.08% +0.02%
==========================================
Files 6422 6420 -2
Lines 130903 130728 -175
Branches 37406 37331 -75
==========================================
- Hits 48515 48487 -28
+ Misses 82388 82241 -147
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 28 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
* Fixing UI bugs * Updating client - adding single department and type * Fixing rest of the ubgs * Fixing position on inputs --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Fixing UI bugs * Updating client - adding single department and type * Fixing rest of the ubgs * Fixing position on inputs --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
What
Why
For better UX
Checklist:
Summary by CodeRabbit
New Features
AdvertModal
component for better navigation through adverts.Bug Fixes
Signatures
andHTMLEditor
components.Improvements
RegularSignature
component layout for better user experience.