go-frontend icon indicating copy to clipboard operation
go-frontend copied to clipboard

Remove hardcoded enum values from the frontend

Open frozenhelium opened this issue 4 years ago • 4 comments

Problem

Currently we have to maintain the enum values such as Disaster types, Organization types, ERU types, etc, in both frontend and backend. We should only have one source of truth and one place to maintain such values. eg: for translation

Solution

We should fetch all of these enums from the server in the initialization phase.

The hardcoded enum values are defined in the following files

frozenhelium avatar Aug 17 '20 13:08 frozenhelium

I think this is a duplicate of https://github.com/IFRCGo/go-frontend/issues/940 can you please check and confirm? @batpad maybe you have advice on best way to split the tickets if needed!

Noting that there are also several other separate tickets about specific enums (e.g. geospatial related ones) that have been (or are in) the process of being addressed

nanometrenat avatar Aug 17 '20 13:08 nanometrenat

Depends on: https://github.com/IFRCGo/go-api/issues/889

frozenhelium avatar Sep 10 '20 11:09 frozenhelium

@nanometrenat It's similar to the issue you mentioned above, but not exactly, https://github.com/IFRCGo/go-frontend/issues/940 is about the model fields and this issue is specifically about the ENUM / constant fields

frozenhelium avatar Sep 10 '20 11:09 frozenhelium

@frozenhelium @batpad @tovari did this get addressed in the GO rewrite or is it still an open thing for build? Cheers

nanometrenat avatar Feb 19 '24 18:02 nanometrenat