Add Mode.addPointToGroup

pull/1381/head
Rick Carlino 2019-08-15 11:17:36 -05:00
parent 2ea676fcdd
commit 9725b00d4b
4 changed files with 8 additions and 2 deletions

View File

@ -142,4 +142,5 @@ export enum Mode {
moveTo = "moveTo",
createPoint = "createPoint",
templateView = "templateView",
addPointToGroup = "addPointToGroup"
}

View File

@ -289,6 +289,10 @@ export const transformForQuadrant =
export const getMode = (): Mode => {
const pathArray = getPathArray();
if (pathArray) {
console.log(JSON.stringify(pathArray));
if ((pathArray[3] === "groups") && pathArray[4]) {
return Mode.addPointToGroup;
}
if (pathArray[6] === "add") { return Mode.clickToAdd; }
if (!isNaN(parseInt(pathArray.slice(-1)[0]))) { return Mode.editPlant; }
if (pathArray[5] === "edit") { return Mode.editPlant; }

View File

@ -133,7 +133,9 @@ export class GroupDetail extends React.Component<GroupDetailProps, State> {
<h5>{t("GROUP NAME")}</h5>
<input defaultValue={this.name} />
<h5>{t("GROUP MEMBERS ({{count}})", { count: this.icons.length })}</h5>
{this.icons}
<div>
{this.icons}
</div>
<DeleteButton
dispatch={this.props.dispatch}
uuid={group.uuid}

View File

@ -60,7 +60,6 @@ function route<T, U>(info: UnboundRouteConfig<T, U>) {
try {
const comp = (await info.getModule())[info.key];
if (info.children) {
console.log(x.params);
const child = (await info.getChild())[info.childKey];
callback(comp, child, info);
} else {