Rename interfaces
This commit is contained in:
parent
58ec891db3
commit
d9822fdabc
11 changed files with 33 additions and 67 deletions
14
src/App.tsx
14
src/App.tsx
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import './App.scss';
|
||||
import Sidebar from './Components/Sidebar/Sidebar';
|
||||
import { IAvailableContainerModel } from './Interfaces/IAvailableContainerModel';
|
||||
import { IConfigurationResponseModel } from './Interfaces/IConfigurationResponseModel';
|
||||
import { AvailableContainer } from './Interfaces/AvailableContainer';
|
||||
import { Configuration } from './Interfaces/Configuration';
|
||||
import { SVG } from './SVG/SVG';
|
||||
|
||||
interface IAppProps {
|
||||
|
@ -10,7 +10,7 @@ interface IAppProps {
|
|||
|
||||
interface IAppState {
|
||||
isSidebarOpen: boolean,
|
||||
configuration: IConfigurationResponseModel
|
||||
configuration: Configuration
|
||||
}
|
||||
|
||||
class App extends React.Component<IAppProps> {
|
||||
|
@ -23,13 +23,13 @@ class App extends React.Component<IAppProps> {
|
|||
configuration: {
|
||||
AvailableContainers: [],
|
||||
AvailableSymbols: [],
|
||||
MainContainer: {} as IAvailableContainerModel
|
||||
MainContainer: {} as AvailableContainer
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetchConfiguration().then((configuration: IConfigurationResponseModel) => {
|
||||
fetchConfiguration().then((configuration: Configuration) => {
|
||||
this.setState({
|
||||
isSidebarOpen: this.state.isSidebarOpen,
|
||||
configuration
|
||||
|
@ -55,7 +55,7 @@ class App extends React.Component<IAppProps> {
|
|||
}
|
||||
}
|
||||
|
||||
async function fetchConfiguration(): Promise<IConfigurationResponseModel> {
|
||||
async function fetchConfiguration(): Promise<Configuration> {
|
||||
const url = `${import.meta.env.VITE_API_URL}`;
|
||||
const myHeaders = new Headers({
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -69,7 +69,7 @@ async function fetchConfiguration(): Promise<IConfigurationResponseModel> {
|
|||
return await fetch(url, myInit)
|
||||
.then((response) =>
|
||||
response.json()
|
||||
) as IConfigurationResponseModel;
|
||||
) as Configuration;
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import { IAvailableContainerModel } from '../../Interfaces/IAvailableContainerModel';
|
||||
import { AvailableContainer } from '../../Interfaces/AvailableContainer';
|
||||
|
||||
interface ISidebarProps {
|
||||
componentOptions: IAvailableContainerModel[]
|
||||
componentOptions: AvailableContainer[]
|
||||
isOpen: boolean;
|
||||
onClick: () => void;
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
import { AddingBehavior } from '../Enums/AddingBehavior';
|
||||
import { IImageModel } from './IImageModel';
|
||||
|
||||
export interface IActionContainerModel {
|
||||
Id: string
|
||||
CustomLogo: IImageModel
|
||||
Label: string
|
||||
Description: string
|
||||
Action: string
|
||||
AddingBehavior: AddingBehavior
|
||||
}
|
9
src/Interfaces/AvailableContainer.ts
Normal file
9
src/Interfaces/AvailableContainer.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
/** Model of available container used in application configuration */
|
||||
export interface AvailableContainer {
|
||||
Type: string
|
||||
Width: number
|
||||
Height: number
|
||||
Style: React.CSSProperties
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
import { XPositionReference } from '../Enums/XPositionReference';
|
||||
import { IImageModel } from './IImageModel';
|
||||
import { Image } from './Image';
|
||||
|
||||
/**
|
||||
* Model of available symbol to configure the application */
|
||||
export interface IAvailableSymbolModel {
|
||||
export interface AvailableSymbolModel {
|
||||
Name: string
|
||||
XPositionReference: XPositionReference
|
||||
Image: IImageModel
|
||||
Image: Image
|
||||
Width: number
|
||||
Height: number
|
||||
}
|
9
src/Interfaces/Configuration.ts
Normal file
9
src/Interfaces/Configuration.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { AvailableContainer } from './AvailableContainer';
|
||||
import { AvailableSymbolModel } from './AvailableSymbol';
|
||||
|
||||
/** Model of configuration for the application to configure it */
|
||||
export interface Configuration {
|
||||
AvailableContainers: AvailableContainer[];
|
||||
AvailableSymbols: AvailableSymbolModel[];
|
||||
MainContainer: AvailableContainer;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
import { IActionContainerModel } from './ActionContainerModel'
|
||||
import { IAvailableDefaultContainerModel } from './IAvailableDefaultContainerModel'
|
||||
|
||||
/** Model of available container used in application configuration */
|
||||
export interface IAvailableContainerModel {
|
||||
Type: string
|
||||
BodyColor: string
|
||||
BorderColor: string
|
||||
BorderWidth: number
|
||||
Width: number
|
||||
Height: number
|
||||
Padding: number
|
||||
MinWidth: number
|
||||
MaxWidth: number
|
||||
MinHeight: number
|
||||
MaxHeight: number
|
||||
IsWidthFixed: boolean
|
||||
IsPositionFixed: boolean
|
||||
|
||||
ShowCotation: boolean
|
||||
|
||||
/** Default Type container to add with this container (Priority on DefaultChildrenContainers property) */
|
||||
TypeChildContainerDefault: string
|
||||
|
||||
/** Default children container to add with this container */
|
||||
DefaultChildrenContainers: IAvailableDefaultContainerModel[]
|
||||
ContainerActions: IActionContainerModel[]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
export interface IAvailableDefaultContainerModel {
|
||||
Type: string
|
||||
DefaultChildrenContainers: IAvailableDefaultContainerModel[]
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
import { IAvailableContainerModel } from './IAvailableContainerModel';
|
||||
import { IAvailableSymbolModel } from './IAvailableSymbolModel';
|
||||
|
||||
/** Model of configuration for the application to configure it */
|
||||
export interface IConfigurationResponseModel {
|
||||
AvailableContainers: IAvailableContainerModel[];
|
||||
AvailableSymbols: IAvailableSymbolModel[];
|
||||
MainContainer: IAvailableContainerModel;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/** Model of an image with multiple source */
|
||||
export interface IImageModel {
|
||||
export interface Image {
|
||||
Name: string;
|
||||
Url: string;
|
||||
Base64Image: string;
|
|
@ -1,9 +1,9 @@
|
|||
import * as React from 'react';
|
||||
import { IAvailableContainerModel } from '../Interfaces/IAvailableContainerModel';
|
||||
import { AvailableContainer } from '../Interfaces/AvailableContainer';
|
||||
import { MainContainer } from './Elements/MainContainer';
|
||||
|
||||
interface ISVGProps {
|
||||
MainContainer: IAvailableContainerModel
|
||||
MainContainer: AvailableContainer
|
||||
}
|
||||
|
||||
export class SVG extends React.Component<ISVGProps> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue