Merged PR 162: Implement symbols and other stuff (see desc)

Implement symbols
- Add, Remove, Select Container
- Form
- Link with container
- Symbol behavior application to container (move to x with xpositionreference)

Important changes
- Remove SelectedContainer from HistoryState, meaning that it will be slower for each load but will be faster for each operations* (SetHistory, SelectContainer, DeleteContainer, SymbolOperations)
- ElementsSidebar now opens with isSidebarOpen meaning that both sidebar will open on toggle
- Moved camelize, transformX, restoreX to different modules (stringtools.ts, svg.ts)
This commit is contained in:
Eric Nguyen 2022-08-22 13:58:32 +00:00
parent 58ef28fe89
commit 8b8d88f885
48 changed files with 1453 additions and 188 deletions

View file

@ -2,7 +2,7 @@ import { fireEvent, render, screen } from '@testing-library/react';
import * as React from 'react';
import { expect, describe, it, vi } from 'vitest';
import { XPositionReference } from '../../Enums/XPositionReference';
import IProperties from '../../Interfaces/IProperties';
import IContainerProperties from '../../Interfaces/IContainerProperties';
import { Properties } from './Properties';
describe.concurrent('Properties', () => {
@ -11,6 +11,7 @@ describe.concurrent('Properties', () => {
properties={undefined}
onChange={() => {}}
onSubmit={() => {}}
symbols={new Map()}
/>);
expect(screen.queryByText('id')).toBeNull();
@ -20,9 +21,10 @@ describe.concurrent('Properties', () => {
});
it('Some properties, change values with dynamic input', () => {
const prop: IProperties = {
const prop: IContainerProperties = {
id: 'stuff',
parentId: 'parentId',
linkedSymbolId: '',
displayedText: 'stuff',
x: 1,
y: 1,
@ -42,6 +44,7 @@ describe.concurrent('Properties', () => {
properties={prop}
onChange={handleChange}
onSubmit={() => {}}
symbols={new Map()}
/>);
expect(screen.queryByText('id')).toBeDefined();
@ -76,6 +79,7 @@ describe.concurrent('Properties', () => {
properties={Object.assign({}, prop)}
onChange={handleChange}
onSubmit={() => {}}
symbols={new Map()}
/>);
propertyId = container.querySelector('#id');