Skip to content

Commit

Permalink
fix(fdc3) - Fixed example applications, refactored channel handling, …
Browse files Browse the repository at this point in the history
…added channel exception, separated user channel set reader

* fix(fdc3) - joinUserChannel exception, triggering the fdc3Ready Event when we joined to the channel if the channel Id is defined

* fix(app-channel) - Remove redundant check if the app channel has been created when calling the method, added exception

* fix(fdc3) - Remove unnecessary property

* fix(userchannelset) - Seperated user channel set reader, fixed example projects to act upon the fdc3Ready event
  • Loading branch information
lilla28 authored Sep 11, 2024
1 parent 77de2de commit 9ca098c
Show file tree
Hide file tree
Showing 32 changed files with 466 additions and 416 deletions.
7 changes: 3 additions & 4 deletions examples/fdc3-chart-and-grid/js-chart/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ let currentChannel;

NoDataToDisplay(Highcharts);

window.addEventListener('load', function() {
window.addEventListener('fdc3Ready', async() => {
chart = Highcharts.chart('container', {

chart: {
type: 'column',
events: {
load: requestData
}
},
title: {
text: 'Monthly Sales Data'
Expand All @@ -43,6 +40,8 @@ window.addEventListener('load', function() {
data: []
}]
});

await requestData();
});

window.addEventListener('close', async function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ export class MockDataService{

constructor(){
this.market = new Market();
this.connecting = new Promise(async(resolve, reject) => {
try{
resolve(await this.checkFdc3Connection());
} catch(err) {
reject(err);
};

window.addEventListener('fdc3Ready', () => {
this.connecting = new Promise(async(resolve, reject) => {
try{
resolve(await this.checkFdc3Connection());
} catch(err) {
reject(err);
};
});
});

interval(1000).subscribe(() => {
Expand Down
2 changes: 1 addition & 1 deletion examples/fdc3-pricing-and-chat/js-chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ window.app = function () {
}
}();

window.addEventListener('load', async function () {
window.addEventListener('fdc3Ready', async function () {
intentListener = await window.fdc3.addIntentListener("StartChat", window.app.handleChatIntent);

await window.fdc3.joinUserChannel("fdc3.channel.1");
Expand Down
2 changes: 1 addition & 1 deletion examples/fdc3-pricing-and-chat/js-pricing/pricing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import "bootstrap/dist/css/bootstrap.css";

window.addEventListener('load', async function () {
window.addEventListener('fdc3Ready', async function () {
const pricingForm = document.querySelector("#pricing");
await this.window.fdc3.joinUserChannel("fdc3.channel.1");
pricingForm.addEventListener('submit', app.submitPrice);
Expand Down
1 change: 1 addition & 0 deletions examples/fdc3-trade-simulator/js-order-book/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/platform-browser-dynamic": "^17.3.0",
"@angular/router": "^17.3.0",
"@finos/fdc3": "^2.0.0",
"material-icons": "^1.13.12",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
Expand Down
Loading

0 comments on commit 9ca098c

Please sign in to comment.