Add google docs configuration

This commit is contained in:
Travis Ralston 2017-12-23 13:44:19 -07:00
parent 2fbd655c46
commit 41c887f390
6 changed files with 33 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import { ConfigScreenWidgetComponent } from "./configs/widget/config_screen/conf
import { EtherpadWidgetConfigComponent } from "./configs/widget/etherpad/etherpad.widget.component";
import { NameService } from "./shared/services/name.service";
import { GoogleCalendarWidgetConfigComponent } from "./configs/widget/google_calendar/gcal.widget.component";
import { GoogleDocsWidgetConfigComponent } from "./configs/widget/google_docs/gdoc.widget.component";
@NgModule({
imports: [
@ -71,6 +72,7 @@ import { GoogleCalendarWidgetConfigComponent } from "./configs/widget/google_cal
CustomWidgetConfigComponent,
EtherpadWidgetConfigComponent,
GoogleCalendarWidgetConfigComponent,
GoogleDocsWidgetConfigComponent,
// Vendor
],

View File

@ -9,6 +9,7 @@ import { RiotHomeComponent } from "./riot/riot-home/home.component";
import { CustomWidgetConfigComponent } from "./configs/widget/custom/custom.widget.component";
import { EtherpadWidgetConfigComponent } from "./configs/widget/etherpad/etherpad.widget.component";
import { GoogleCalendarWidgetConfigComponent } from "./configs/widget/google_calendar/gcal.widget.component";
import { GoogleDocsWidgetConfigComponent } from "./configs/widget/google_docs/gdoc.widget.component";
const routes: Routes = [
{path: "", component: HomeComponent},
@ -40,6 +41,11 @@ const routes: Routes = [
component: GoogleCalendarWidgetConfigComponent,
data: {breadcrumb: "Google Calendar Widgets", name: "Google Calendar Widgets"}
},
{
path: "googledocs",
component: GoogleDocsWidgetConfigComponent,
data: {breadcrumb: "Google Doc Widgets", name: "Google Doc Widgets"}
},
],
},
],

View File

@ -0,0 +1,11 @@
<my-widget-config [widgetComponent]="this">
<ng-template #widgetParamsTemplate let-widget="widget">
<label class="label-block">
Document URL
<input type="text" class="form-control"
placeholder="https://docs.google.com/document/d/1V0olL42WJ84LNYn0kFBJaPmlRxQ4Trx97a5wfVMuJC8/edit"
[(ngModel)]="widget.dimension.newUrl" name="widget-url-{{widget.id}}"
[disabled]="isUpdating"/>
</label>
</ng-template>
</my-widget-config>

View File

@ -0,0 +1,13 @@
import { WidgetComponent } from "../widget.component";
import { WIDGET_GOOGLE_DOCS } from "../../../shared/models/widget";
import { Component } from "@angular/core";
@Component({
templateUrl: "gdoc.widget.component.html",
styleUrls: ["gdoc.widget.component.scss"],
})
export class GoogleDocsWidgetConfigComponent extends WidgetComponent {
constructor() {
super(WIDGET_GOOGLE_DOCS, "Google Docs Widget", "generic", "googleDocs");
}
}

View File

@ -147,8 +147,7 @@ export class RiotHomeComponent {
this.toaster.pop("error", errorMessage);
});
} else {
// TODO: Navigate to edit screen
console.log("EDIT SCREEN FOR " + integration.displayName);
console.log("Navigating to edit screen for " + integration.category + " " + integration.type);
this.router.navigate(['riot-app', integration.category, integration.type]);
}
}