Skip to content

Commit

Permalink
Chart iq/refector intents tab (finos#37)
Browse files Browse the repository at this point in the history
* intent name fix for target app in raise intent

* target use name instead of title

* let to const

* let to const

* bug fix for RaiseIntentFOrCOntext handling

+drop some out of data stuff from readme

Co-authored-by: Kris West <kris@cosaic.io>
  • Loading branch information
karisjlin and kriswest authored Nov 15, 2022
1 parent 1514f40 commit 939f86c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
7 changes: 0 additions & 7 deletions toolbox/fdc3-workbench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ _Created and contributed to [FDC3](http://fdc3.finos.org) by [Cosaic, Inc.](http

4. Add the URL http://localhost:3000 to your FDC3-enabled container or desktop agent and ensure it has access to the `window.fdc3` object.

## TODO
- Implement a panel for working with [App channels](https://fdc3.finos.org/docs/api/spec#direct-listening-and-broadcast-on-channels).
- Implement `findIntent` in the intents panel with support for a targetted `raiseIntent` using one of the results.
- Add support for saving context tempaltes across sessions (e.g. via localstorage)
## Packages

Core:
Expand All @@ -41,6 +37,3 @@ Minor:
## Known Issues

- The following console error may appear periodically: `Warning: findDOMNode is deprecated in StrictMode.`, this is a [well-known issue in material-ui](https://github.com/mui-org/material-ui/issues/13394) and will be fixed in v5, which (at the time of writing) is currently in beta.



16 changes: 9 additions & 7 deletions toolbox/fdc3-workbench/src/components/Intents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ export const Intents = observer(({handleTabChange}: {handleTabChange:any}) => {
};

const handleRaiseIntentForContext = () => {
if(raiseIntentWithContextContext){
if(contextTargetApp && contextIntentObjects) {
if (raiseIntentWithContextContext){
if (contextTargetApp && contextIntentObjects) {
let targetObject = contextIntentObjects.find((target) => target.name === contextTargetApp);
intentStore.raiseIntentForContext(raiseIntentWithContextContext, targetObject);
intentStore.raiseIntentForContext(raiseIntentWithContextContext, targetObject.app.name);
} else {
intentStore.raiseIntentForContext(raiseIntentWithContextContext);
}
Expand Down Expand Up @@ -233,8 +233,8 @@ export const Intents = observer(({handleTabChange}: {handleTabChange:any}) => {
setIntentObjects(appIntents);
setIntentsForContext(appIntents.map(({intent}: {intent:any})=>{
return {
title: intent.name.includes('fdc3') ? intent.name.split('.')[1] : intent.name,
value: intent.name.includes('fdc3') ? intent.name.split('.')[1] : intent.name
title: intent.name,
value: intent.name
}
}));
}
Expand All @@ -249,7 +249,9 @@ export const Intents = observer(({handleTabChange}: {handleTabChange:any}) => {

useEffect(() => {
if(intentObjects){
let targets = intentObjects.find((obj) => obj.intent.displayName === intentValue?.value);
const targets = intentObjects.find((obj) => {
return obj.intent.name === intentValue?.value
});
if(targets?.apps){
setIntentTargets(targets.apps);
}
Expand Down Expand Up @@ -349,7 +351,7 @@ export const Intents = observer(({handleTabChange}: {handleTabChange:any}) => {
{intentTargets?.length &&
intentTargets.map((target) => (
<MenuItem key={target.name} value={target.name}>
{target.title}
{target.name}
</MenuItem>
))}
</Select>
Expand Down

0 comments on commit 939f86c

Please sign in to comment.