loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): release: set default release title to tag name (#6883)

This fixes a regression bug introduced in the new feature added by #6645

Currently the validation will fail if you keep the default added release title.

The test was changed to fail without the fix.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6883
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>

authored by

Beowulf
Beowulf
and committed by
Earl Warren
b88baac7 de3e6f8a

+6 -3
+1 -2
tests/e2e/release.test.e2e.ts
··· 30 30 await validate_form({page}, 'fieldset'); 31 31 const textarea = page.locator('input[name=tag_name]'); 32 32 await textarea.pressSequentially('2.0'); 33 - await expect(page.locator('input[name=title]')).toHaveAttribute('placeholder', '2.0'); 34 - await page.fill('input[name=title]', '2.0'); 33 + await expect(page.locator('input[name=title]')).toHaveValue('2.0'); 35 34 await page.click('#add-external-link'); 36 35 await page.click('#add-external-link'); 37 36 await page.fill('input[name=attachment-new-name-2]', 'Test');
+5 -1
web_src/js/features/repo-release.js
··· 32 32 const newTagHelperText = el.getAttribute('data-tag-helper-new'); 33 33 const existingTagHelperText = el.getAttribute('data-tag-helper-existing'); 34 34 35 + let previousTag = ''; 35 36 document.getElementById('tag-name').addEventListener('keyup', (e) => { 36 37 const value = e.target.value; 37 38 const tagHelper = document.getElementById('tag-helper'); ··· 45 46 } 46 47 47 48 const title_input = document.getElementById('release-title'); 48 - title_input.placeholder = value; 49 + if (!title_input.value || previousTag === title_input.value) { 50 + title_input.value = value; 51 + } 52 + previousTag = value; 49 53 }); 50 54 } 51 55