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

Commit 4a627a6

Browse files
committed
Added connector metadata display.
1 parent 8637534 commit 4a627a6

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,18 @@ <h2 class="card--title">Login / Register</h2>
5050
<h2 class="card--title">Connector types</h2>
5151
</base-card-title>
5252
<base-card-body>
53-
<ul class="typeList">
54-
<li *ngFor="let connectorType of connectorTypes">{{ connectorType }}
55-
<ul>
56-
<li>{{ connectorMetadata.get(connectorType)?.displayName }}</li>
53+
<ul>
54+
<li *ngFor="let connectorType of connectorTypes">
55+
<div *ngIf="connectorMetadata.get(connectorType)?.found"
56+
[style.background-image]="'url(' + connectorMetadata.get(connectorType).icon + ')'"
57+
class="connector-image"></div>
58+
{{ connectorMetadata.get(connectorType)?.displayName }} <span class="type">({{ connectorType }})</span>
59+
<ul class="typeList">
60+
<li *ngIf="!connectorMetadata.get(connectorType)?.found">no metadata found.</li>
61+
<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>
5765
</ul>
5866
</li>
5967
</ul>

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class BetterREPLComponent extends UpgradableComponent {
4242
private lastPassword = "";
4343

4444
private connectorTypes: Array<string>;
45-
private connectorMetadata: Map<string, ConnectorMetadata>;
45+
private connectorMetadata: Map<string, ConnectorMetadata> = new Map();
4646
private requirementTypes: RequirementTypes;
4747
private pluginTypes: Array<PluginType>;
4848

@@ -133,6 +133,13 @@ export class BetterREPLComponent extends UpgradableComponent {
133133
let allValues = response[key];
134134
for (let keyValue in allValues) {
135135
this.connectorMetadata.set(keyValue, allValues[keyValue]);
136+
137+
// Setting a placeholder display name for not found metadata
138+
if (!this.connectorMetadata.get(keyValue).found) {
139+
let fakeDisplayName = keyValue.substring(keyValue.lastIndexOf(".") + 1);
140+
fakeDisplayName.replace("Connector", "");
141+
this.connectorMetadata.get(keyValue).displayName = fakeDisplayName;
142+
}
136143
}
137144
}
138145
}, error => this.logGenericError("getConnectorsMetadata"));

src/app/pages/betterrepl/betterrepl.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,23 @@
2626

2727
.typeList {
2828
margin-left: -20px;
29-
font-size: 8pt;
29+
font-size: 8pt !important;
30+
}
31+
32+
.typeList a {
33+
font-size: 8pt !important;
34+
}
35+
36+
.type {
37+
font-size: 6pt !important;
38+
}
39+
40+
.connector-image {
41+
height: 16px;
42+
width: 16px;
43+
background-size: contain;
44+
display: inline-block;
45+
margin-right: 3px;
3046
}
3147

3248
#requestTypes > div > div {

0 commit comments

Comments
 (0)