diff --git a/README.md b/README.md index 27f16a8..18cc1c1 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Change the values in Riot's `config.json` as shown below. If you do not have a ` ``` "integrations_ui_url": "https://dimension.t2bot.io/riot", "integrations_rest_url": "https://dimension.t2bot.io/api/v1/scalar", +"integrations_widgets_urls": ["https://dimension.t2bot.io/widgets"], ``` The remaining settings should be tailored for your Riot deployment. diff --git a/src/Dimension.js b/src/Dimension.js index cc3bb1e..bab01e1 100644 --- a/src/Dimension.js +++ b/src/Dimension.js @@ -32,7 +32,7 @@ class Dimension { this._app.use(bodyParser.json()); // Register routes for angular app - this._app.get(['/riot', '/riot/*', '/widget_wrapper', '/widget_wrapper/*'], (req, res) => { + this._app.get(['/riot', '/riot/*', '/widgets', '/widgets/*'], (req, res) => { res.sendFile(path.join(__dirname, "..", "web-dist", "index.html")); }); diff --git a/web/app/app.module.ts b/web/app/app.module.ts index 7d42dab..26ed221 100644 --- a/web/app/app.module.ts +++ b/web/app/app.module.ts @@ -24,7 +24,7 @@ import { IrcApiService } from "./shared/irc-api.service"; import { TravisCiConfigComponent } from "./configs/travisci/travisci-config.component"; import { CustomWidgetConfigComponent } from "./configs/widget/custom_widget/custom_widget-config.component"; import { MyFilterPipe } from "./shared/my-filter.pipe"; -import { WidgetWrapperComponent } from "./widget_wrapper/widget_wrapper.component"; +import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component"; @NgModule({ imports: [ @@ -50,7 +50,7 @@ import { WidgetWrapperComponent } from "./widget_wrapper/widget_wrapper.componen TravisCiConfigComponent, CustomWidgetConfigComponent, MyFilterPipe, - WidgetWrapperComponent, + GenericWidgetWrapperComponent, // Vendor ], diff --git a/web/app/app.routing.ts b/web/app/app.routing.ts index 681f0e8..dc32450 100644 --- a/web/app/app.routing.ts +++ b/web/app/app.routing.ts @@ -1,12 +1,12 @@ import { RouterModule, Routes } from "@angular/router"; import { HomeComponent } from "./home/home.component"; import { RiotComponent } from "./riot/riot.component"; -import { WidgetWrapperComponent } from "./widget_wrapper/widget_wrapper.component"; +import { GenericWidgetWrapperComponent } from "./widget_wrappers/generic/generic.component"; const routes: Routes = [ {path: "", component: HomeComponent}, {path: "riot", component: RiotComponent}, - {path: "riot/widget_wrapper", component: WidgetWrapperComponent}, + {path: "widgets/generic", component: GenericWidgetWrapperComponent}, ]; export const routing = RouterModule.forRoot(routes); diff --git a/web/app/configs/widget/custom_widget/custom_widget-config.component.ts b/web/app/configs/widget/custom_widget/custom_widget-config.component.ts index 838b525..1410b2b 100644 --- a/web/app/configs/widget/custom_widget/custom_widget-config.component.ts +++ b/web/app/configs/widget/custom_widget/custom_widget-config.component.ts @@ -40,7 +40,7 @@ export class CustomWidgetConfigComponent extends WidgetComponent implements Moda } }); - this.wrapperUrl = window.location.origin + "/riot/widget_wrapper?url="; + this.wrapperUrl = window.location.origin + "/widgets/generic?url="; } private getWrappedUrl(url: string): string { diff --git a/web/app/home/home.component.html b/web/app/home/home.component.html index 355a836..501adc5 100644 --- a/web/app/home/home.component.html +++ b/web/app/home/home.component.html @@ -10,8 +10,9 @@

Point your Riot config.json to Dimension to start using it:

-        "integrations_ui_url": "https://dimension.t2bot.io/riot"
-        "integrations_rest_url": "https://dimension.t2bot.io/api/v1/scalar"
+        "integrations_ui_url": "https://dimension.t2bot.io/riot",
+        "integrations_rest_url": "https://dimension.t2bot.io/api/v1/scalar",
+        "integrations_widgets_urls": ["https://dimension.t2bot.io/widgets"],
         


diff --git a/web/app/widget_wrapper/widget_wrapper.component.html b/web/app/widget_wrappers/generic/generic.component.html similarity index 100% rename from web/app/widget_wrapper/widget_wrapper.component.html rename to web/app/widget_wrappers/generic/generic.component.html diff --git a/web/app/widget_wrapper/widget_wrapper.component.scss b/web/app/widget_wrappers/generic/generic.component.scss similarity index 100% rename from web/app/widget_wrapper/widget_wrapper.component.scss rename to web/app/widget_wrappers/generic/generic.component.scss diff --git a/web/app/widget_wrapper/widget_wrapper.component.ts b/web/app/widget_wrappers/generic/generic.component.ts similarity index 77% rename from web/app/widget_wrapper/widget_wrapper.component.ts rename to web/app/widget_wrappers/generic/generic.component.ts index 17eeae1..1239ed1 100644 --- a/web/app/widget_wrapper/widget_wrapper.component.ts +++ b/web/app/widget_wrappers/generic/generic.component.ts @@ -1,14 +1,14 @@ import { Component } from "@angular/core"; -import { ApiService } from "../shared/api.service"; +import { ApiService } from "../../shared/api.service"; import { ActivatedRoute } from "@angular/router"; import { DomSanitizer, SafeUrl } from "@angular/platform-browser"; @Component({ - selector: "my-widget-wrapper", - templateUrl: "widget_wrapper.component.html", - styleUrls: ["widget_wrapper.component.scss"], + selector: "my-generic-widget-wrapper", + templateUrl: "generic.component.html", + styleUrls: ["generic.component.scss"], }) -export class WidgetWrapperComponent { +export class GenericWidgetWrapperComponent { public isLoading = true; public canEmbed = false;