Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emporio integration #79

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1a7ad3b
feat: add Dialog to load thing model from a server (Emporio)
ivanzy Jun 14, 2022
f3376ca
feat: improve load thing model modal
ivanzy Jun 15, 2022
79f397a
feat: add pagination
ivanzy Jun 16, 2022
4481876
fix: adequate selector and class to React conventions
ivanzy Jun 16, 2022
7417957
feat: get ThingModel server from .env file
ivanzy Jun 16, 2022
0cbd9f9
feat: add scheme to tm repository url
relu91 Jun 24, 2022
fb4260c
fix: remove select propert from TM
ivanzy Jun 24, 2022
b148041
feat: add input to change Emporio URL thorugh the GUI
ivanzy Jun 28, 2022
0b24c44
feat: add url validation
ivanzy Jun 28, 2022
95a696d
feat: inline url form
ivanzy Jun 28, 2022
95edd2a
feat: improve style of url form
ivanzy Jun 28, 2022
445f266
feat: added advances options instead of tm repository, rework the des…
ivanzy Jun 29, 2022
f16d329
feat: change advance options from button to text
ivanzy Jun 29, 2022
ea621b6
fix: rollback change url to button
ivanzy Jun 29, 2022
0ee4dd5
refactor: change multiple state variables to a single useReducer
ivanzy Jul 5, 2022
fa473d6
feat: add no border
ivanzy Jul 5, 2022
90c7a3d
fix: unable to submit 'Load TM' without selecting a thing model
ivanzy Jul 5, 2022
ebac73d
refactor: move pagination buttons to its own component
ivanzy Jul 5, 2022
df4016f
refactor: move search bar and advances options to their own components
ivanzy Jul 5, 2022
01ed563
refactor: changes made are not a new version
ivanzy Jul 11, 2022
38a25be
style: rollback autoformat changes
ivanzy Jul 11, 2022
4e5677e
feat: save remote feature
ivanzy Jul 20, 2022
4c1a0a3
fix: update isThingModel context property
ivanzy Jul 20, 2022
b9d5259
fix: is misleading to have duplicate context definition. Modifying th…
ivanzy Jul 20, 2022
705d56f
feat: add emporio url as a context property
ivanzy Jul 20, 2022
3c27e96
feat: add an enviromental variable to control if a remote TM reposito…
ivanzy Jul 20, 2022
0377ecd
refactor: move AdvancedOptions componet to its own file
ivanzy Jul 20, 2022
6c80de4
feat: add AdvancedOptions in SaveRemote Dialog
ivanzy Jul 20, 2022
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
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REACT_APP_TM_SERVER_SCHEME=https
REACT_APP_TM_SERVER_HOST=api.emporio.vaimee.it
REACT_APP_TM_SERVER_PORT=80
REACT_APP_REMOTE_SERVER=false
23 changes: 22 additions & 1 deletion src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html {
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}
Expand Down Expand Up @@ -624,11 +624,20 @@ video {
border-color: rgba(252, 129, 129, var(--tw-border-opacity));
}

.border-blue-500 {
--tw-border-opacity: 1;
border-color: rgba(0, 90, 156, var(--tw-border-opacity));
}

.focus\:border-blue-500:focus {
--tw-border-opacity: 1;
border-color: rgba(0, 90, 156, var(--tw-border-opacity));
}

.border-none{
border-style: none;
}

.rounded {
border-radius: 0.25rem;
}
Expand Down Expand Up @@ -1129,6 +1138,14 @@ video {
width: 33.333333%;
}

.w-1\/4 {
width: 25%;
}

.w-7\/10 {
width: 70%;
}

.w-5\/12 {
width: 41.666667%;
}
Expand All @@ -1149,6 +1166,10 @@ video {
z-index: 10;
}

.whitespace-nowrap {
white-space: nowrap;
}

@keyframes spin {
to {
transform: rotate(360deg);
Expand Down
15 changes: 15 additions & 0 deletions src/components/App/AppHeader/AppHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import Button from "./Button";
import { ShareDialog } from "../../Dialogs/ShareDialog";
import { ConvertTmDialog } from "../../Dialogs/ConvertTmDialog";
import { CreateTdDialog } from "../../Dialogs/CreateTdDialog";
import { LoadTmDialog } from "../../Dialogs/LoadTmDialog";
import { SaveTmRemotelyDialog } from "../../Dialogs/SaveTmRemotelyDialog";
import { getFileHandle, getFileHTML5, _readFileHTML5 } from "../../../util.js";


Expand Down Expand Up @@ -306,6 +308,15 @@ export default function AppHeader() {
const createTdDialog = React.useRef();
const openCreateTdDialog = () => { createTdDialog.current.openModal() }

const loadTmDialog = React.useRef();
const openLoadTmDialog = () => { loadTmDialog.current.openModal() }

const saveTmRemotelyDialog = React.useRef();
const openSaveTmRemotelyDialog = () => { saveTmRemotelyDialog.current.openModal() }

const useRemoteServer = process.env.REACT_APP_REMOTE_SERVER.toLocaleLowerCase() === "true";
console.log(useRemoteServer);
console.log(useRemoteServer? 'true':'false');
return (
<>
<header className="flex justify-between items-center h-16 bg-blue-500">
Expand All @@ -320,14 +331,18 @@ export default function AppHeader() {
<Button onClick={openShareDialog}>Share</Button>
<Button onClick={openCreateTdDialog}>New</Button>
<Button onClick={openFile}>Open</Button>
{useRemoteServer && <Button onClick={openLoadTmDialog}>Load TM</Button>}
{(hasNativeFS()) && <Button onClick={saveFile}>Save</Button>}
<Button onClick={saveFileAs}>Save As</Button>
{(context.isThingModel && useRemoteServer) && <Button onClick={openSaveTmRemotelyDialog}>Save Remotely</Button>}
{(context.showConvertBtn || context.isThingModel) && <Button onClick={openConvertTmDialog}>Convert To TD</Button>}
</div>
</header>
<ConvertTmDialog ref={convertTmDialog} />
<ShareDialog ref={shareDialog} />
<CreateTdDialog ref={createTdDialog} />
<LoadTmDialog ref={loadTmDialog} />
<SaveTmRemotelyDialog ref={saveTmRemotelyDialog} />
<input
className="h-0"
type="file"
Expand Down
1 change: 1 addition & 0 deletions src/components/Dialogs/CreateTdDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const CreateTdDialog = forwardRef((props, ref) => {
context.updateLinkedTd(undefined)
context.addLinkedTd(linkedTd)
context.updateShowConvertBtn(type === "TM");
context.updateIsThingModel(type === "TM")
context.updateOfflineTD(JSON.stringify(td, null, "\t"),"AppHeader");
close();
}}
Expand Down
Loading