Closed tai271828 closed 2 years ago
Is the FE dropped-down list defined in somewhere?
$ grep 人熊衝突 -r ./src/
./src/types.ts: { value: '3', text: '人熊衝突現場痕跡 - 雞舍' },
./src/types.ts: { value: '4', text: '人熊衝突現場痕跡 - 果園' },
./src/types.ts: { value: '5', text: '人熊衝突現場痕跡 - 其他' },
By the way for backend
$ grep 焊接 -r ./
./api/migrations/0008_change_factory_status.py: field=models.CharField(blank=True, choices=[('2-1', '沖床
、銑床、車床、鏜孔'), ('2-2', '焊接、鑄造、熱處理'), ('2-3', '金屬表面處理、噴漆'), ('3', '塑膠加工、射出'), ('4', '
橡膠加工'), ('5', '非金屬礦物(石材)'), ('6', '食品'), ('7', '皮革'), ('8', '紡織'), ('9', '其他')], max_length=3, null=True),
./api/migrations/0001_initial.py: ('factory_type', models.CharField(choices=[('1', '金屬'), ('2-1', '
沖床、銑床、車床、鏜孔'), ('2-2', '焊接、鑄造、熱處理'), ('2-3', '金屬表面處理、噴漆'), ('3', '塑膠加工、射出'), ('4', '橡膠加工'), ('5', '非金屬礦物(石材)'), ('6', '食品'), ('7', '皮革'), ('8', '紡織'), ('9', '其他')], default='9', max_length=3)),
./api/models/factory.py: ("2-2", "焊接、鑄造、熱處理"),
$ grep 人熊衝突 -r ./src/ ./src/types.ts: { value: '3', text: '人熊衝突現場痕跡 - 雞舍' }, ./src/types.ts: { value: '4', text: '人熊衝突現場痕跡 - 果園' }, ./src/types.ts: { value: '5', text: '人熊衝突現場痕跡 - 其他' },
This conversation may be useful as well https://github.com/tai271828/disfactory-frontend/pull/14/files#r760667936 .
The string is a part of REPORT_TYPE
, which will be an attribute of formState
. The data structure of fromState
should be what you want to know. Check the link of the conversation for more details : )
By the way for backend
$ grep 焊接 -r ./ ./api/migrations/0008_change_factory_status.py: field=models.CharField(blank=True, choices=[('2-1', '沖床 、銑床、車床、鏜孔'), ('2-2', '焊接、鑄造、熱處理'), ('2-3', '金屬表面處理、噴漆'), ('3', '塑膠加工、射出'), ('4', ' 橡膠加工'), ('5', '非金屬礦物(石材)'), ('6', '食品'), ('7', '皮革'), ('8', '紡織'), ('9', '其他')], max_length=3, null=True), ./api/migrations/0001_initial.py: ('factory_type', models.CharField(choices=[('1', '金屬'), ('2-1', ' 沖床、銑床、車床、鏜孔'), ('2-2', '焊接、鑄造、熱處理'), ('2-3', '金屬表面處理、噴漆'), ('3', '塑膠加工、射出'), ('4', '橡膠加工'), ('5', '非金屬礦物(石材)'), ('6', '食品'), ('7', '皮革'), ('8', '紡織'), ('9', '其他')], default='9', max_length=3)), ./api/models/factory.py: ("2-2", "焊接、鑄造、熱處理"),
Thanks @tai271828 ! Maybe we could define the resource in the BE, and the BE can provide an API endpoint for the FE to get the resource list.
Per discussion today in the regular meetup: Eagle will try to modularize the drop-down list object and evaluate if it is small enough for refactoring. If it is too big for alpha version refactoring, we will think about the other approach.
Aligned with @Neilxx and @diaoga today. Verified with the development site.
The current string element of
Ohshown event type
looks like this:and it is not aligned with the string element in the frontend draw-down list:
We have to aligned them.