Ver a proveniência

Adds/handles title limit on cloud patches

main
Eric Amodio há 1 ano
ascendente
cometimento
50a31faa05
2 ficheiros alterados com 7 adições e 2 eliminações
  1. +5
    -0
      src/plus/drafts/draftsService.ts
  2. +2
    -2
      src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts

+ 5
- 0
src/plus/drafts/draftsService.ts Ver ficheiro

@ -82,6 +82,11 @@ export class DraftService implements Disposable {
} satisfies CreateDraftRequest),
});
if (!createDraftRsp.ok) {
const json = (await createDraftRsp.json()) as { error?: { message?: string } } | undefined;
throw new Error(json?.error?.message ?? createDraftRsp.statusText);
}
const createDraft = ((await createDraftRsp.json()) as DraftResult).data;
const draftId = createDraft.id;

+ 2
- 2
src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts Ver ficheiro

@ -118,12 +118,12 @@ export class GlPatchCreate extends GlTreeBase {
</div>`,
)}
<div class="message-input">
<input id="title" type="text" class="message-input__control" placeholder="Title (required)" .value=${
<input id="title" type="text" class="message-input__control" placeholder="Title (required)" maxlength="100" .value=${
this.create.title ?? ''
} @input=${this.onTitleInput}></textarea>
</div>
<div class="message-input">
<textarea id="desc" class="message-input__control" placeholder="Description (optional)" .value=${
<textarea id="desc" class="message-input__control" placeholder="Description (optional)" maxlength="10000" .value=${
this.create.description ?? ''
} @input=${this.onDescriptionInput}></textarea>
</div>

Carregando…
Cancelar
Guardar