aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
Commit message (Collapse)AuthorAgeFilesLines
* Replace unstyled meter with progress (#19968)silverwind2022-06-151-2/+2
| | | | | | Replace the only `<meter>` element in use with a `<progress>` which is styled properly. Also slightly adjust colors on it for better contrast. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prettify number of issues (#17760)Gusted2022-06-124-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prettify number of issues - Use the PrettyNumber function to add commas in large amount of issues. * Use client-side formatting * prettify on both server and client * remove unused i18n entries * handle more cases, support other int types in PrettyNumber * specify locale to avoid issues with node default locale * remove superfluos argument * introduce template helper, octicon tweaks, js refactor * Update modules/templates/helper.go * Apply some suggestions. * Add comment * Update templates/user/dashboard/issues.tmpl Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Auto merge pull requests when all checks succeeded via WebUI (#19648)65432022-06-112-10/+126
| | | | | | | | Add WebUI part of Auto merge feature close #19621 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Custom regexp external issues (#17624)Sandro Santilli2022-06-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement custom regular expression for external issue tracking. Signed-off-by: Alexander Beyn <malex@fatelectrons.org> * Fix syntax/style * Update repo.go * Set metas['regexp'] * gofmt * fix some tests * fix more tests * refactor frontend * use LRU cache for regexp * Update modules/markup/html_internal_test.go Co-authored-by: Alexander Beyn <malex@fatelectrons.org> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Feature: Find files in repo (#15028)Roger Luo2022-06-095-1/+118
| | | | | | | | | | | | | | | | * Create finding files page ui in repo page * Get tree entries for find repo files. * Move find files JS to individual file. * gen swagger. * Add enry.IsVendor to exclude entries Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix viewed images not loading in a PR (#19919)wxiaoguang2022-06-081-1/+2
| | | | Close #19651
* A minimal change to replace data calls with attr as per guidelines (#19900)André Jaenisch2022-06-061-1/+1
| | | | | | | | | This affects the manage topics on a repository. Namely the done button once changes are made. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* use exact search instead of fuzzy search for branch filter dropdown (#19885)wxiaoguang2022-06-041-4/+4
|
* Remove customized (unmaintained) dropdown, improve aria a11y for dropdown ↵wxiaoguang2022-06-035-4348/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#19861) * Remove customized (unmaintained) dropdown, improve aria a11y for dropdown * fix repo permission * use action instead of onChange * re-order the CSS selector * fix dropdown behavior for repo permissions, make elements inside menu item non-focusable * use menu/menuitem instead of combobox/option. use tooltip(data-content) for aria-label, prevent from repeated attaching * click menu item when pressing Enter * code format * fix repo permission * repo setting: prevent from misleading users when error occurs * fine tune the repo collaboration access mode dropdown (in case the access mode is undefined in the template) Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove fomantic progress module (#19760)silverwind2022-05-201-3/+0
| | | | Replace it with HTML `<progress>` element. The bar won't go green at 100% anymore but I think it's not something that fits stylistically anyways.
* Make Ctrl+Enter (quick submit) work for issue comment and wiki editor (#19729)wxiaoguang2022-05-204-10/+46
| | | | | | | * Make Ctrl+Enter (quick submit) work for issue comment and wiki editor * Remove the required `SubmitReviewForm.Type`, empty type (triggered by quick submit) means "comment" * Merge duplicate code
* Replace blue button and label classes with primary (#19763)silverwind2022-05-202-3/+1
| | | | | | | | | | | | | | | * make blue really blue * replace blue button and label classes with primary * add --color-blue-dark * add light color variants, tweak a few colors * fix colors * add comment Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use Vue to refactor pull merge UI (#19650)wxiaoguang2022-05-124-28/+143
| | | | | | | | | | | | | | | | | * Use Vue to refactor pull merge UI * add comments * fix comments * small fine tune * fix tests * adopt new pull default messages * clean up Co-authored-by: 6543 <6543@obermui.de>
* Update JS dependencies (#19675)silverwind2022-05-101-0/+5
| | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies minus vue and vue-loader - Adapt to jest 28 - Add new eslint rules - Tested Mermaid and Swagger-UI * switch to @happy-dom/jest-environment for faster tests * bump eslint env to es2022
* Allow to mark files in a PR as viewed (#19007)delvh2022-05-075-7/+103
| | | Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
* prevent double click new issue/pull/comment button (#16157)a10121127962022-05-071-0/+12
| | | | | | | | | | * prevent double click new issue/pull/comment button when network is not good, these button maybe double clicked, then more than one same issues pulls or comments will be created. this pull request will fix this bug. Signed-off-by: a1012112796 <1012112796@qq.com>
* Improve reviewing PR UX (#19612)Gusted2022-05-072-1/+26
|
* Add "Allow edits from maintainer" feature (#18002)qwerty2872022-04-282-0/+35
| | | | | | | | | | | | | | | | | Adds a feature [like GitHub has](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (step 7). If you create a new PR from a forked repo, you can select (and change later, but only if you are the PR creator/poster) the "Allow edits from maintainers" option. Then users with write access to the base branch get more permissions on this branch: * use the update pull request button * push directly from the command line (`git push`) * edit/delete/upload files via web UI * use related API endpoints You can't merge PRs to this branch with this enabled, you'll need "full" code write permissions. This feature has a pretty big impact on the permission system. I might forgot changing some things or didn't find security vulnerabilities. In this case, please leave a review or comment on this PR. Closes #17728 Co-authored-by: 6543 <6543@obermui.de>
* Improve dashboard's repo list performance (#18963)Gusted2022-04-261-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve dashboard's repo list performance - Avoid a lot of database lookups for all the repo's, by adding a undocumented "minimal" mode for this specific task, which returns the data that's only needed by this list which doesn't require any database lookups. - Makes fetching these list faster. - Less CPU overhead when a user visits home page. * Refactor javascript code + fix Fork icon - Use async in the function so we can use `await`. - Remove `archivedFilter` check for count, as it doesn't make sense to show the count of repos when you can't even see them(as they are filited away). * Add `count_only` * Remove uncessary code * Improve comment Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * By default apply minimal mode * Remove `minimal` paramater * Refactor count header * Simplify init Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Allow commit status popup on /pulls page (#19507)parnic2022-04-263-13/+20
| | | | | | | | | | | * Allow commit status popup on /pulls page The /pulls page doesn't contain a "repository" element, so the early-out here was preventing the commit status popup hook from working. However, the only thing the .repository element is being used for here is determining whether the popup should be on the right or on the left, so we don't actually need the element to exist for the hook to work. Pull request #19375 allows the statuses on /pulls pages to appear clickable, but this commit is required to make the popup actually work there. * Move commit statuses popup hook to dedicated func * Add missing import
* Add a new menu in file view to open blame view and fix blame view select ↵Lunny Xiao2022-04-261-4/+18
| | | | range bug (#19500)
* Fix two UI bugs: JS error in imagediff.js, 500 error in diff/compare.tmplwxiaoguang2022-04-261-4/+11
| | | Co-authored-by: 6543 <6543@obermui.de>
* Improve Stopwatch behavior (#18930)Gusted2022-04-251-0/+4
| | | | - Don't send empty stopwatch over and over again, only send once. - Stop interval to update stopwatch's timer when there is no more stopwatch.
* Never use /api/v1 from Gitea UI Pages (#19318)Lunny Xiao2022-04-0710-14/+14
| | | | | | | | | | | | | Reusing `/api/v1` from Gitea UI Pages have pros and cons. Pros: 1) Less code copy Cons: 1) API/v1 have to support shared session with page requests. 2) You need to consider for each other when you want to change something about api/v1 or page. This PR moves all dependencies to API/v1 from UI Pages. Partially replace #16052
* Skip frontend ROOT_URL check on installation page, remove unnecessary global ↵wxiaoguang2022-04-011-0/+3
| | | | | | var (#19291) Skip `checkAppUrl` message on installation page because the ROOT_URL is not determined yet Move global var `supportedDbTypeNames` into `install.Init` as a local var
* Show messages for users if the ROOT_URL is wrong, show JavaScript errors ↵wxiaoguang2022-03-304-9/+65
| | | | | | | | | | | | | | (#18971) * ROOT_URL issues: some users did wrong to there app.ini config, then: * The assets can not be loaded (AppSubUrl != "" and users try to access http://host:3000/) *The ROOT_URL is wrong, then many URLs in Gitea are broken. Now Gitea show enough information to users. * JavaScript error issues, there are many users affected by JavaScript errors, some are caused by frontend bugs, some are caused by broken customized templates. If these JS errors can be found at first time, then maintainers do not need to ask about how bug occurs again and again. * Some people like to modify the `head.tmpl`, so we separate the script part to `head_script.tmpl`, then it's much safer. * use specialized CSS class "js-global-error", end users still have a chance to hide error messages by customized CSS styles.
* Refactor repo clone button and repo clone links, fix JS error on empty repo ↵wxiaoguang2022-03-292-19/+49
| | | | | | | | | | | | | | | | | page (#19208) The last PR about clone buttons introduced an JS error when visiting an empty repo page: * https://github.com/go-gitea/gitea/pull/19028 * `Uncaught ReferenceError: isSSH is not defined`, because the variables are scoped and doesn't share between sub templates. This: 1. Simplify `templates/repo/clone_buttons.tmpl` and make code clear 2. Move most JS code into `initRepoCloneLink` 3. Remove unused `CloneLink.Git` 4. Remove `ctx.Data["DisableSSH"] / ctx.Data["ExposeAnonSSH"] / ctx.Data["DisableHTTP"]`, and only set them when is is needed (eg: deploy keys / ssh keys) 5. Introduce `Data["CloneButton*"]` to provide data for clone buttons and links 6. Introduce `Data["RepoCloneLink"]` for the repo clone link (not the wiki) 7. Remove most `ctx.Data["PageIsWiki"]` because it has been set in the `/wiki` middleware 8. Remove incorrect `quickstart` class in `migrating.tmpl`
* Feature: show issue assignee on project board (#15232)Roger Luo2022-03-091-0/+8
| | | | * Show assignees in project boards.
* Fix EasyMDE error when input Enter (#19004)wxiaoguang2022-03-061-2/+2
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix the editor height in review box (#19003)wxiaoguang2022-03-041-1/+2
| | | | | | | | | | | | | | | | Fix the height problem in https://github.com/go-gitea/gitea/pull/18862#issuecomment-1059329539 I have tested this fix. # Screenshots ### Min-height <img width="1138" alt="image" src="https://user-images.githubusercontent.com/2114189/156811831-93d4d31a-1b0a-4c4c-a7b4-fafc706133d6.png"> ### Max-height <img width="1126" alt="image" src="https://user-images.githubusercontent.com/2114189/156811889-10ae41de-c63b-45e7-9d89-21a1ed29e58b.png">
* Remove CodeMirror dependencies (#18911)silverwind2022-02-261-40/+3
| | | EasyMDE already loads all the modes and plugins it needs, so there is no reason for neither the webpack dependency nor the vendored copy
* Set max text height to prevent overflow (#18862)Kyle D2022-02-231-1/+1
| | | | | | | | | | | Sets a max height for review text boxes to prevent a very annoying bug where users cannot access the "submit" button. Before: ![image](https://user-images.githubusercontent.com/12700993/155253001-e1dab086-aaf3-4338-889d-6a861728274a.png) After: ![image](https://user-images.githubusercontent.com/12700993/155253144-5b9a3547-9582-412f-867f-41a45a14a0fe.png) Interestingly, I don't see this bug on Firefox.
* Fix behavior or checkbox submission. (#18851)Gusted2022-02-221-0/+2
|
* Replace deprecated String.prototype.substr() with String.prototype.slice() ↵CommanderRoot2022-02-186-11/+11
| | | | | | | | | (#18796) String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with the slice() method which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Various Mermaid improvements (#18776)silverwind2022-02-161-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Various Mermaid improvments - Render into iframe for improved security - Use built-in dark theme instead of color inversion - Remove flexbox attributes, resulting in more consistent size rendering - Update API usage and update to latest version * restart ci * misc tweaks * remove unneccesary declaration * make it work without allow-same-origin, add loading=lazy * remove loading attribute, does not seem to work * rename variable * skip roundtrip to DOM for rendering * don't guess chart height * update comment to make it clear it's intentional * tweak * replace deprecated 'scrolling' property * remove unused css file Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix source code line highlighting (#18729)Jimmy Praet2022-02-121-2/+5
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add LDAP group sync to Teams, fixes #1395 (#16299)Sven Seeberg2022-02-111-10/+6
| | | | | | | | | | * Add setting for a JSON that maps LDAP groups to Org Teams. * Add log when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. * Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON.
* Add apply-patch, basic revert and cherry-pick functionality (#17902)zeripath2022-02-094-12/+90
| | | | | | | | | | | | | | | This code adds a simple endpoint to apply patches to repositories and branches on gitea. This is then used along with the conflicting checking code in #18004 to provide a basic implementation of cherry-pick revert. Now because the buttons necessary for cherry-pick and revert have required us to create a dropdown next to the Browse Source button I've also implemented Create Branch and Create Tag operations. Fix #3880 Fix #17986 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent security failure due to bad APP_ID (#18678)zeripath2022-02-091-0/+13
| | | | | | | | | | | WebAuthn may cause a security exception if the provided APP_ID is not allowed for the current origin. Therefore we should reattempt authentication without the appid extension. Also we should allow [u2f] as-well as [U2F] sections. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix review excerpt (#18502)confusedsushi2022-02-011-1/+3
| | | | | | | | | | | | | | | | | Currently the "File Changed" tab of a PR is somehow broken. This is also true for the current release 1.16.0. When you are on the "File Changed" tab, and want to look at code excerpt before or after the code changes, the layout breaks. You can test this on try.gitea.io here: https://try.gitea.io/testnotexisting/magic_enum/pulls/2/files The problem occurs for the unified view and for the split view. Kind of the same problem was there for commenting a line of code, this was fixed in #18321 and #18403. For consistency, I changed the solution of #18321, I removed the ``colspan`` and instead added a ``<td>``. The goal was to have code similarly with the split view. Also the separator line in the split view was in the wrong column, this was fixed too.* more consistent unified review comment Fix #18516 Co-authored-by: Andrew Thornton <art27@cantab.net>
* Use explicit jQuery import, remove unused eslint globals (#18435)silverwind2022-01-2850-14/+76
| | | | | - Don't rely on globals (window.$) for jQuery import - Remove eslint globals no longer in use
* Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403)zeripath2022-01-251-0/+2
| | | | | | Fix #18391 Fix #18320 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent showing webauthn error for every time visiting ↵wxiaoguang2022-01-241-4/+3
| | | | `/user/settings/security` (#18385)
* Fix PR comments UI (#18323)wxiaoguang2022-01-192-2/+2
| | | | | Closes: * Review comment cannot be edited #17768 * Changing PR Comment Resolved State Disables Further Changes #18315
* Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)wxiaoguang2022-01-192-4/+7
| | | And shrink the height of Dropzone.
* Place inline diff comment dialogs in the 4th column. (#18321)JonRB2022-01-181-1/+1
| | | | | | | | | | | | Comment dialogs for inline comments should appear in 4th column (not 3rd column), this PR changes the column that the inline review comment is associated with. This problem has occurred due to an unrecognised conflict between #17562 and #17315. Fix as zeripath suggested in #18320 Fix #18320 Co-authored-by: zeripath <art27@cantab.net>
* Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)wxiaoguang2022-01-169-34/+34
| | | This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.
* Prevent possible XSS when using jQuery (#18289)Gusted2022-01-169-34/+34
| | | | | | | In the case of misuse or misunderstanding from a developer whereby, if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the creation of a new element. Current usage is using hard-coded selectors in the templates, but nobody prevents that from expanding to user-controlled somehow.
* Webauthn nits (#18284)zeripath2022-01-151-8/+11
| | | | | | | This contains some additional fixes and small nits related to #17957 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Support webauthn (#17957)Lunny Xiao2022-01-143-128/+200
| | | | | | | Migrate from U2F to Webauthn Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>