Skip to content

Commit 5f94c06

Browse files
committed
Add error message
1 parent e04b497 commit 5f94c06

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/webviews/apps/commitDetails/components/gl-inspect-patch.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,29 @@ export class InspectPatch extends GlElement {
262262
.user-selection__check:not(.is-active) {
263263
opacity: 0;
264264
}
265+
266+
.alert {
267+
display: flex;
268+
flex-direction: row;
269+
align-items: center;
270+
padding: 0.8rem 1.2rem;
271+
line-height: 1.2;
272+
background-color: var(--color-alert-errorBackground);
273+
border-left: 0.3rem solid var(--color-alert-errorBorder);
274+
color: var(--color-alert-foreground);
275+
}
276+
277+
.alert code-icon {
278+
margin-right: 0.4rem;
279+
vertical-align: baseline;
280+
}
281+
282+
.alert__content {
283+
font-size: 1.2rem;
284+
line-height: 1.2;
285+
text-align: left;
286+
margin: 0;
287+
}
265288
`,
266289
];
267290

src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,16 @@ export class GlPatchCreate extends GlTreeBase {
310310
</div>`,
311311
)}
312312
</div>
313+
314+
${when(
315+
this.generate?.error != null,
316+
() => html`
317+
<div class="alert alert--error">
318+
<code-icon icon="error"></code-icon>
319+
<p class="alert__content">${this.generate!.error!.message ?? 'Error retrieving content'}</p>
320+
</div>
321+
`,
322+
)}
313323
<div class="message-input">
314324
<textarea
315325
id="desc"

0 commit comments

Comments
 (0)