Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

release: Master into dev #856

Merged
merged 31 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
39521f2
Fix ymax and rename Tensorflow nama everywhere (#763)
JacopoMangiavacchi Apr 15, 2019
0fe6386
feat: Save partial project progress during project creation (#769)
wbreza Apr 17, 2019
c10c971
feat: CNTK Export Provider (#771)
wbreza Apr 17, 2019
d6a0594
Fix: Enables selection of azure region for custom vision export (#765)
wbreza Apr 18, 2019
37234ec
refactor: Remove editor footer
tbarlow12 Apr 18, 2019
6974aef
Project service functions
tbarlow12 Apr 15, 2019
1001528
Added tests for project service
tbarlow12 Apr 15, 2019
2ef4e13
Added confirm and strings for tag and rename operations
tbarlow12 Apr 15, 2019
4f325df
Split out project functions and asset functions into respective services
tbarlow12 Apr 15, 2019
f394ea3
Editor Page and canvas upates
tbarlow12 Apr 15, 2019
4193bc0
Register mixins and run async loop
tbarlow12 Apr 15, 2019
8439574
Saving assets in async foreach loop
tbarlow12 Apr 15, 2019
996a555
Delete tag working
tbarlow12 Apr 15, 2019
5b4610b
Rename tag function in editor page
tbarlow12 Apr 15, 2019
bbd83a4
Fix tag removal test for editor page
tbarlow12 Apr 16, 2019
8b34db5
Clean up and docs
tbarlow12 Apr 16, 2019
354623e
Lint fixes
tbarlow12 Apr 16, 2019
4a0dcb2
Dummy commit to kick off build again
tbarlow12 Apr 16, 2019
3998b6e
fix: Refactored project tag/delete updates
wbreza Apr 19, 2019
0b06d6a
test: Refactored editor page tests
wbreza Apr 19, 2019
48805dc
test: Verify tag update/delete project actions
wbreza Apr 19, 2019
0429590
doc: Add bug & feature templates (#780)
wbreza Apr 23, 2019
25b4aa2
Create CODE_OF_CONDUCT.md (#779)
wbreza Apr 23, 2019
a2ef52c
docs: updates to readme and changelog (#781)
pjlittle Apr 23, 2019
921dbac
feat: Active Learning Updates (#778)
wbreza Apr 24, 2019
acbbc86
fix: Fix display of tag color picker (#782)
tbarlow12 Apr 26, 2019
f29963c
feat: Add CSV Exporter (#757)
JacopoMangiavacchi Apr 26, 2019
90754dc
fix: change method for alloc string to buffer (#777)
golee Apr 29, 2019
4d02db4
fix: Updates export options for pascalVOC rename (#788)
wbreza Apr 29, 2019
2234c8a
fix: Updates backwards compat & fixes cntk export image bug (#789)
wbreza Apr 29, 2019
745e854
Release 2.1.0 (#790)
wbreza Apr 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added confirm and strings for tag and rename operations
  • Loading branch information
tbarlow12 authored and wbreza committed Apr 29, 2019
commit 2ef4e1387f63366c4002111b670143240bf80617
8 changes: 8 additions & 0 deletions src/common/localization/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ export const english: IAppStrings = {
apply: "Apply Tag with Hot Key",
lock: "Lock Tag with Hot Key",
},
rename: {
title: "Rename Tag",
confirmation: "Are you sure you want to rename this tag? It will be renamed throughout all assets",
},
delete: {
title: "Delete Tag",
confirmation: "Are you sure you want to delete this tag? It will be deleted throughout all assets and any regions where this is the only tag will also be deleted",
}
},
canvas: {
removeAllRegions: {
Expand Down
8 changes: 8 additions & 0 deletions src/common/localization/es-cl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ export const spanish: IAppStrings = {
apply: "Aplicar etiqueta con tecla de acceso rápido",
lock: "Bloquear etiqueta con tecla de acceso rápido",
},
rename: {
title: "Cambiar el nombre de la etiqueta",
confirmation: "¿Está seguro que quiere cambiar el nombre de esta etiqueta? Será cambiada en todos los activos",
},
delete: {
title: "Delete Tag",
confirmation: "¿Está seguro que quiere borrar esta etiqueta? Será borrada en todos los activos y en las regiones donde esta etiqueta sea la única, la region también será borrada",
}
},
canvas: {
removeAllRegions: {
Expand Down
2 changes: 2 additions & 0 deletions src/common/mockFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ export default class MockFactory {
save: jest.fn((project: IProject) => Promise.resolve(project)),
delete: jest.fn((project: IProject) => Promise.resolve()),
isDuplicate: jest.fn((project: IProject, projectList: IProject[]) => true),
renameTag: jest.fn(),
deleteTag: jest.fn(),
};
}

Expand Down
8 changes: 8 additions & 0 deletions src/common/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ export interface IAppStrings {
apply: string;
lock: string;
},
rename: {
title: string;
confirmation: string;
},
delete: {
title: string;
confirmation: string;
}
}
canvas: {
removeAllRegions: {
Expand Down
21 changes: 15 additions & 6 deletions src/react/components/common/tagInput/tagInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export interface ITagInputProps {
/** Function to call on clicking individual tag while holding CTRL key */
onCtrlTagClick?: (tag: ITag) => void;
/** Function to call when tag is renamed */
onTagRenamed?: (oldTag: string, newTag: string) => void;
onTagRenamed?: (tagName: string, newTagName: string) => void;
/** Function to call when tag is deleted */
onTagDeleted?: (tag: ITag) => void;
onTagDeleted?: (tagName: string) => void;
/** Always show tag input box */
showTagInputBox?: boolean;
/** Always show tag search box */
Expand Down Expand Up @@ -219,20 +219,25 @@ export class TagInput extends React.Component<ITagInputProps, ITagInputState> {
}, () => this.props.onChange(tags));
}

private updateTag = (oldTag: ITag, newTag: ITag) => {
if (oldTag === newTag) {
private updateTag = (tag: ITag, newTag: ITag) => {
if (tag === newTag) {
return;
}
if (!newTag.name.length) {
toast.warn(strings.tags.warnings.emptyName);
return;
}
if (newTag.name !== oldTag.name && this.state.tags.some((t) => t.name === newTag.name)) {
const nameChange = tag.name !== newTag.name;
if (nameChange && this.state.tags.some((t) => t.name === newTag.name)) {
toast.warn(strings.tags.warnings.existingName);
return;
}
if (nameChange && this.props.onTagRenamed) {
this.props.onTagRenamed(tag.name, newTag.name);
return;
}
const tags = this.state.tags.map((t) => {
return (t.name === oldTag.name) ? newTag : t;
return (t.name === tag.name) ? newTag : t;
});
this.setState({
tags,
Expand Down Expand Up @@ -389,6 +394,10 @@ export class TagInput extends React.Component<ITagInputProps, ITagInputState> {
if (!tag) {
return;
}
if (this.props.onTagDeleted) {
this.props.onTagDeleted(tag.name);
return;
}
const index = this.state.tags.indexOf(tag);
const tags = this.state.tags.filter((t) => t.name !== tag.name);
this.setState({
Expand Down
31 changes: 31 additions & 0 deletions src/react/components/pages/editorPage/editorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import "./editorPage.scss";
import EditorSideBar from "./editorSideBar";
import { EditorToolbar } from "./editorToolbar";
import Alert from "../../common/alert/alert";
import Confirm from "../../common/confirm/confirm";
// tslint:disable-next-line:no-var-requires
const tagColors = require("../../common/tagColors.json");

Expand Down Expand Up @@ -120,6 +121,8 @@ export default class EditorPage extends React.Component<IEditorPageProps, IEdito
private loadingProjectAssets: boolean = false;
private toolbarItems: IToolbarItemRegistration[] = ToolbarItemFactory.getToolbarItems();
private canvas: RefObject<Canvas> = React.createRef();
private renameTagConfirm: React.RefObject<Confirm> = React.createRef();
private deleteTagConfirm: React.RefObject<Confirm> = React.createRef();

public async componentDidMount() {
const projectId = this.props.match.params["projectId"];
Expand Down Expand Up @@ -232,8 +235,20 @@ export default class EditorPage extends React.Component<IEditorPageProps, IEdito
onLockedTagsChange={this.onLockedTagsChanged}
onTagClick={this.onTagClicked}
onCtrlTagClick={this.onCtrlTagClicked}
onTagRenamed={this.confirmTagRenamed}
onTagDeleted={this.confirmTagDeleted}
/>
</div>
<Confirm title={strings.editorPage.tags.rename.title}
ref={this.renameTagConfirm}
message={strings.editorPage.tags.rename.confirmation}
confirmButtonColor="danger"
onConfirm={this.onTagRenamed}/>
<Confirm title={strings.editorPage.tags.delete.title}
ref={this.deleteTagConfirm}
message={strings.editorPage.tags.delete.confirmation}
confirmButtonColor="danger"
onConfirm={this.onTagDeleted}/>
</div>
</SplitPane>
<Alert show={this.state.showInvalidRegionWarning}
Expand Down Expand Up @@ -288,6 +303,22 @@ export default class EditorPage extends React.Component<IEditorPageProps, IEdito
}, () => this.canvas.current.applyTag(tag.name));
}

private confirmTagRenamed = (tagName: string, newTagName: string): void => {
this.renameTagConfirm.current.open(tagName, newTagName);
}

private onTagRenamed = (tagName: string, newTagName: string): void => {
debugger;
}

private confirmTagDeleted = (tagName: string): void => {
this.deleteTagConfirm.current.open(tagName);
}

private onTagDeleted = (tagName: string): void => {
debugger;
}

private onCtrlTagClicked = (tag: ITag): void => {
const locked = this.state.lockedTags;
this.setState({
Expand Down