Skip to content

Commit

Permalink
add description preview to propmon ui
Browse files Browse the repository at this point in the history
  • Loading branch information
DZGoldman committed Sep 1, 2023
1 parent ff3e39c commit afb7ca0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src-ts/propMonUi/propMonUi.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
color: #1A2231;
}

div.desc{
background-color: #eaeaea;
padding: 10px;
}

table {
width: 100%;
border-collapse: collapse;
Expand Down Expand Up @@ -180,11 +185,17 @@ <h1>Proposal States</h1>

const proposalDiv = document.createElement('div');
governorDiv.appendChild(proposalDiv);
if (stage.proposalLink) {
if (stage.proposalLink) {
proposalDiv.innerHTML = `<h3><a target="_blank" href="${stage.proposalLink}">Proposal ID: ${stage.identifier}</a></h3>`;
} else {
proposalDiv.innerHTML = `<h3>Proposal ID: ${stage.identifier}</h3>`;
}
if (stage.description){
const descDiv = document.createElement('div');
descDiv.className = "desc";
descDiv.innerHTML = `<b>Description:</b> ${stage.description.slice(0,300)}...`
proposalDiv.appendChild(descDiv)
}

// Identify unique stages for the current proposal
const table = document.createElement('table');
Expand Down
2 changes: 2 additions & 0 deletions src-ts/proposalMonitorCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ interface PipelineStage {
explorerLink?: string;
proposalLink?: string;
children: PipelineStage[];
description?: string
}

interface GovernorStatus {
Expand Down Expand Up @@ -165,6 +166,7 @@ class JsonLogger {
explorerLink: e.publicExecutionUrl,
proposalLink,
children: [],
description: e.description
};

if (prevKey === originKey && !emittedStages.has(key)) {
Expand Down
6 changes: 5 additions & 1 deletion src-ts/proposalPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export interface TrackerEvent {
prevStage?: Omit<TrackerEvent, "status">;
publicExecutionUrl?: string;
error?: Error;
description?: string;

}

export class StageTracker extends EventEmitter {
Expand All @@ -84,7 +86,7 @@ export class StageTracker extends EventEmitter {
return super.on(eventName, listener);
}

private propagateTrackerSubcriptions(tracker: StageTracker) {}
private propagateTrackerSubscriptions(tracker: StageTracker) {}

public async run() {
let polling = true;
Expand All @@ -109,6 +111,8 @@ export class StageTracker extends EventEmitter {
status === ProposalStageStatus.EXECUTED
? await this.stage.getExecutionUrl()
: undefined,
// @ts-ignore
description: this.stage.description || undefined
});
currentStatus = status;
}
Expand Down

0 comments on commit afb7ca0

Please sign in to comment.