-
Notifications
You must be signed in to change notification settings - Fork 311
Script to compare backend models field vs it's corresponding frontend type fields. #1194
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for the pull request! ❤️The activist team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the |
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)
|
@andrewtavis Hello, The work here is incomplete I am quite busy nowadays due to school work, I will keep working on this PR here and inform you when it's ready to review 😊 |
Sounds good, @Abhi-Bohora! Looking forward to bringing this in, and thanks so much for your efforts on these features that improve the dev experience so much 😊 |
✅ Deploy Preview for activist-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Merging in main to fix the frontend workflow, @Abhi-Bohora :) |
@andrewtavis hello Andrew...👋 Soon, I will give you an update on this. Sorry, I've been busy lately. |
No worries on it, @Abhi-Bohora :) Thanks for letting me know though! |
Hello @andrewtavis 👋, I have created a script locally and ran against model and it's corresponding type, between backend/communities/organizations/models.py and frontend/types/communities/organization.d.ts and I get this as the output Missing TypeScript fields found:
Field 'is_high_risk' (camelCase: 'isHighRisk') from model 'Organization' is missing in TypeScript types
Field 'terms_checked' (camelCase: 'termsChecked') from model 'Organization' is missing in TypeScript types
Field 'faqs' (camelCase: 'faqs') from model 'Organization' is missing in TypeScript types
No matching TypeScript interface found for model: OrganizationApplication
No matching TypeScript interface found for model: OrganizationApplicationStatus
Field 'image' (camelCase: 'image') from model 'OrganizationImage' is missing in TypeScript types
Field 'org' (camelCase: 'org') from model 'OrganizationImage' is missing in TypeScript types
Field 'user' (camelCase: 'user') from model 'OrganizationMember' is missing in TypeScript types
Field 'org' (camelCase: 'org') from model 'OrganizationMember' is missing in TypeScript types
Field 'org' (camelCase: 'org') from model 'OrganizationSocialLink' is missing in TypeScript types
No matching TypeScript interface found for model: OrganizationTask
Field 'org' (camelCase: 'org') from model 'OrganizationText' is missing in TypeScript types
Field 'donate_prompt' (camelCase: 'donatePrompt') from model 'OrganizationText' is missing in TypeScript types can you please take a look and confirm is this what we are looking for ? |
This is really nice, @Abhi-Bohora! Please send along the changes and we'll take a look 😊 |
Hey @Abhi-Bohora 👋 Checking in here really quick to see what the status is here :) From what you sent along I think we'd be ready for your local changes and then can finalize from there. Please let us know if there's something we can do to support! 😊 |
sorry @andrewtavis this has taken this long, I have been quite busy with my work, I didn't get much time to sit and code, I have been doing this portion by portion in free time. Tomorrow I will raise a send a latest change to this and than we can review...😊 |
Sounds perfect, @Abhi-Bohora! And no stress on the timing 😊 Really gonna be great to get this in :) :) |
Contributor checklist
Description
This script compares the backend models fields against it's corresponding frontend type fields and reports the fields that are missing.
we can run this script by executing for example comparing
communities/organizations/models.py
againsttypes/communities/organization.d.ts
:the above command gives the following output which is shown below, which shows which fields are missing from the type file.
the model fields are converted to camelCase and than compared to fileds of type file, which is shown in the bracket(camelCase: 'fieldName').
Related issue