bcgov / cas-cif

CleanBC Industry Fund project
Apache License 2.0
6 stars 2 forks source link

As a CIF user, I want to see the differences between array-type fields, so that I know that I made the right modifications #1182

Open pbastia opened 1 year ago

pbastia commented 1 year ago

Description:

Additional funding sources and anticipated funding per fiscal year are handled as an array, which our current diff logic can't currently display. To Do: figure out how to handle that, and implement it. We don't have an ArrayField yet in CustomDiffFields so that may be the first step

Acceptance Criteria:

Given I am a CIF user When I create or edit a revision and add a field that uses an array-type display Then I can see the diff on the summary page (app/pages/cif/project-revision/[projectRevision]/edit.tsx)

Given I am a CIF user When I create or edit a revision and change a field that uses an array-type display Then I can see the diff on the summary page (app/pages/cif/project-revision/[projectRevision]/edit.tsx)

Given I am a CIF user When I create or edit a revision and delete a field that uses an array-type display Then I can see the diff on the summary page (app/pages/cif/project-revision/[projectRevision]/edit.tsx)

Given I am a CIF user When I view a revision Then I can see the revision's diff on the summary page (app/pages/cif/project-revision/[projectRevision]/view.tsx)

Development Checklist:

Definition of Ready (Note: If any of these points are not applicable, mark N/A)

·Definition of Done (Note: If any of these points are not applicable, mark N/A)

Notes:

-

Sepehr-Sobhani commented 1 year ago

I think by tackling this card, we address this tech debt: https://app.zenhub.com/workspaces/climate-action-secretariat-60ca4121764d710011481ca2/issues/gh/bcgov/cas-cif/1536

BCerki commented 1 year ago

Hey team! Please add your planning poker estimate with Zenhub @dleard @gurjmatharu @JoshLarouche @mikevespi @pbastia @sam-warren @Sepehr-Sobhani @tmastrom

pbastia commented 1 year ago

Do we actually need item-by-item diff? Or should we show just both versions of the array

["funding 1","funding 2"] => ["funding 1","funding 3"]

This would be much simpler

mikevespi commented 1 year ago

I agree Pierre, I think showing old -> new makes sense and reduces the effort quite a bit

BCerki commented 1 year ago

Could try starting with JSON.stringify(newData, oldData, etc.) and use the existing string diff functions