From d33bb958e7610e02ff1b74183b0e6348f00bd497 Mon Sep 17 00:00:00 2001 From: GiordanoT <giordanotinella@gmail.com> Date: Sun, 5 Nov 2023 08:31:37 +0100 Subject: [PATCH] helper --- src/components/helper/Helper.tsx | 20 ++++++++++---------- src/components/helper/style.scss | 1 + src/index.tsx | 1 + src/joiner/classes.ts | 3 ++- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/helper/Helper.tsx b/src/components/helper/Helper.tsx index 91ea2b8ae..fe807884d 100644 --- a/src/components/helper/Helper.tsx +++ b/src/components/helper/Helper.tsx @@ -1,23 +1,23 @@ import './style.scss' -import React from "react"; +import React, {useEffect, useRef} from "react"; import {useStateIfMounted} from "use-state-if-mounted"; interface Props {} function Helper(props: Props) { - const [flag, setFlag] = useStateIfMounted(false); + const [iconFlag, setIconFlag] = useStateIfMounted(false); + const [menuFlag, setMenuFlag] = useStateIfMounted(false); - return(<section className={'helper'} > - {flag && <div className={'helper-menu border'}> + return(<section className={'helper'} tabIndex={-1}> + {(iconFlag || menuFlag) && <div className={'helper-menu border'} + onMouseEnter={e => setMenuFlag(true)} onMouseLeave={e => setMenuFlag(false)}> <div tabIndex={-1} onClick={e => alert('ok1')} className={'helper-item'}>Test 1</div> - <div tabIndex={-1} onClick={e => alert('ok2')} className={'helper-item'}>Test 2</div> - <hr /> - <div tabIndex={-1} onClick={e => setFlag(false)} className={'text-danger helper-item'}>Close</div> + <div tabIndex={-1} onClick={e => console.log('ok2')} className={'helper-item'}>Test 2</div> </div>} - <div tabIndex={-1} onClick={e => setFlag(!flag)} - className={'helper-icon bg-dark circle border d-flex justify-content-center align-items-center'}> + <div tabIndex={-1} onClick={e => setIconFlag(!iconFlag)} onBlur={e => setIconFlag(false)} + className={'bg-dark helper-icon circle border d-flex justify-content-center align-items-center'}> <label style={{cursor: 'pointer'}} className={'text-white'}>?</label> </div> - </section>) + </section>); } export default Helper; diff --git a/src/components/helper/style.scss b/src/components/helper/style.scss index 1ce7b3657..828ee7a06 100644 --- a/src/components/helper/style.scss +++ b/src/components/helper/style.scss @@ -34,3 +34,4 @@ position: absolute; bottom: 0; right: 0; } + diff --git a/src/index.tsx b/src/index.tsx index c1f0867d8..e4be0e075 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,6 +10,7 @@ import Router from "./router/Router"; function start() { + // first do login and then ... jodelInit(); ReactDOM.render( <Provider store={store}> diff --git a/src/joiner/classes.ts b/src/joiner/classes.ts index 9f7f7c785..bbdf8089a 100644 --- a/src/joiner/classes.ts +++ b/src/joiner/classes.ts @@ -1235,7 +1235,7 @@ export class PendingPointedByPaths{ } @RuntimeAccessible -export class PointedBy{ +export class PointedBy { public static cname: string = "PointedBy"; static list: string[] = ["father", "parent", "annotations", "packages", "type", "subpackages", "classifiers", "exceptions", "parameters", "defaultValue", "instances", "operations", "features", "attributes", "references", "extends", "extendedBy", "implements", "implementedBy", "instanceof", "edges", "target", "opposite", "parameters", "exceptions", "literals", "values"]; source: string; // elemento da cui parte il puntatore @@ -1680,6 +1680,7 @@ export class DProject extends DPointerTargetable { models: Pointer<DModel, 0, 'N'> = []; graphs: Pointer<DGraph, 0, 'N'> = []; views: Pointer<DViewElement, 0, 'N'> = U.getDefaultViewsID(); + // collaborators dict user: priority public static new(name: string, author: Pointer<DUser, 1, 1, LUser>, persist: boolean = true): DProject { return new Constructors(new DProject('dwc'), undefined, persist, undefined)