瀏覽代碼

Adds/handles title limit on cloud patches

main
Eric Amodio 1 年之前
父節點
當前提交
50a31faa05
共有 2 個文件被更改,包括 7 次插入2 次删除
  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 查看文件

@ -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 查看文件

@ -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>

Loading…
取消
儲存