data-to-insight / csc-validator-be-903

Python-side code for the Quality LAC Data Beta frontend
https://903.datatoinsight.org
MIT License
8 stars 4 forks source link

Update default year in validator (FE and backend tests) #769

Closed SLornieCYC closed 4 months ago

SLornieCYC commented 4 months ago

Currently the tool, both in the FE application (__main__.py ?) and the backend tests (e.g. test_get_year_ruleset()), defaults to 2022/23 rules. This is probably overdue for updating to 2023/24.

SLornieCYC commented 4 months ago

Looking at the FE repository I assume it's this line that would need changing over there to set the dropdown default?

image

https://github.com/data-to-insight/csc-validator-fe/blob/58e4a005cae002253b717db99750ba13fc7d20c3/src/pages/loadData/LoadData.tsx#L60C3-L60C72

WillLP-code commented 4 months ago

Looking at the FE repository I assume it's this line that would need changing over there to set the dropdown default?

image

https://github.com/data-to-insight/csc-validator-fe/blob/58e4a005cae002253b717db99750ba13fc7d20c3/src/pages/loadData/LoadData.tsx#L60C3-L60C72

I haven't used react before, which I think is the framework this is written in, so I'll have a bit of a dig and see what comes up, but I'm guessing you're right!

SLornieCYC commented 4 months ago

Re-opening this as a reminder to sort the FE default value too (and dropdown option for next year!).

WillLP-code commented 4 months ago

Judging my rpc_main, the API, this code gets the collection year: @app.call def get_rules(collection_year: str) -> str: """ :param str ruleset: validation year e.g "2023" for 2022/2023 validation rules. :return rules_df: available rule codes and definitions according to chosen ruleset. """ ruleset_registry = get_year_ruleset(collection_year)

So, having looked at the other file you linked, it looks like you're right for changing the default in the FE. I'm just trying to work out how I can change the list of available collection years in the 903 to include a 2022/23 as well!

SLornieCYC commented 4 months ago

I think the list of available years exists in the separate files for CIN and 903:

https://github.com/data-to-insight/csc-validator-fe/blob/58e4a005cae002253b717db99750ba13fc7d20c3/src/pages/loadData/LoadDataCIN.tsx#L203-L204

https://github.com/data-to-insight/csc-validator-fe/blob/58e4a005cae002253b717db99750ba13fc7d20c3/src/pages/loadData/LoadData903.tsx#L344-L345

WillLP-code commented 4 months ago

Closing this because of linked PR in FE repo:

PR

SLornieCYC commented 4 months ago

Closing this because of linked PR in FE repo:

PR

I don't think the deployed 903 tool updated after that PR. The CIN one has updated fine but I think somewhere the git action to daily-chain it through to the dummy 903 FE repo broke.

WillLP-code commented 4 months ago

Closing this because of linked PR in FE repo: PR

I don't think the deployed 903 tool updated after that PR. The CIN one has updated fine but I think somewhere the git action to daily-chain it through to the dummy 903 FE repo broke.

I noticed this, I was going to push the update on the back-end later (after the D2I open house) and if that doesn't sort it, I'll have another look!