summaryrefslogtreecommitdiffstats
path: root/web_src/js
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Make buttons in a modal form have proper type. (#25446) (#25478)" ↵wxiaoguang2023-06-241-2/+0
| | | | | | | | (#25484) There is a side effect because some modal doesn't have a proper "ok" button. This reverts commit 050c38ca19cce06040741321e7871121981c76f4.
* Make buttons in a modal form have proper type. (#25446) (#25478)Denys Konovalov2023-06-241-0/+2
| | | | | | | | | | Backport #25446 by @wxiaoguang Fix #25438 All non-"ok" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve wiki sidebar and TOC (#25460) (#25477)Giteabot2023-06-242-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #25460 by @wxiaoguang Close #20976 Close #20975 1. Fix the bug: the TOC in footer was incorrectly rendered as main content's TOC 2. Fix the layout: on mobile, the TOC is put above the main content, while the sidebar is put below the main content 3. Auto collapse the TOC on mobile ps: many styles of "wiki.css" are moved from old css files, so leave nits to following PRs. ### for desktop ![image](https://github.com/go-gitea/gitea/assets/2114189/6c84201c-0648-465a-99e6-c53cdaee53c0) ### for mobile ![image](https://github.com/go-gitea/gitea/assets/2114189/9cb4fdfe-b6ab-4e6f-ae82-219ddb8fa27e) ### other changed pages <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/ef077736-2c3e-4e3d-82fe-d9bf1ebcca98) ![image](https://github.com/go-gitea/gitea/assets/2114189/bb528429-ad5f-4258-a5c4-05f997c624ea) </details> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update JS dependencies, remove space after emoji completion (#25266) (#25352)silverwind2023-06-201-1/+3
| | | | | | | | | | | | | | | | | Manual backport of #25266 because of lockfile conflicts. - Update all JS dependencies - Enable stylint [`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown) - Make use of new features in webpack and text-expander-element - Tested Swagger and Mermaid To explain the `text-expander-element` change: Before this version, the element added a unavoidable space after emoji completion. Now that https://github.com/github/text-expander-element/pull/36 is in, we gain control over this space and I opted to remove it for emoji completion and retain it for `@` mentions. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix label list divider (#25312) (#25372)Giteabot2023-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | Backport #25312 by @wxiaoguang We only needs 2 lines to hide the dividers. ``` $dropdownLabelFilter.dropdown('setting', {'hideDividers': 'empty'}); $dropdownLabelFilter.dropdown('refreshItems'); ``` Other code blocks are refactored by the way. ![image](https://github.com/go-gitea/gitea/assets/2114189/74989996-fcea-4df4-b534-b06f7957939a) ![image](https://github.com/go-gitea/gitea/assets/2114189/ee3b3761-b96e-4fb5-b646-e9d3117e5f40) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove more unused Fomantic variants (#25292) (#25323)Giteabot2023-06-171-5/+1
| | | | | | | | | | | | | Backport #25292 by @silverwind Save another 50KB of CSS by removing unused and useless Fomantic variants. Removed the last instance of a `tertiary` button and fixed a TODO: <img width="509" alt="Screenshot 2023-06-15 at 22 34 36" src="https://github.com/go-gitea/gitea/assets/115237/8a16ae7b-2b17-439b-a096-60a52724e3d6"> Co-authored-by: silverwind <me@silverwind.io>
* Fix issue and commit status popup padding (#25254) (#25288)Giteabot2023-06-152-0/+2
| | | | | | | | | | | | | | Backport #25254 by @wxiaoguang Close #25249 Use "dialog" for the role ![image](https://github.com/go-gitea/gitea/assets/2114189/2b5b7552-48bc-4ecf-947b-34917232cff9) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Show OAuth2 errors to end users (#25261) (#25271)Giteabot2023-06-151-0/+6
| | | | | | | | | | | | | | | | Backport #25261 by @wxiaoguang Partially fix #23936 ![image](https://github.com/go-gitea/gitea/assets/2114189/8aa7f3ad-a5f0-42ce-a478-289a03bd08a3) ![image](https://github.com/go-gitea/gitea/assets/2114189/bb901e7d-485a-47a5-b68d-9ebe7013a6b2) ![image](https://github.com/go-gitea/gitea/assets/2114189/9a1ce0f3-f011-4baf-8e2f-cc6304bc9703) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use flex to align SVG and text (#25163) (#25260)Giteabot2023-06-144-5/+5
| | | | | | | | | | | | | | | | Backport #25163 by @wxiaoguang The code can be as simple as: ```html <div class="flex-text-block">{{svg "octicon-alert"}} {{svg "octicon-x"}} text (block)</div> <div><div class="flex-text-inline">{{svg "octicon-alert"}} {{svg "octicon-x"}} text</div> (inline)</div> <div><button class="ui red button">{{svg "octicon-alert" 24}} {{svg "octicon-x" 24}} text</button></div> ``` ![image](https://github.com/go-gitea/gitea/assets/2114189/1d3c10f1-0bc7-4c26-b236-bad537d5c465) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Change access token UI to select dropdowns (#25109) (#25230)Giteabot2023-06-131-106/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #25109 by @jtran The current UI to create API access tokens uses checkboxes that have a complicated relationship where some need to be checked and/or disabled in certain states. It also requires that a user interact with it to understand what their options really are. This branch changes to use `<select>`s. It better fits the available options, and it's closer to [GitHub's UI](https://github.com/settings/personal-access-tokens/new), which is good, in my opinion. It's more mobile friendly since the tap-areas are larger. If we ever add more permissions, like Maintainer, there's a natural place that doesn't take up more screen real-estate. This branch also fixes a few minor issues: - Hide the error about selecting at least one permission after second submission - Fix help description to call it "authorization" since that's what permissions are about (not authentication) Related: #24767. <img width="883" alt="Screenshot 2023-06-07 at 5 07 34 PM" src="https://github.com/go-gitea/gitea/assets/10803/6b63d807-c9be-4a4b-8e53-ecab6cbb8f76"> --- When it's open: <img width="881" alt="Screenshot 2023-06-07 at 5 07 59 PM" src="https://github.com/go-gitea/gitea/assets/10803/2432c6d0-39c2-4ca4-820e-c878ffdbfb69"> Co-authored-by: Jonathan Tran <jon@allspice.io>
* Fix task list checkbox toggle to work with YAML front matter (#25184) (#25227)Giteabot2023-06-131-0/+8
| | | | | | | | | | | | Backport #25184 by @jtran Fixes #25160. `data-source-position` of checkboxes in a task list was incorrect whenever there was YAML front matter. This would result in issue content or PR descriptions getting corrupted with random `x` or space characters when a user checked or unchecked a task. Co-authored-by: Jonathan Tran <jon@allspice.io>
* Remove hacky patch for "safari emoji glitch fix" (#25208) (#25211)Giteabot2023-06-122-27/+0
| | | | | | | | | | | Backport #25208 by @wxiaoguang According to my test, the UI (emoji) is fine in Safari And actually the code is just dead code, because the "resize" event is never fired on page loading. So for most cases users just view the pages without this hacky patch, nobody ever complains. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix fullscreen for action (#25200) (#25207)Giteabot2023-06-121-1/+1
| | | | | | | | | | | | | | Backport #25200 by @HesterG An error occurs when clicking on `show full screen` on action page. <img width="1440" alt="Screen Shot 2023-06-12 at 13 06 52" src="https://github.com/go-gitea/gitea/assets/17645053/1d4ded3c-fb77-4dd8-9201-24d0696f96eb"> class name has changed in #25134, so the selector is not working. Enhance the selectors to fix this. Co-authored-by: HesterG <hestergong@gmail.com>
* Fix strange UI behavior of cancelling dismiss review modal (#25172)silverwind2023-06-111-7/+0
| | | | | Backport clean cherry-picks of https://github.com/go-gitea/gitea/pull/25133 and https://github.com/go-gitea/gitea/pull/25162 to 1.20.
* Button and color enhancements (#24989) (#25176)silverwind2023-06-111-2/+2
| | | | | | | | | | | | | | | | | | Backport #24989. Clean cherry-pick aside from one small conflict with divider. - Various corrections to button styles, especially secondary - Remove focus highlight, it's annoying when it stays on button after press - Clearly define ghost and link buttons with demos in devtest - Remove black, grey and tertiary buttons, they should not be used - Make `arc-green` slightly darker <img width="1226" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/8d89786a-01ab-40f8-ae5a-e17f40e35084"> <img width="1249" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/83651e6d-3c27-46ff-b8bd-ff344d70e949">
* Fix mobile navbar and misc cleanups (#25134) (#25169)Giteabot2023-06-115-17/+17
| | | | | | | | | | | | | | | Backport #25134 by @silverwind - Fix and improve mobile navbar layout - Apply all cleanups suggested in https://github.com/go-gitea/gitea/pull/25111 - Make media query breakpoints match Fomantic's exactly - Clean up whitespace in class on navbar items Mobile navbar before and after: <img width="745" alt="Screenshot 2023-06-08 at 08 40 56" src="https://github.com/go-gitea/gitea/assets/115237/ca84b239-b10f-41db-8c06-dcf2b6dd9d28"> <img width="739" alt="Screenshot 2023-06-08 at 08 41 23" src="https://github.com/go-gitea/gitea/assets/115237/09133c54-eb7e-4110-858c-ead23c3b7521">
* Fix webauthn regression and improve code (#25113)wxiaoguang2023-06-072-30/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow: * #22697 There are some bugs in #22697: * https://github.com/go-gitea/gitea/pull/22697#issuecomment-1577957966 * the webauthn failure message is never shown and causes console error * The `document.getElementById('register-button')` and `document.getElementById('login-button')` is wrong * there is no such element in code * it causes JS error when a browser doesn't provide webauthn * the end user can't see the real error message These bugs are fixed in this PR. Other changes: * Use simple HTML/CSS layouts, no need to use too many `gt-` patches * Make the webauthn page have correct "page-content" layout * The "data-webauthn-error-msg" elements are only used to provide locale texts, so move them into a single "gt-hidden", then no need to repeat a lot of "gt-hidden" in code * The `{{.CsrfTokenHtml}}` is a no-op because there is no form * Many `hideElem('#webauthn-error')` in code is no-op because the `webauthn-error` already has "gt-hidden" by default * Make the tests for "URLEncodedBase64" really test with concrete cases. Screenshots: * Error message when webauthn fails (before, there is no error message): <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/93cf9559-d93b-4f06-9d98-0f7032d9c65b) </details> * Error message when webauthn is unavailable <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/ffc0fcd9-b93b-4418-979c-c89bb627aaf2) </details>
* Clean up WebAuthn javascript code and remove JQuery code (#22697)zeripath2023-06-063-135/+152
| | | | | | | | | | | | | | | | | There were several issues with the WebAuthn registration and testing code and the style was very old javascript with jquery callbacks. This PR uses async and fetch to replace the JQuery code. Ref #22651 Signed-off-by: Andrew Thornton <art27@cantab.net> --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: silverwind <me@silverwind.io>
* Use correct selector for hiding RSS icon link in the branch selector ↵wxiaoguang2023-06-051-2/+2
| | | | | | | | | | | | | | | | | dropdown (#25080) Fix #25079 ![image](https://github.com/go-gitea/gitea/assets/2114189/5d3f2f49-018a-4b75-8c90-ffafd898697a) ![image](https://github.com/go-gitea/gitea/assets/2114189/3e9dcf2e-eca7-4e96-be79-3b26f222cdb9) ![image](https://github.com/go-gitea/gitea/assets/2114189/855fffa4-0220-4ca2-a5e0-58c376fdc378) ![image](https://github.com/go-gitea/gitea/assets/2114189/f5ffa7e6-a974-4698-a45d-e38091903be1)
* Redesign Scoped Access Tokens (#24767)Jack Hay2023-06-042-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Changes - Adds the following high level access scopes, each with `read` and `write` levels: - `activitypub` - `admin` (hidden if user is not a site admin) - `misc` - `notification` - `organization` - `package` - `issue` - `repository` - `user` - Adds new middleware function `tokenRequiresScopes()` in addition to `reqToken()` - `tokenRequiresScopes()` is used for each high-level api section - _if_ a scoped token is present, checks that the required scope is included based on the section and HTTP method - `reqToken()` is used for individual routes - checks that required authentication is present (but does not check scope levels as this will already have been handled by `tokenRequiresScopes()` - Adds migration to convert old scoped access tokens to the new set of scopes - Updates the user interface for scope selection ### User interface example <img width="903" alt="Screen Shot 2023-05-31 at 1 56 55 PM" src="https://github.com/go-gitea/gitea/assets/23248839/654766ec-2143-4f59-9037-3b51600e32f3"> <img width="917" alt="Screen Shot 2023-05-31 at 1 56 43 PM" src="https://github.com/go-gitea/gitea/assets/23248839/1ad64081-012c-4a73-b393-66b30352654c"> ## tokenRequiresScopes Design Decision - `tokenRequiresScopes()` was added to more reliably cover api routes. For an incoming request, this function uses the given scope category (say `AccessTokenScopeCategoryOrganization`) and the HTTP method (say `DELETE`) and verifies that any scoped tokens in use include `delete:organization`. - `reqToken()` is used to enforce auth for individual routes that require it. If a scoped token is not present for a request, `tokenRequiresScopes()` will not return an error ## TODO - [x] Alphabetize scope categories - [x] Change 'public repos only' to a radio button (private vs public). Also expand this to organizations - [X] Disable token creation if no scopes selected. Alternatively, show warning - [x] `reqToken()` is missing from many `POST/DELETE` routes in the api. `tokenRequiresScopes()` only checks that a given token has the correct scope, `reqToken()` must be used to check that a token (or some other auth) is present. - _This should be addressed in this PR_ - [x] The migration should be reviewed very carefully in order to minimize access changes to existing user tokens. - _This should be addressed in this PR_ - [x] Link to api to swagger documentation, clarify what read/write/delete levels correspond to - [x] Review cases where more than one scope is needed as this directly deviates from the api definition. - _This should be addressed in this PR_ - For example: ```go m.Group("/users/{username}/orgs", func() { m.Get("", reqToken(), org.ListUserOrgs) m.Get("/{org}/permissions", reqToken(), org.GetUserOrgsPermissions) }, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryUser, auth_model.AccessTokenScopeCategoryOrganization), context_service.UserAssignmentAPI()) ``` ## Future improvements - [ ] Add required scopes to swagger documentation - [ ] Redesign `reqToken()` to be opt-out rather than opt-in - [ ] Subdivide scopes like `repository` - [ ] Once a token is created, if it has no scopes, we should display text instead of an empty bullet point - [ ] If the 'public repos only' option is selected, should read categories be selected by default Closes #24501 Closes #24799 Co-authored-by: Jonathan Tran <jon@allspice.io> Co-authored-by: Kyle D <kdumontnu@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Add up and down arrows to selected lookup repositories (#24727)Tyrone Yeh2023-06-021-2/+44
| | | | | | | | | | Use up and down arrow key to select repositories ![image](https://github.com/go-gitea/gitea/assets/1255041/3f3bce64-86d9-4b37-994b-3d129ebf48d9) --------- Co-authored-by: silverwind <me@silverwind.io>
* Show file tree by default (#25052)Kyle D2023-06-021-1/+2
| | | | | | | | | | | | | | | | Feel free to close this if there isn't interest. The tree view looks amazing, and all of our users are really enjoying it (major kudos to developers!), but only IF I tell them it exists! Essentially, the file tree view as it is effectively undiscoverable. This PR changes the default state for the tree view to open, which should significantly help with discoverability. An alternative could be to reserve more horizontal space, as a typical accordion panel would look (eg. VS Code), eg. ![image](https://github.com/go-gitea/gitea/assets/12700993/505ea40c-42b1-4111-b306-48e51e8e2130)
* Remove the service worker (#25010)silverwind2023-05-313-82/+0
| | | | | | | | | | | | | It's been disabled by default since 1.17 (https://github.com/go-gitea/gitea/pull/18914), and it never really delivered any benefit except being another cache layer that has its own unsolved invalidation issues. HTTP cache works, we don't need two cache layers at the browser for assets. ## :warning: BREAKING You can remove the config `[ui].USE_SERVICE_WORKER` from your `app.ini` now.
* Add show timestamp/seconds and fullscreen options to action page (#24876)HesterG2023-05-303-23/+200
| | | | | | | | | | | | | | | | | | | | Part of #24728 - The timestamp shows local time and is parsed by `date.toLocaleString`; - "show seconds" and "show timestamps" are mutually exclusive, and they can be both hidden. https://github.com/go-gitea/gitea/assets/17645053/89531e54-37b7-4400-a6a0-bb3cc69eb6f5 Update for timestamp format: <img width="306" alt="Screen Shot 2023-05-25 at 09 07 47" src="https://github.com/go-gitea/gitea/assets/17645053/2d99768d-d39c-4c9e-81a2-7bc7470399dd"> --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor diffFileInfo / DiffTreeStore (#24998)wxiaoguang2023-05-305-73/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | Follow #21012, #22399 Replace #24983, fix #24938 Help #24956 Now, the `window.config.pageData.diffFileInfo` itself is a reactive store, so it's quite easy to sync values/states by it, no need to do "doLoadMoreFiles" or "callback". Screenshot: these two buttons both work. After complete loading, the UI is also right. <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/cc6310fd-7f27-45ea-ab4f-24952a87b421) ![image](https://github.com/go-gitea/gitea/assets/2114189/4c11dd67-ac03-4568-8541-91204d27a4e3) ![image](https://github.com/go-gitea/gitea/assets/2114189/38a22cec-41be-41e6-a209-f347b7a4c1de) </details>
* Enable `vue/html-closing-bracket-spacing` eslint rule (#24987)silverwind2023-05-297-7/+7
| | | | | | Enable [`vue/html-closing-bracket-spacing`](https://eslint.vuejs.org/rules/html-closing-bracket-spacing.html) and set it to never add any useless spaces inside tags. All issues were fixed automatically with `make lint-js-fix`.
* Add PDF rendering via PDFObject (#24086)silverwind2023-05-292-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use [PDFObject](https://pdfobject.com/) to embed PDFs, replacing our outdated PDF.js copy we vendor (the last non-webpack vendoring). [Commit 1](https://github.com/go-gitea/gitea/pull/24086/commits/673e0263da64b72565ff59b990ab1b8e87271872) is the PDFObject integration [Commit 2](https://github.com/go-gitea/gitea/pull/24086/commits/9336f5769d54445bba0e16776164f6a2fe2c32ac) is the removal of PDF.js <img width="1251" alt="Screenshot 2023-05-27 at 09 57 52" src="https://github.com/go-gitea/gitea/assets/115237/169ce50c-bd1d-4bb0-86e5-1710bd0400a9"> <img width="1257" alt="Screenshot 2023-05-27 at 10 12 50" src="https://github.com/go-gitea/gitea/assets/115237/318f7ee9-fb11-4093-83e7-17475aa70629"> Fallback for unsupporting browsers (most mobile ones, except Firefox Mobile): <img width="358" alt="Screenshot 2023-05-27 at 09 43 34" src="https://github.com/go-gitea/gitea/assets/115237/8c12d7ba-57d6-4228-89a0-5fef9fad0cbb"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Repo list improvements, fix bold helper classes (#24935)silverwind2023-05-291-22/+58
| | | | | | | | | | | | | | - Fix bold helper classes that were broken because of CSS syntax error - Refined the repo list CSS and layout - Removing bold - Downsize the mirror icon to fit - Fix icon positions - Adapted the org list to match - Center the '+' icon and mute it <img width="385" alt="Screenshot 2023-05-25 at 18 38 31" src="https://github.com/go-gitea/gitea/assets/115237/ac8d6efb-5751-4845-a4ab-db1ddaf36ec3"> <img width="384" alt="Screenshot 2023-05-25 at 18 30 29" src="https://github.com/go-gitea/gitea/assets/115237/bbd39ae7-da9d-4c6f-bfe3-42f28b7a74c3">
* Improve and fix bugs surrounding reactions (#24760)silverwind2023-05-285-44/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Slightly decrease size of reaction buttons - Remove tooltip inside menu, it's obvious by the picture alone - Fix top menu triangle - Use `display: grid` to align icons in menu - Use regular tooltip for reaction users - Fix bug that deleted the reaction bar on clicking already reacted reaction in dropdown <img width="490" alt="Screenshot 2023-05-17 at 00 03 42" src="https://github.com/go-gitea/gitea/assets/115237/61588b37-facb-4829-b75b-e1cb5dda8ca4"> <img width="67" alt="Screenshot 2023-05-17 at 00 11 14" src="https://github.com/go-gitea/gitea/assets/115237/29605589-3b5f-40c6-8ad4-09923094bb8e"> <img width="211" alt="Screenshot 2023-05-17 at 00 29 30" src="https://github.com/go-gitea/gitea/assets/115237/7d2725da-6a3d-4e42-a351-53647f79f762"> <img width="210" alt="Screenshot 2023-05-17 at 00 29 54" src="https://github.com/go-gitea/gitea/assets/115237/b50f8364-033c-4445-ba25-61a814bb2d92"> <img width="892" alt="Screenshot 2023-05-17 at 00 12 20" src="https://github.com/go-gitea/gitea/assets/115237/30a46424-406a-46e5-b4de-47172eb8679d"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Add the ability to pin Issues (#24406)JakobDev2023-05-251-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to pin important Issues and Pull Requests. You can also move pinned Issues around to change their Position. Resolves #2175. ## Screenshots ![grafik](https://user-images.githubusercontent.com/15185051/235123207-0aa39869-bb48-45c3-abe2-ba1e836046ec.png) ![grafik](https://user-images.githubusercontent.com/15185051/235123297-152a16ea-a857-451d-9a42-61f2cd54dd75.png) ![grafik](https://user-images.githubusercontent.com/15185051/235640782-cbfe25ec-6254-479a-a3de-133e585d7a2d.png) The Design was mostly copied from the Projects Board. ## Implementation This uses a new `pin_order` Column in the `issue` table. If the value is set to 0, the Issue is not pinned. If it's set to a bigger value, the value is the Position. 1 means it's the first pinned Issue, 2 means it's the second one etc. This is dived into Issues and Pull requests for each Repo. ## TODO - [x] You can currently pin as many Issues as you want. Maybe we should add a Limit, which is configurable. GitHub uses 3, but I prefer 6, as this is better for bigger Projects, but I'm open for suggestions. - [x] Pin and Unpin events need to be added to the Issue history. - [x] Tests - [x] Migration **The feature itself is currently fully working, so tester who may find weird edge cases are very welcome!** --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Rework notifications list (#24812)silverwind2023-05-251-0/+24
| | | | | | | | | | | - Replace `<table>` with flexbox - Add issue modification time and issue number - Remove big title - Replace tabs with menu items - Add clicked item deletion on back button cache restoration --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve Actions CSS (#24864)silverwind2023-05-241-20/+43
| | | | | | | | | | | | | | | | | | | - Various color tweaks - Add sticky positioning to left sidebar, right header and right step header - Adjust margins and border radiuses <img width="1235" alt="Screenshot 2023-05-23 at 11 18 06" src="https://github.com/go-gitea/gitea/assets/115237/f601b00d-c7f2-43de-89f2-3ac55f2d9cdc"> <img width="1239" alt="Screenshot 2023-05-23 at 11 18 18" src="https://github.com/go-gitea/gitea/assets/115237/a2d24cc9-29fa-4c17-906b-84feea14b889"> ![](https://github.com/go-gitea/gitea/assets/115237/643910f2-a582-405d-bc93-36f2e54b5fda) ![](https://github.com/go-gitea/gitea/assets/115237/382a8a54-f1e3-4f08-affc-ea3108c02352) --------- Co-authored-by: yp05327 <576951401@qq.com>
* Run stylelint on .vue files (#24865)silverwind2023-05-231-7/+7
| | | | | | | - Run stylelint on .vue files - Fix discovered issues - Suppress warning spam from `declaration-strict-value` rule Co-authored-by: Giteabot <teabot@gitea.io>
* Improvements for action detail page (#24718)HesterG2023-05-222-52/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #24625 Main changes: 1. For the left panel, show rerun icon only on hover, and add style when the job is selected, and removed icon on the "rerun all" button and modify the text on the button https://github.com/go-gitea/gitea/assets/17645053/cc437a17-d2e9-4f1b-a8cf-f56e53962767 2. Adjust fonts, and add on hover effects to the log lines. And add loading effect when the job is done and the job step log is expanded for the first time. (With reference to github) https://github.com/go-gitea/gitea/assets/17645053/2808d77d-f402-4fb0-8819-7aa0a018cf0c 3. Add `gt-ellipsis` to `step-summary-msg` and `job-brief-name` <img width="898" alt="ellipsis" src="https://github.com/go-gitea/gitea/assets/17645053/e2fb7049-3125-4252-970d-15b0751febc7"> 4. Fixed https://github.com/go-gitea/gitea/issues/24625#issuecomment-1541380010 by adding explicit conditions to `ActionRunStatus.vue` and `status.tmpl` 5. Adjust some css styles --------- Co-authored-by: silverwind <me@silverwind.io>
* Change `--font-weight-bold` to `--font-weight-semibold` and 600 value, ↵silverwind2023-05-212-2/+2
| | | | | | | | | | | | | introduce new font weight variables (#24827) There was some recent discussion about this in Discord `ui-design` channel and the conclusion was that https://github.com/go-gitea/gitea/issues/24305 should have fixed their OS font installation to have semibold weights. I have now tested this 601 weight on a Windows 10 machine on Firefox myself, and I immediately noticed that bold was excessivly bold and rendering as 700 because browsers are biased towards bolder fonts. So revert this back to the previous value.
* Support Copy Link for video attachments (#24833)Brecht Van Lommel2023-05-211-0/+3
| | | Creating a `<video>` tag with controls and title.
* Improve accessibility when (re-)viewing files (#24817)delvh2023-05-216-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Visually, nothing should have changed. Changes include - Convert most `<a [no href]>` to `<button>` when (re-)viewing files: - `<a [no href]>` are, by HTML definition, not a link and hence cannot be focused - `<a class="ui button">` can now be clicked (again?) using <kbd>Enter</kbd> - Previously, the installed keypress handler on `.ui.button` elements disabled it for links somehow - The `(un)escape file`, the `expand section` and the `expand/collapse file` buttons can now be focused (and subsequently clicked using only the keyboard) - You can now press <kbd>Space</kbd> on a focused `View file` checkbox to mark the file as viewed. - previously, this was impossible as this checkbox listened on the wrong event listener The `add code comment` button has been left inaccessible for now as it requires quite a bit of extra logic so that it is unhidden when it is focused (you can otherwise focus it without seeing it as you are not hovering on the corresponding line). --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix duplicate tooltip hiding (#24814)silverwind2023-05-191-1/+1
| | | | | A tippy instance's role is actually on `props.role`. This makes duplicate tooltip hiding work again after https://github.com/go-gitea/gitea/pull/24688.
* Mute repo names in dashboard repo list (#24811)Yarden Shoham2023-05-191-1/+1
| | | | | | | | | | | | # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/24b80212-4a4d-44a7-99d5-a8c6b207225e) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/565b242a-f65d-450c-b43b-c4539a0f8b28) Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Implement actions artifacts (#22738)FuXiaoHei2023-05-191-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement action artifacts server api. This change is used for supporting https://github.com/actions/upload-artifact and https://github.com/actions/download-artifact in gitea actions. It can run sample workflow from doc https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts. The api design is inspired by https://github.com/nektos/act/blob/master/pkg/artifacts/server.go and includes some changes from gitea internal structs and methods. Actions artifacts contains two parts: - Gitea server api and storage (this pr implement basic design without some complex cases supports) - Runner communicate with gitea server api (in comming) Old pr https://github.com/go-gitea/gitea/pull/22345 is outdated after actions merged. I create new pr from main branch. ![897f7694-3e0f-4f7c-bb4b-9936624ead45](https://user-images.githubusercontent.com/2142787/219382371-eb3cf810-e4e0-456b-a8ff-aecc2b1a1032.jpeg) Add artifacts list in actions workflow page.
* Fix OAuth loading state (#24788)silverwind2023-05-181-18/+16
| | | | | | | | | | | | | | Fix regression from https://github.com/go-gitea/gitea/pull/24740 where the loading state was not showing because the `oauth-login-image` class was removed. Replaced the Fomantic loader with a pure CSS loader and cleaned up the HTML. Diff: https://github.com/go-gitea/gitea/pull/24788/files?diff=unified&w=1 ![](https://github.com/go-gitea/gitea/assets/115237/b5b4137f-9821-464b-9777-858fe85d9e03) Co-authored-by: Giteabot <teabot@gitea.io>
* Enable two vue eslint rules (#24780)silverwind2023-05-171-2/+0
| | | These two rules are no longer violated, so we can enable them again.
* Add two eslint plugins (#24776)silverwind2023-05-183-3/+3
| | | | | | | | Add these two plugins and autofix issues: - [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native) - [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
* Make the color of zero-contribution-squares in the activity heatmap more ↵Evur2023-05-171-2/+2
| | | | | | | | | subtle (#24758) The previous color had a too high contrast with the background. --------- Co-authored-by: silverwind <me@silverwind.io>
* Support for status check pattern (#24633)Zettat1232023-05-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR is to allow users to specify status checks by patterns. Users can enter patterns in the "Status Check Pattern" `textarea` to match status checks and each line specifies a pattern. If "Status Check" is enabled, patterns cannot be empty and user must enter at least one pattern. Users will no longer be able to choose status checks from the table. But a __*`Matched`*__ mark will be added to the matched checks to help users enter patterns. Benefits: - Even if no status checks have been completed, users can specify necessary status checks in advance. - More flexible. Users can specify a series of status checks by one pattern. Before: ![image](https://github.com/go-gitea/gitea/assets/15528715/635738ad-580c-49cd-941d-c721e5b99be4) After: ![image](https://github.com/go-gitea/gitea/assets/15528715/16aa7b1b-abf1-4170-9bfa-ae6fc9803a82) --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix WEBP image copying (#24743)silverwind2023-05-161-16/+11
| | | | | Fix regression from https://github.com/go-gitea/gitea/pull/23801, where I forgot that the new module will not throw, so the `catch` handlers were never triggered and in turn, the WEBP was not converted to PNG.
* Fix flash of unstyled content in action view page (#24712)Yarden Shoham2023-05-142-2/+2
| | | | | | | | | | | | | | # Before ![rec](https://github.com/go-gitea/gitea/assets/20454870/32f8e521-f743-4101-bd3c-923fd5abd893) # After ![rec](https://github.com/go-gitea/gitea/assets/20454870/070721d1-6749-43c1-ac18-d8c58e5f0901) Ref: https://github.com/go-gitea/gitea/issues/24625 Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Add status indicator on main home screen for each repo (#24638)Yarden Shoham2023-05-135-7/+32
| | | | | | | | | | | | | | | | | | | | It will show the calculated commit status state of the latest commit on the default branch for each repository in the dashboard repo list - Closes #15620 # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/aa1326c7-43c0-458a-a798-3102c766bcf9) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/8658cc03-2224-442a-b1c8-bf64126e4575) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
* Only hide tooltip tippy instances (#24688)silverwind2023-05-121-1/+4
| | | | | | Fix regression from https://github.com/go-gitea/gitea/pull/24648 where it was hiding non-tooltip tippy instances, like for example in the review panel which itself is a tippy instance, but with a different `role`.
* Remove svg.svg class, restore .rss-icon (#24667)silverwind2023-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix regression from https://github.com/go-gitea/gitea/pull/24476 where the `svg.svg` class misaligns SVG icons across the site and streched buttons unintentionally in vertical height. Before (button 30.3px): <img width="157" alt="Screenshot 2023-05-11 at 22 09 42" src="https://github.com/go-gitea/gitea/assets/115237/0fd137ab-ab52-4cf8-afca-c45776d526d0"> After (button 30px): <img width="160" alt="Screenshot 2023-05-11 at 22 09 59" src="https://github.com/go-gitea/gitea/assets/115237/4b741f4b-0fd2-4fae-9bee-16a7deb098e8"> [vertical-align: middle](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align) is not suitable to align icons to text because > Aligns the middle of the element with the baseline plus half the x-height of the parent. Example of `vertical-align: middle` from MDN: <img width="232" alt="Screenshot 2023-05-11 at 22 29 28" src="https://github.com/go-gitea/gitea/assets/115237/179fb756-85a1-4cab-8219-1a4958f333e2"> So I think the [existing](https://github.com/go-gitea/gitea/blob/365bb77a5497d492836bf823cf780c823db27e8c/web_src/css/svg.css#L3) `vertical-align: text-top` is generally still the best bet: <img width="241" alt="Screenshot 2023-05-11 at 22 34 24" src="https://github.com/go-gitea/gitea/assets/115237/0cd6edf5-12c0-4bdb-8771-a900f5ba2d35"> Co-authored-by: Giteabot <teabot@gitea.io>