Commit graph

1116 commits

Author SHA1 Message Date
Gusted
d5a1188086 Merge pull request 'feat: add partial quoting' (#5677) from gusted/forgejo-partial-qouting into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5677
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-11-05 20:13:04 +00:00
Gusted
7252445b4c Merge pull request '[PORT] Fix toAbsoluteLocaleDate and add more tests (gitea#32387)' (#5792) from gusted/forgejo-port-data-time into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5792
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-11-05 10:46:14 +00:00
silverwind
3bdca4615c
[PORT] Fix a number of typescript issues (gitea#32308)
- Prefer
[window.location.assign](https://developer.mozilla.org/en-US/docs/Web/API/Location/assign)
over assigning to
[window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location)
which typescript does not like. This works in all browsers including
PaleMoon.
- Fix all typescript issues in `web_src/js/webcomponents`, no behaviour
changes.
- ~~Workaround bug in `@typescript-eslint/no-unnecessary-type-assertion`
rule.~~
- Omit vendored file from type checks.
- `tsc` error count is reduce by 53 with these changes.

---
Conflict resolution: Choose our version.
Done differently: Everything related to typescript types isn't ported.
Use `window.location.href` instead of `String(window.location)`, thanks
@viceice!

(cherry picked from commit 810782302652d73c4f7249c4c3df8a7e85bae5f0)
2024-11-04 09:15:06 +01:00
wxiaoguang
9b442172fb
[PORT] Fix toAbsoluteLocaleDate and add more tests (gitea#32387)
---
Conflict resolution: None
Done differently: Removed typescript types.

(cherry picked from commit aee9801d468997ab3cce32978416b697d9df77a7)
2024-11-03 15:55:05 +01:00
wxiaoguang
bdd75c4b55
[PORT] Fix absolute-date (gitea#32375)
---
Conflict resolution: Trivial (package.json package-lock.json)
Done differently: Removed typescript types.

(cherry picked from commit ce4d909bd693fe903761eb835f7661e476a937ca)
2024-11-03 15:55:02 +01:00
JakobDev
4615891b9d feat: add button to create Markdown table (#5589)
This adds a new button to the Markdown toolbar, which allows creating the structure of a Markdown table. This makes it easier to wok with tables, as creating the structure by hand is annoying.

Screenshots:
https://codeberg.org/attachments/8bb00059-caa7-4453-b26c-15e4b7b93c83
https://codeberg.org/attachments/581e695c-33eb-4b81-9c63-a944aab443d9

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5589
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: JakobDev <jakobdev@gmx.de>
Co-committed-by: JakobDev <jakobdev@gmx.de>
2024-11-01 16:05:48 +00:00
Tom Neuber
68d5cf0e92
Add branch auto deletion for scheduled PRs 2024-10-31 03:49:15 +01:00
Otto
30838da15e Merge pull request 'fix: reset history.scrollRestoration if set to manual and no issue anchor in url' (#5684) from viceice/fix/ui/scroll-restoration into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5684
Reviewed-by: Otto <otto@codeberg.org>
2024-10-31 02:35:15 +00:00
Anbraten
8dc72589ca
Add typescript 2024-10-29 18:15:09 +01:00
Zettat123
8c79008d6f
Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix an issue related to user search (#32288)
These settings can allow users to only display the repositories explore page.

Thanks to yp05327 and wxiaoguang !

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 9206fbb55fd28f21720072fce6a36cc22277934c)

Conflicts:
	 - templates/explore/navbar.tmpl
	   Resolved by manually applying the last hunk to our template.
2024-10-27 11:27:40 +01:00
Gusted
2c2ac80030 feat: Add partial quoting
- If you select a portion of the comment, `Quote reply` will not only
quote that portion and not copy paste the whole text as it previously
did. This is achieved by using the `@github/quote-selection` package.
- There's preprocessing to ensure Forgejo-flavored markdown syntax is
preserved.
- e2e test added.
- Resolves #1342
2024-10-26 19:15:43 +02:00
Michael Kriese
ec4a0e1b6e
fix: reset history.scrollRestoration if set to manual and no issue anchor in url 2024-10-24 15:25:51 +02:00
Gusted
7a29ab4d20 Merge pull request 'chore: move to Eslint flat config' (#5662) from gusted/forgejo-flat-config into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5662
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-10-23 14:00:28 +00:00
Gusted
3a4bc7cdd1 Merge pull request 'feat: use combo markdown editor for milestone description' (#5657) from gusted/forgejo-milestone-comboeditor into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5657
Reviewed-by: Otto <otto@codeberg.org>
2024-10-23 13:38:35 +00:00
Gusted
7ad83fce40 chore: move to Eslint flat config
Make the big move to Eslint flat config format. The outcome of Eslint
still should be the same, but some things has changed:
- `eslint-plugin-github` is dropped, flat configs have been out for a
while and most eslint plugins support it, but for no reason and no
activity in sight this plugin is likely not going to support flat config
for a while and to avoid other plugins not being able to update (as they
are requiring flat configs) drop the github rules.
- Nested configs don't work properly and are unified into the root
eslint config, this unification did cause some conflicts and thats why
the `import-x` is in a seperate 'group' to exclude targeting Vue files.
- The `eslint-plugin-i` is deprecated and `esplint-plugin-import-x` is
its succesor which has better support for flat configs, the same rules
are still applied.

The majority of the flat config was generated by
`@eslint/migrate-config` tool.
2024-10-23 15:28:43 +02:00
Gusted
f63f02045e
chore: add new lint rules 2024-10-23 08:10:18 +02:00
Gusted
4c6587d6a0 feat: use combo markdown editor for milestone description
- Use the combo markdown editor for the milestone description. The
milestone description is rendered in markdown, so it makes sense to use
a 'markdown-aware' editor. This also includes the option to use
monospace font.
- Resolves #5649
2024-10-22 19:58:44 +02:00
cloudchamb3r
c163bf6fb5
Fix null errors on conversation holder (#32258) (#32266)
fix #32258

Errors in the issue was due to unhandled null check. so i fixed it.

### Detailed description for Issue & Fix
To reproduce that issue, the comment must be deleted on Conversation
tab.
#### Before Delete
<img width="1032" alt="image"
src="https://github.com/user-attachments/assets/72df61ba-7db6-44c9-bebc-ca1178dd27f1">

#### After Delete (AS-IS)
<img width="1010" alt="image"
src="https://github.com/user-attachments/assets/36fa537e-4f8e-4535-8d02-e538c50f0dd8">

gitea already have remove logic for `timeline-item-group`, but because
of null ref exception the later logic that removes `timeline-item-group`
could be not be called correctly.

(cherry picked from commit 603fca1e27bc29c1e700cc1bd284eb619d2436c8)
2024-10-20 09:35:34 +02:00
a1012112796
3aaf6f72d6
make show stats work when only one file changed (#32244)
fix https://github.com/go-gitea/gitea/issues/32226

in https://github.com/go-gitea/gitea/pull/27775 , it do some changes to
only show diff file tree when more than one file changed. But looks it
also break the `diff-file-list` logic, which looks not expected change.
so try fix it.

/cc @silverwind

example view:

![image](https://github.com/user-attachments/assets/281e9c4f-a269-4d36-94eb-a132058aea87)

Signed-off-by: a1012112796 <1012112796@qq.com>
(cherry picked from commit c4b2808b896dd86323c6a0d119c8cf24752d4d8a)
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>

Conflicts:
	- web_src/js/features/repo-diff-filetree.js
	  web_src/js/features/repo-diff.js
	  Conflicts resolved by manually applying the changes.
2024-10-20 09:29:33 +02:00
Gusted
b43d9d5ae6 Merge pull request 'fix: Don't double escape delete branch text' (#5615) from gusted/forgejo-avoid-double-escape into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5615
Reviewed-by: Otto <otto@codeberg.org>
2024-10-19 21:21:33 +00:00
Gusted
8c8b31f304
fix: Don't double escape delete branch text
- Don't double escape the 'Delete branch "$BRANCH"' text. `Locale.Tr`
escapes the argument already and Vue does too by default.
- Let Vue escape the text and add a unit test ensuring that it escapes.
- Resolves #5582
2024-10-19 22:05:35 +02:00
cloudchamb3r
68aa530fb2
Fix checkbox bug on private/archive filter (#32236)
fix #32235

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit cb739f533358a8cf6e1b6875b3d4f0da3bfa7c95)
2024-10-13 14:17:08 +03:00
cloudchamb3r
eff28911d3
Add null check for responseData.invalidTopics (#32212)
<img width="553" alt="Screenshot 2024-10-08 at 10 49 10 AM"
src="https://github.com/user-attachments/assets/faeef64d-684a-4aba-b7fc-c7c6a0301abe">

`responseData.invalidTopics` can be null but it wasn't handled.

(cherry picked from commit 2e12343fc4ca96a215d6820c4467b619eaa5cbe9)
2024-10-13 08:06:49 +03:00
TimedIn
e988a25237 Small fixes and rename for #5482
- New Issue Fixed assign me being hidden after assignees were cleared https://codeberg.org/forgejo/forgejo/pulls/5482/files#issuecomment-2365431
- Test for verifying the above
- Removed wait for network idle from e2e test
- Renamed templ key assigneeId to assigneeIds
2024-10-09 14:17:41 +02:00
TimedIn
2feb3d03d7 feat: "assign to me" button on PRs and issues
includes:
Tests for assignees on issues
Move assignees selector of new Issue to assignees.tmpl
2024-10-08 18:36:37 +02:00
Lunny Xiao
5ccf79d05c
Include collaboration repositories on dashboard source/forks/mirrors list (#31946)
Fix #13489

In the original implementation, only `All` will display your owned and
collaborated repositories. For other filters like `Source`, `Mirrors`
and etc. will only display your owned repositories.

This PR removed the limitations. Now except `collbrations`, other
filters will always display your owned and collaborated repositories.

(cherry picked from commit 4947bec8360c152daca23e120eae1732d3848492)
2024-09-29 10:28:08 +02:00
Bram Hagens
4a74113dee
feat(ui): add more emoji and code block rendering in issues 2024-09-24 14:20:33 +02:00
Sai Nane
b42ca2ed0c Revert repo-legacy.js to pre-#4542
The New Issue form should not use the new HTMX system. This first requires
we restore the ability to locally assign the milestone ID.
2024-09-17 17:45:02 +02:00
silverwind
ebd32d626f
Improve textarea paste (part of gitea#31948)
When pasting a URL over another URL, replace the URL instead of creating
a useless `[url](url)`.

(Partially picked from commit 55502265716f000a2c61c98fa093244e1310d97f)

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-09-09 10:04:50 +02:00
Lunny Xiao
bb8796b3be
fix: replace v-html with v-text in branch search inputbox
Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
(cherry picked from commit 7eef261c3ebf9bfe37fe0dceb51bde9a79bbaf17)
2024-09-06 11:59:11 +02:00
Gusted
cbedd7e5be Merge pull request '[PORT] Enable no-jquery/no-class-state (gitea#31639) & Remove eslint-plugin-jquery (gitea#31402)' (#5107) from gusted/forgejo-port-gt-31402 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5107
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
2024-08-26 00:01:43 +00:00
silverwind
98349a1889
[PORT] Enable no-jquery/no-class-state (gitea#31639)
Just 4 validations and I specifically tested this by
selecting/unselecting issue labels.

Co-authored-by: Giteabot <teabot@gitea.io>

---
Clean port. Fixed two additional warnings

(cherry picked from commit 3a7454df7a518f810fbeb34b9d784e7c29d173ff)
2024-08-25 02:57:50 +02:00
Gusted
4f54918381 Merge pull request 'fix(ui): prevent exceptions on other users' repo migration pages' (#4875) from solomonv/forgejo:fix-migration-guest-exception into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4875
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-08-24 23:49:20 +00:00
Gusted
b061a14e15
[PORT] Unicorn eslint plugins configs
Ported from https://github.com/go-gitea/gitea/pull/31766 &
https://github.com/go-gitea/gitea/pull/31402 & https://github.com/go-gitea/gitea/pull/30840
2024-08-24 22:31:34 +02:00
Otto
0c02a61319 Merge pull request '[CHORE] Proper chunking for swagger' (#5056) from gusted/forgejo-chunking into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5056
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>
2024-08-22 21:13:19 +00:00
Bram Hagens
d39c8fec8c
ui: update pull request icons
Added a new icon for closed PRs (similar to GitHub, GitLab, etc),
Fixes https://codeberg.org/forgejo/forgejo/issues/4454.

Before:
- https://codeberg.org/attachments/b17c5846-506f-4b32-97c9-03f31c5ff758
- https://codeberg.org/attachments/babcd011-d340-4a9e-94db-ea17ef6d3c2b
- https://codeberg.org/attachments/dbca009a-413e-48ab-84b1-55ad7f4fcd3d

After:
- https://codeberg.org/attachments/3e161f7b-4172-4a8c-a8eb-54bcf81c0cae
- https://codeberg.org/attachments/0c308f7e-25a0-49a3-9c86-1b1f9ab39467
- https://codeberg.org/attachments/b982b6b8-c78a-4332-8269-50d01de834e0

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4455
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Bram Hagens <bram@bramh.me>
Co-committed-by: Bram Hagens <bram@bramh.me>
2024-08-22 17:06:10 +02:00
Gusted
9eb22ddc19
[CHORE] Proper chunking for swagger
- Tell webpack to chunk the swagger-ui dependency, so it can be re-used for the
forgejo-swagger.js and swagger.js files (these two files are two
seperate javascript files in the output).
- This saves off 400KB when Forgejo is built with the `bindata` build
tag.
2024-08-22 15:48:05 +02:00
Solomon Victorino
a4814bca2d fix(ui): prevent exceptions on other users' repo migration pages
- don't expect the retry button to always be attached
- don't parse status response as JSON when it was a login redirect
- add E2E test
2024-08-21 19:57:08 +00:00
Otto Richter
83d2b3b7fa Implement CSS-only input toggling, refactor related forms
UX/Translation changes:

- new teams: remove redundant tooltips that don't add meaningful information
  - move general information to table fieldset
- new teams: rename "general" to "custom" access for clarity
- new teams: show labels beside options on mobile

Accessibility:

- semantic form elements allow easier navigation (fieldset, mostly)
- improve better labelling of new teams table
- fix accessibility scan issues
- TODO: the parts that "disable" form elements were not yet touched and
  are not really accessible to screenreaders

Technical:

- replace two JavaScript solutions with one CSS standard
- implement a simpler grid (.simple-grid)
- simplify markup
- remove some webhook settings specific CSS

Testing:

- check more form content for accessibility issues
- but exclude tooltips from the scan :(
- reuse existing form tests from previous PR
2024-08-21 15:03:19 +02:00
Earl Warren
c76a73ad35 Merge pull request '[gitea] week 2024-34 cherry pick (gitea/main -> forgejo)' (#4998) from earl-warren/wcp/2024-34 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4998
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-08-20 06:32:09 +00:00
Otto Richter
c9e402afdc feat(tmpl): Introduce semantic HTML in forms
Modifies forms:

- (new) org team
- (new) repo webhook
- (new) repo protected branch

The forms are not completely rewritten to semantic HTML yet. The focus
of this change was on standard elements, some custom solutions were left
untouched for now.

- swaps the order fo permission radio buttons as per https://codeberg.org/forgejo/forgejo/issues/4983
- uses fieldsets to group related inputs
  - ensures consistent styling across forms
  - can be improved later, e.g. using horizontal lines between sections
- fixes: previous font size of labels was smaller than the font size of the help text
- help text are now part of the label, clicking them now also activates the input
- drop unused CSS (no required checkboxes in grouped class remain)
- playwright testing:
  - move login boilerplate to utils
  - automated form accessibility checking
    - allow defining the scope, because legacy parts of the forms are not yet accessible
  - assert some CSS properties that should not be overriden
- the Makefile adjustment was necessary, because eslint scanned some internal files in the tests/e2e/reports directory
2024-08-19 01:14:18 +02:00
Gusted
72f41306c2
[UI] Fix misalignment of authors for repo acctivity
- Regression of #4571
- We aren't showing the ticks generated by chartjs, because we want to
show the avatar of the person instead. You can't *realy* disable that
tick, so instead I opted to make them transparent in #4571, however they
still affected the generation of ticks so if enough authors were being
shown, for some the ticks were being skipped. Adjust the settings to
make sure they are always being shown.
- Resolves https://codeberg.org/forgejo/forgejo/issues/4982
2024-08-18 21:18:29 +02:00
Adrian Hirt
1dfa11551c
Fix overflowing content in action run log (#31842)
When a long line with characters such as dots is returned by a step in
an action (e.g. by the output of the Ruby on Rails test runner), it
overflows the log container, causing the page to scroll sideways.

This PR adds the CSS `overflow-wrap: anywhere;` to the
`.job-step-section .job-step-logs .job-log-line .log-msg` selector,
which causes such lines to wrap as well

(cherry picked from commit 61aaf3440142d225802e3e9ce3db28bcf71f5a7e)
2024-08-18 06:28:26 +02:00
Solomon Victorino
b8a5ca2c40 fix(ui): allow unreacting from comment popover
- fix selectors for hasReacted
- don't send empty HTML on reaction errors
- add E2E test
2024-08-09 10:17:04 -06:00
Solomon Victorino
3ee5bc262f fix(ui): handle out-of-bounds end line in code selection (#4788)
- fallback to the last line, preventing TypeError
- add E2E test

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4788
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Solomon Victorino <git@solomonvictorino.com>
Co-committed-by: Solomon Victorino <git@solomonvictorino.com>
2024-08-05 04:45:07 +00:00
Earl Warren
94933470cd Merge pull request 'Implement external release assets' (#1445) from maltejur/forgejo:forgejo-external-attachments into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1445
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
2024-07-30 15:50:57 +00:00
Earl Warren
7b798a88ee Merge pull request 'fix(UI): issue task list numbers, fix #4431' (#4452) from mahlzahn/forgejo:fix_issue_task_list_numbers_issue_4431 into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4452
Reviewed-by: Beowulf <beowulf@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2024-07-29 20:50:42 +00:00
Malte Jürgens
a61e7c7a39
Implement external assets 2024-07-29 20:35:55 +02:00
silverwind
2cf91d58e7
[PORT] Enable no-jquery/no-parse-html-literal and fix violation (gitea#31684)
Tested it, path segment creation works just like before.

---

Conflict resolution: trivial, also ported code from
https://github.com/go-gitea/gitea/pull/31283
2024-07-28 16:52:02 +02:00
Robert Wolff
a96b86778f fix unchecking check boxes like [X] 2024-07-28 14:18:34 +00:00