Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Feat: Add report table ,edit table and create report - #5

Open
roshni73 wants to merge 13 commits into
developfrom
feature/Add-Reports
Open

roshni73 wants to merge 13 commits into
developfrom
feature/Add-Reports

Conversation

@roshni73

@roshni73 roshni73 commented Jun 9, 2025

Copy link
Copy Markdown

Addresses:

Changes

  • Add Report Table ,Report Modal for add and update the reports
  • Add Archive Mutation to archive the reports
  • Add FileInput component and RawFileInput Component

This PR doesn't introduce:

  • typos
  • conflict markers
  • unwanted comments
  • temporary files, auto-generated files or secret keys
  • console.log meant for debugging
  • codegen errors

@roshni73 roshni73 changed the title Feature/add reports Feat: Add report table ,edit table and create report Jun 27, 2025
@roshni73
roshni73 requested a review from AdityaKhatri July 3, 2025 08:31
Comment thread codegen.ts
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema: process.env.APP_GRAPHQL_CODEGEN_ENDPOINT,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should not be changed.

onClose: () => void;
title: string;
initialValues?: Partial<UpdateReportInput & { id: string }>;
reportsRefetch: () => void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This naming convention is opposite of what we want. So, basically, this is called when the report is created or updated right? If that is the case then, the function should be called, onReportUpdate. ani outside you do the fetching separately. Please update it in other parts as well.

UPDATE_REPORT,
{
onCompleted: (response) => {
const updateReport = response.updateReport as ReportTypeMutationResponseType;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need to cast here. Fix it properly.

CREATE_REPORT,
{
onCompleted: (response) => {
const createReport = response.createReport as ReportTypeMutationResponseType;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no casting here too

Comment on lines +309 to +314
value={imageFile}
accept="image/*"
onChange={(file, name) => {
setFieldValue(file, name);
setImageFile(file || null);
}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we use the value directly as opposed to saving it in the state as well?

Comment on lines +341 to +347
value={reportFile}
accept=".pdf, .doc, .docx, .txt, .xlsx"
onChange={(file, name) => {
setFieldValue(file, name);
setReportFilePreview(file || null);
}}
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

@roshni73
roshni73 force-pushed the feature/Add-Reports branch from 42f9c02 to 8083d3d Compare July 15, 2025 08:37
@roshni73
roshni73 requested a review from AdityaKhatri July 15, 2025 08:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants