Здравствуйте! Возможно ли использование во Frontend UI сущностей с ID, тип которого отличается от uuid (например, целочисленный или строковый)? Получаю ошибку при компиляции модуля “front” (React), если добавил в него компоненты для таких сущностей. Если тип ID - uuid, то код, сформированный генератором, собирается нормально.
Порядок действий следующий:
Создаю сущность Vehicle c целочисленным ID
Добавляю модуль “front” (React)
Создаю через конструктор новый Front Component
При запуске проекта получаю ошибку:
> react-scripts build
Creating an optimized production build...
Failed to compile.
/opt/cbtest/modules/front/src/app/vehicle/VehicleEdit.tsx
TypeScript error in /opt/cbtest/modules/front/src/app/vehicle/VehicleEdit.tsx(173,33):
Argument of type 'Vehicle' is not assignable to parameter of type 'Vehicle & Partial<SerializedEntityProps> & { id?: string | undefined; }'.
Type 'Vehicle' is not assignable to type '{ id?: string | undefined; }'.
Types of property 'id' are incompatible.
Type 'number | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'. TS2345
171 | this.dataInstance.load(this.props.entityId);
172 | } else {
> 173 | this.dataInstance.setItem(new Vehicle());
| ^
174 | }
175 | this.reactionDisposer = reaction(
176 | () => {
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cbtest@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cbtest@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ulanov/.npm/_logs/2020-02-19T09_43_14_985Z-debug.log
> Task :app-front:buildFrontend FAILED
Всё указывает на то, что класс DataInstanceStore (Instance.d.ts) не поддерживает работу с нестроковыми Id:
export declare class DataInstanceStore<T> implements DataContainer {
private mainStore;
readonly entityName: string;
item?: T & Partial<SerializedEntityProps> & { id?: string; };
...
Подскажите будет ли поддержка генератором других типов ID?
Версия платформы 7.1.4