Skip to content

Commit 813e4c3

Browse files
committed
Merge branch 'staging' of https://github.com/gridaco/assistant into staging
2 parents a366b52 + 38895f2 commit 813e4c3

40 files changed

+382
-17600
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ yarn figma
5050
yarn sketch
5151

5252
# [OPTIONAL 3 & Contributors only] run plugin ui in webdev mode
53-
yarn webdev
53+
yarn web
54+
# visit http://localhost:3000/init-webdev to work on browser
5455
```
5556

5657
_soon as the subpackages are released as stable, we will remove git submodule dependency for ease of use. until then, this will be the primary repository and all the edits and PRs will be caused by this project._ - [Learn more here](https://github.com/bridgedxyz/.github/blob/main/contributing/working-with-submodules.md)

app/lib/components/icons-loader.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function filterIcons(
223223
return [k, item];
224224
})
225225
.filter((k) => k !== undefined);
226-
console.log("default icons", defaultIcons.length);
226+
console.log("default icons loaded", defaultIcons.length);
227227
return defaultIcons;
228228
}
229229

@@ -278,7 +278,6 @@ function IconItem(props: { name: string; config: IconConfig }) {
278278

279279
const onClick = () => {
280280
_onUserLoadIconToCanvas();
281-
console.log("icon", name, "clicked");
282281
loadData().then((d) => {
283282
parent.postMessage(
284283
{

app/lib/main/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,6 @@ function _update_focused_screen_ev(screen: WorkScreen) {
307307
},
308308
"*"
309309
);
310-
console.log(
311-
`sending back thread about changed screen (user interest) data - "${screen}"`
312-
);
313310
}
314311

315312
const Wrapper = styled.div`

app/lib/pages/code/footer-action/next-upload-button.tsx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ import { BlackButton } from "../../../components/style/global-style";
44
import { registerScene } from "../../../scene-view";
55
import { PluginSdk } from "@plugin-sdk/app";
66
import type { IReflectNodeReference } from "@design-sdk/core/nodes/lignt";
7+
import { isAuthenticated } from "../../../auth";
8+
import { useHistory } from "react-router-dom";
79

810
export function NextUploadButton(props: {
911
disabled?: boolean;
1012
scene?: IReflectNodeReference;
1113
app?: any;
1214
}) {
1315
const [isLoading, setIsLoading] = useState(false);
16+
const history = useHistory();
1417

1518
const register = async () => {
1619
setIsLoading(true);
@@ -23,7 +26,6 @@ export function NextUploadButton(props: {
2326
});
2427

2528
const rawNode = await PluginSdk.getNode(props.scene.id);
26-
console.log("rawNode", rawNode);
2729

2830
// register with all data
2931
return await registerScene({
@@ -39,27 +41,36 @@ export function NextUploadButton(props: {
3941
},
4042
});
4143
};
44+
45+
const onNextClick = async () => {
46+
const authenticated = await isAuthenticated();
47+
if (!authenticated) {
48+
PluginSdk.notify("Let's Sign in first");
49+
history.push("/signin");
50+
return;
51+
}
52+
53+
// if authenticated, we can procceed to next step finally. ;)
54+
register()
55+
.then((d) => {
56+
open(buildOpenUrlForRegisteredScene(d.id));
57+
})
58+
.catch((e) => {
59+
console.error("error while registering scene", e);
60+
PluginSdk.notify(
61+
"Oops. something went wrong. pplease try again. ;)",
62+
3
63+
);
64+
})
65+
.finally(() => {
66+
setIsLoading(false);
67+
});
68+
};
69+
4270
return (
4371
<NextStepButton
4472
disabled={props.disabled || isLoading}
45-
onClick={() => {
46-
register()
47-
.then((d) => {
48-
open(buildOpenUrlForRegisteredScene(d.id));
49-
})
50-
.catch((e) => {
51-
console.error("error while registering scene", e);
52-
PluginSdk.notify(
53-
"Oops. something went wrong. pplease try again. ;)",
54-
3
55-
);
56-
})
57-
.finally(() => {
58-
setIsLoading(false);
59-
});
60-
// upload
61-
// TODO: the button component should be passed from outer side.
62-
}}
73+
onClick={onNextClick}
6374
>
6475
Next
6576
</NextStepButton>
@@ -73,7 +84,7 @@ function buildOpenUrlForRegisteredScene(sceneId: string) {
7384
const NextStepButton = styled.button`
7485
${BlackButton}
7586
/* 2/3 size. 12 is wrapper padding */
76-
width: calc(66.666% - 12px);
87+
width: calc(66.666% - 12px); /* FIXME: stupid! */
7788
7889
&:hover {
7990
color: #fff;

app/lib/pages/component-view/component-view-screen.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ export function ComponentViewScreen() {
3434
// 2. check if selected layer is a component or an instance.
3535
// TODO
3636

37-
console.log("ComponentViewScreen's target node id", selection.id);
3837
// 3. find if data to display exists on a master component.
3938
PluginSdk.fetchMainComponentMetadata({
4039
id: selection.id,
4140
namespace: ASSISTANT_PLUGIN_NAMESPACE__NOCHANGE,
4241
key: "component-meta-data",
4342
}).then((d) => {
44-
console.log(`component-meta-data is`, d);
4543
setData(d);
4644
});
4745
}

app/lib/pages/g11n-screen.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export class GlobalizationScreen extends React.Component<any, State> {
6464

6565
async startCloud() {
6666
const hosted = await repo_assets.ImageHostingRepository.hostImages();
67-
console.log(hosted);
6867

6968
const scene = this.state.vanilla.scene;
7069
const transport = this.state.vanilla;

app/lib/pages/tool-box/batch-meta-editor/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,13 @@ function FetchMetaDataViaKey() {
9797
const type = ev.data?.pluginMessage?.type;
9898
if (type == "__response__") {
9999
const data = ev.data?.pluginMessage?.data;
100-
console.log("pingpong", data);
101100
setResponse(data);
102101
}
103102
});
104103

105104
const [response, setResponse] = useState<any>(undefined);
106105
const [key, setKey] = useState("");
107106
const handleOnSearchClick = () => {
108-
console.log(`searching with ey ${key}.`);
109107
PluginSdk.fetchRootMetadata(key);
110108
};
111109
return (

app/lib/pages/tool-box/exporter/vanilla-exporter.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export class VanillaExporter extends React.Component<any, State> {
4646
vanilla: msg.data as VanillaSceneTransport,
4747
};
4848
});
49-
console.log("vanilla transport receiced from view", msg.data);
5049
break;
5150

5251
case EK_IMAGE_ASSET_REPOSITORY_MAP:

app/lib/pages/tool-box/font-replacer/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { EK_REPLACE_FONT } from "../../../constants/ek.constant";
44

55
export function FontReplacerScreen() {
66
function onReplaceFontClick() {
7-
console.log("onReplaceFontClick");
8-
97
parent.postMessage(
108
{
119
pluginMessage: {

app/lib/pages/tool-box/meta-editor/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ function MetaDataDisplayForm(props: {
133133
const handleSaveClick = () => {
134134
repo.update(data);
135135
setData(data);
136-
console.log("value updated", data);
137136
};
138137

139138
const schema = DefaultComponentMetaDataSchema;

0 commit comments

Comments
 (0)