This commit is contained in:
Robert Stewart (eXcell 2020-10-16 03:55:55 -07:00
Родитель 680e47481e
Коммит b6557e864c
4 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -5,7 +5,7 @@ import { useSelector } from 'react-redux';
import { Customizer, ICustomizations, ChoiceGroup, IChoiceGroupOption, PrimaryButton, DetailsList, IColumn, TextField, Dropdown, SelectionMode, DetailsListLayoutMode, FontIcon, CheckboxVisibility, IContextualMenuItem, CommandBar, Selection, Separator, IObjectWithKey } from "@fluentui/react";
import { getPrimaryGreyTheme, getPrimaryGreenTheme, getRightPaneDefaultButtonTheme, getGreenWithWhiteBackgroundTheme, getPrimaryBlueTheme, getDefaultTheme } from '../../../../common/themes';
import { FieldFormat, FieldType, IApplicationState, ITableTag, ITag, TagInputMode } from '../../../../models/applicationState';
import { FieldFormat, FieldType, IApplicationState, ITableRegion, ITableTag, ITag, TagInputMode } from '../../../../models/applicationState';
import { filterFormat } from "../../../../common/utils";
import { toast } from "react-toastify";
import "./tableTagConfig.scss";
@ -27,7 +27,7 @@ interface IShareState {
}
interface ITableTagConfigProps {
setTagInputMode: (addTableMode: TagInputMode) => void;
setTagInputMode: (addTableMode: TagInputMode, selectedTableTagToLabel?: ITableTag, selectedTableTagBody?: ITableRegion[][][]) => void;
addTableTag: (table: any) => void;
splitPaneWidth: number;
tableTag?: ITableTag;
@ -503,7 +503,7 @@ export default function TableTagConfig(props: ITableTagConfigProps) {
tableTagToAdd["rows"] = trimFieldNames(rows);
}
addTableTag(tableTagToAdd);
setTagInputMode(TagInputMode.Basic);
setTagInputMode(TagInputMode.Basic, null, null);
}
function hasEmptyNames(array: ITableConfigItem[]) {
@ -767,7 +767,7 @@ export default function TableTagConfig(props: ITableTagConfigProps) {
<PrimaryButton
className="cancel"
theme={getPrimaryGreyTheme()}
onClick={() => setTagInputMode(TagInputMode.Basic)}
onClick={() => setTagInputMode(TagInputMode.Basic, null, null)}
>Cancel</PrimaryButton>
<PrimaryButton
className="save"

Просмотреть файл

@ -11,7 +11,7 @@ import { strings } from "../../../../common/strings";
interface ITableTagLabelingProps {
setTagInputMode: (addTableMode: TagInputMode) => void;
setTagInputMode: (addTableMode: TagInputMode, selectedTableTagToLabel?: ITableTag, selectedTableTagBody?: ITableRegion[][][]) => void;
selectedTag: ITableTag,
selectedRegions?: IRegion[];
onTagClick?: (tag: ITableTag) => void;
@ -111,7 +111,7 @@ export default class TableTagLabeling extends React.Component<ITableTagLabelingP
className="button-done"
theme={getPrimaryGreenTheme()}
onClick={() => {
this.props.setTagInputMode(TagInputMode.Basic)
this.props.setTagInputMode(TagInputMode.Basic, null, null)
}}
>{strings.tags.regionTableTags.tableLabeling.buttons.done}
</PrimaryButton>
@ -159,7 +159,7 @@ export default class TableTagLabeling extends React.Component<ITableTagLabelingP
}
private addRow = () => {
this.props.addRowToDynamicTable()
this.props.addRowToDynamicTable()
};
private handleCellClick = (iToChange, jToChange) => {

Просмотреть файл

@ -4,7 +4,7 @@
import React from "react";
import { IconButton } from "@fluentui/react";
import { strings } from "../../../../common/strings";
import { ITableTag, ITag, TagInputMode } from "../../../../models/applicationState";
import { ITableRegion, ITableTag, ITag, TagInputMode } from "../../../../models/applicationState";
enum Categories {
General,
@ -19,7 +19,7 @@ export interface ITagInputToolbarProps {
/** Function to call when add tags button is clicked */
onAddTags: () => void;
setTagInputMode?: (tagInputMode: TagInputMode, selectedTableTagToLabel?: ITableTag) => void;
setTagInputMode?: (tagInputMode: TagInputMode, selectedTableTagToLabel?: ITableTag, selectedTableTagBody?: ITableRegion[][][]) => void;
/** Function to call when search tags button is clicked */
onSearchTags: () => void;
/** Function to call when lock tags button is clicked */
@ -152,7 +152,7 @@ export default class TagInputToolbar extends React.Component<ITagInputToolbarPro
}
private handleAddTable = () => {
this.props.setTagInputMode(TagInputMode.ConfigureTable, null);
this.props.setTagInputMode(TagInputMode.ConfigureTable, null, null);
}
private handleSearch = () => {

Просмотреть файл

@ -428,10 +428,11 @@ export default class EditorPage extends React.Component<IEditorPageProps, IEdito
private onPageClick = () => {
}
private setTagInputMode = (tagInputMode: TagInputMode, selectedTableTagToLabel: ITableTag = this.state.selectedTableTagToLabel) => {
this.resizeCanvas();
private setTagInputMode = (tagInputMode: TagInputMode, selectedTableTagToLabel: ITableTag = this.state.selectedTableTagToLabel, selectedTableTagBody: ITableRegion[][][] = this.state.selectedTableTagBody) => {
// this.resizeCanvas();
this.setState({
selectedTableTagBody,
selectedTableTagToLabel,
tagInputMode,
}, () => {