Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit a8a0419

Browse files
committed
Added add button to connector types and plugin types.
1 parent 4a627a6 commit a8a0419

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

src/app/layouts/common-layout/common.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
&--quarter-size {
1515
@extend .mdl-cell, .mdl-cell--3-col-desktop, .mdl-cell--3-col-tablet, .mdl-cell--2-col-phone;
1616
}
17+
18+
&--sixth-size {
19+
@extend .mdl-cell, .mdl-cell--2-col-desktop, .mdl-cell--2-col-tablet, .mdl-cell--1-col-phone;
20+
}
1721
}
1822

1923
.card--title {
@@ -67,4 +71,8 @@
6771
@extend .mdl-button, .button--colored-teal;
6872
}
6973

74+
&--green {
75+
@extend .mdl-button, .button--colored-green;
76+
}
77+
7078
}

src/app/pages/betterrepl/betterrepl.component.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h2 class="card--title">Login / Register</h2>
4444
</div>
4545

4646

47-
<div class="card--third-size">
47+
<div class="card--half-size">
4848
<base-card>
4949
<base-card-title>
5050
<h2 class="card--title">Connector types</h2>
@@ -56,12 +56,15 @@ <h2 class="card--title">Connector types</h2>
5656
[style.background-image]="'url(' + connectorMetadata.get(connectorType).icon + ')'"
5757
class="connector-image"></div>
5858
{{ connectorMetadata.get(connectorType)?.displayName }} <span class="type">({{ connectorType }})</span>
59+
<button (click)="copyToAddConnector(connectorType)"
60+
class="button-trans--green mdl-js-button mdl-js-ripple-effect">
61+
<i class="material-icons">add</i>
62+
</button>
5963
<ul class="typeList">
6064
<li *ngIf="!connectorMetadata.get(connectorType)?.found">no metadata found.</li>
6165
<li
62-
*ngIf="connectorMetadata.get(connectorType)?.found">{{ connectorMetadata.get(connectorType)?.description }}</li>
63-
<li *ngIf="connectorMetadata.get(connectorType)?.found">More Information: <a
64-
[href]="connectorMetadata.get(connectorType)?.wikiUrl">Chat Overflow Wiki</a></li>
66+
*ngIf="connectorMetadata.get(connectorType)?.found">{{ connectorMetadata.get(connectorType)?.description }}
67+
More Information: <a [href]="connectorMetadata.get(connectorType)?.wikiUrl">Chat Overflow Wiki</a></li>
6568
</ul>
6669
</li>
6770
</ul>
@@ -109,14 +112,19 @@ <h2 class="card--title">Requirement types</h2>
109112
</base-card-body>
110113
</base-card>
111114
</div>
112-
<div class="card--third-size">
115+
<div class="card--sixth-size">
113116
<base-card>
114117
<base-card-title>
115118
<h2 class="card--title">Plugin types</h2>
116119
</base-card-title>
117120
<base-card-body>
118121
<ul class="typeList">
119-
<li *ngFor="let pluginType of pluginTypes">{{ pluginType.name }} ({{pluginType.author}})</li>
122+
<li *ngFor="let pluginType of pluginTypes">{{ pluginType.name }} ({{pluginType.author}})
123+
<button (click)="copyToAddPlugin(pluginType.name, pluginType.author)"
124+
class="button-trans--green mdl-js-button mdl-js-ripple-effect">
125+
<i class="material-icons">add</i>
126+
</button>
127+
</li>
120128
</ul>
121129
</base-card-body>
122130
</base-card>

src/app/pages/betterrepl/betterrepl.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,17 @@ export class BetterREPLComponent extends UpgradableComponent {
353353
this.mcrConnectorTypeValue = connectorKey.qualifiedConnectorType;
354354
}
355355

356+
copyToAddConnector(connectorType: string) {
357+
this.mcConnectorTypeValue = connectorType;
358+
this.mcSourceIdentifierValue = "";
359+
}
360+
361+
copyToAddPlugin(pluginName: string, pluginAuthor: string) {
362+
this.miPluginAuthorValue = pluginAuthor;
363+
this.miPluginNameValue = pluginName;
364+
this.miInstanceNameValue = "";
365+
}
366+
356367
getInstances() {
357368
this.instanceService.getInstances(this.authKey).subscribe((response: Array<PluginInstance>) => {
358369
if (this.pluginInstances) {

0 commit comments

Comments
 (0)