Jason Song [Wed, 23 Aug 2023 02:29:17 +0000 (10:29 +0800)]
Fix counting and filtering on the dashboard page for issues (#26657)
This PR has multiple parts, and I didn't split them because
it's not easy to test them separately since they are all about the
dashboard page for issues.
1. Support counting issues via indexer to fix #26361
2. Fix repo selection so it also fixes #26653
3. Keep keywords in filter links.
Lunny Xiao [Wed, 23 Aug 2023 01:56:11 +0000 (09:56 +0800)]
add mfa doc (#26654)
copy and modified from #14572
> Whilst debating enforcing MFA within our team, I realised there isn't
a lot of context to the side effects of enabling it. Most of us use Git
over HTTP and would need to add a token.
I plan to add another PR that adds a sentence to the UI about needing to
generate a token when enabling MFA if HTTP is to be used.
wxiaoguang [Tue, 22 Aug 2023 04:57:02 +0000 (12:57 +0800)]
Improve some flex layouts (#26649)
Fix #26617
1. Separate the "flex-list" examples into a dedicated template, and add some more examples
2. Use `flex-basis` instead of `flex-shrink` for `flex-item-trailing`, to avoid wrapping the texts too aggressively
3. Some `flex-wrap: wrap;` are removed
Bo-Yi Wu [Tue, 22 Aug 2023 03:20:34 +0000 (11:20 +0800)]
feat: implement organization secret creation API (#26566)
- Add a new `CreateSecretOption` struct for creating secrets
- Implement a `CreateOrgSecret` function to create a secret in an
organization
- Add a new route in `api.go` to handle the creation of organization
secrets
- Update the Swagger template to include the new `CreateOrgSecret` API
endpoint
delvh [Mon, 21 Aug 2023 16:20:11 +0000 (18:20 +0200)]
Use correct minio error (#26634)
Previously, `err` was defined above, checked for `err == nil` and used
nowhere else.
Hence, the result of `convertMinioErr` would always be `nil`.
This leads to a NPE further down the line.
That is not intentional, it should convert the error of the most recent
operation, not one of its predecessors.
CaiCandong [Mon, 21 Aug 2023 13:11:07 +0000 (21:11 +0800)]
Improve translation of milestone filters (#26569)
https://github.com/go-gitea/gitea/issues/26567#issue-1855312074
> The terms `closest` and `furthest` don't describe the actual sorting
behavior as these two are semantically relative to the current date.
> Could we switch to `earliest` and `latest` instead?
silverwind [Mon, 21 Aug 2023 10:49:49 +0000 (12:49 +0200)]
Replace box-shadow for `floating` dropdown as well (#26581)
Add `box-shadow` replacement to the `floating` dropdown variant as well,
which was missed in https://github.com/go-gitea/gitea/pull/26469. The
Fomantic style has `!important`, so this has to have too. Also made a
tiny adjustment to shadow color on dark theme.
<img width="305" alt="Screenshot 2023-08-18 at 16 40 34"
src="https://github.com/go-gitea/gitea/assets/115237/a0aac9cb-6393-4d69-b0b3-00eaac5ccf9f">
<img width="202" alt="Screenshot 2023-08-18 at 16 40 22"
src="https://github.com/go-gitea/gitea/assets/115237/0a5fa3aa-7452-4dbd-86ed-ccbc1c872ebb">
TimberBro [Sun, 20 Aug 2023 15:06:42 +0000 (18:06 +0300)]
Fix NPM packages name validation (#26595)
- Added new tests to cover corner cases
- Replace existing regex with new one
Closes #26551
---
As @silverwind suggested, I started from
[validate-npm-package-name](https://github.com/npm/validate-npm-package-name),
but found this solution too complicated.
Then I tried to fix existing regex myself, but thought, that exclude all
restricted symbols is harder, than set only allowed symbols.
Then I search a bit more and found
[package-name-regex](https://github.com/dword-design/package-name-regex)
and regex from it works for all new test cases.
Let me know, if more information or help with this PR is needed.
wxiaoguang [Thu, 17 Aug 2023 21:50:32 +0000 (05:50 +0800)]
Fix various line-height styles (#26553)
Fix #26537
Use the same default line-height as "normalize.css" instead of "1". "1"
is not right because it doesn't work with descent part and causes
overflow problems.
CaiCandong [Thu, 17 Aug 2023 13:19:24 +0000 (21:19 +0800)]
Fix label filter between `all` and `no` (#26557)
Regression of https://github.com/go-gitea/gitea/pull/25886.
# Description
For `labelIDs`:
https://github.com/go-gitea/gitea/blob/9afcb0e0461aa48a4fbda7740d4c5424911e35ef/routers/web/repo/issue.go#L171-L174
- `nil` mean no filter
- `[0]` mean `no label` filter
When `selectLabels == "0"`, labelIDs should be `[0]` rather than `nil`
# Before:
yp05327 [Wed, 16 Aug 2023 10:12:03 +0000 (19:12 +0900)]
Differentiate better between user settings and admin settings (#26538)
User settings page and admin settings page are too similar. I thinlk
this will be better of using `User Settings` and `Admin Settings` as the
navbar's title.
Jason Song [Wed, 16 Aug 2023 09:36:05 +0000 (17:36 +0800)]
Add missing triggers to update issue indexer (#26539)
Fix #26536
Follow #26012
Whatever the comment type is, always update the issue indexer. So the
issue indexer will be updated when there is a change in Status,
Assignee, Label, and so on.
I added the logic for `NotifyUpdateComment`, but missed it for
`NotifyCreateIssueComment` and `NotifyDeleteComment`.
In current design, the clickable area is too small, and it is hard to
find the correct clickable area as the area with background color (div
with class name `job-brief-item selected`) is bigger than it.
CaiCandong [Tue, 15 Aug 2023 14:50:12 +0000 (22:50 +0800)]
Fix project filter bugs (#26490)
related: #26012
### Bugs
1. missing project filter on the issue page.
https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15
3. incorrect SQL condition: some issue does not belong to a project but
exists on the project_issue table.
yp05327 [Tue, 15 Aug 2023 14:00:35 +0000 (23:00 +0900)]
Fix display problems of members and teams unit (#26363)
Fix:
- display member count and team count in the menu bar
![image](https://github.com/go-gitea/gitea/assets/18380374/7f03ced4-67e2-41ce-b19f-a992823726bb)
- Also display member unit in the menu bar if there are no hidden
members in public org
![image](https://github.com/go-gitea/gitea/assets/18380374/31422ad6-7190-438d-8e99-8a4af9cce908)
- hidden member board when there's no seeable members.
In this org, we only have hidden members:
![image](https://github.com/go-gitea/gitea/assets/18380374/d749420b-554a-4483-8cd2-221df61b5ca7)
We will hidden the member board when doer is not the member of this org
![image](https://github.com/go-gitea/gitea/assets/18380374/eafc0b3e-6218-42ab-a892-39645d08a5eb)
If you click the number in the members board, you will access the
members page, which is not expected.
silverwind [Tue, 15 Aug 2023 13:23:51 +0000 (15:23 +0200)]
Use `hidden` over `clip` for text truncation (#26520)
Avoid browser bugs:
- Firefox not cutting off -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678456052
- Safari not showing ellipsis -
https://github.com/go-gitea/gitea/pull/26354#issuecomment-1678812801
Bo-Yi Wu [Tue, 15 Aug 2023 12:32:43 +0000 (20:32 +0800)]
Add API route to list org secrets (#26485)
- Add a new function `CountOrgSecrets` in the file
`models/secret/secret.go`
- Add a new file `modules/structs/secret.go`
- Add a new function `ListActionsSecrets` in the file
`routers/api/v1/api.go`
- Add a new file `routers/api/v1/org/action.go`
- Add a new function `listActionsSecrets` in the file
`routers/api/v1/org/action.go`
CaiCandong [Tue, 15 Aug 2023 09:30:06 +0000 (17:30 +0800)]
Apply to become a maintainer (#26514)
Here is my PR list:- [go-gitea/gitea/pulls (author:caicandong is:merged)](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+sort%3Aupdated-desc+author%3ACaiCandong+is%3Amerged)
puni9869 [Mon, 14 Aug 2023 09:56:14 +0000 (15:26 +0530)]
Allow to archive labels (#26478)
## Archived labels
This adds the structure to allow for archived labels.
Archived labels are, just like closed milestones or projects, a medium to hide information without deleting it.
It is especially useful if there are outdated labels that should no longer be used without deleting the label entirely.
## Changes
1. UI and API have been equipped with the support to mark a label as archived
2. The time when a label has been archived will be stored in the DB
## Outsourced for the future
There's no special handling for archived labels at the moment.
This will be done in the future.
KN4CK3R [Mon, 14 Aug 2023 02:50:55 +0000 (04:50 +0200)]
Fix NuGet search endpoints (#25613)
Fixes #25564
Fixes #23191
- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions
silverwind [Mon, 14 Aug 2023 02:16:40 +0000 (04:16 +0200)]
Fix tooltip of commit select button (#26472)
Previously, the tooltip for this button was only shown after opening and
closing it once because it was only set after the server response, now
it shows before opening it.
I accidentally set grab cursor for project columns instead of issue
cards, which actually turned out not to be a problem - with proper check
for the default column, which can't be moved.
John Olheiser [Sat, 12 Aug 2023 14:54:50 +0000 (09:54 -0500)]
Add matrix to support (#26382)
This PR adds our matrix space to the support options and alphabetizes
the list.
I also considered adding our Mastodon, however that isn't as suitable as
the other options because it's just whoever has access to the account vs
a community chat/forum.
Denys Konovalov [Sat, 12 Aug 2023 10:30:28 +0000 (12:30 +0200)]
Refactor project templates (#26448)
This PR refactors a bunch of projects-related code, mostly the
templates.
The following things were done:
- rename boards to columns in frontend code
- use the new `ctx.Locale.Tr` method
- cleanup template, remove useless newlines, classes, comments
- merge org-/user and repo level project template together
- move "new column" button into project toolbar
- move issue card (shared by projects and pinned issues) to shared
template, remove useless duplicated styles
- add search function to projects (to make the layout more similar to
milestones list where it is inherited from :laughing:)
- maybe more changes I forgot I've done :laughing:
Closes #24893
After:
![Bildschirmfoto vom 2023-08-10
23-02-00](https://github.com/go-gitea/gitea/assets/47871822/cab61456-1d23-4373-8163-e567f1b3b5f9)
![Bildschirmfoto vom 2023-08-10
23-02-26](https://github.com/go-gitea/gitea/assets/47871822/94b55d60-5572-48eb-8111-538a52d8bcc6)
![Bildschirmfoto vom 2023-08-10
23-02-46](https://github.com/go-gitea/gitea/assets/47871822/a0358f4b-4e05-4194-a7bc-6e0ecba5a9b6)
silverwind [Sat, 12 Aug 2023 08:26:53 +0000 (10:26 +0200)]
Tweak actions menu (#26278)
Ressurect lost changes from
https://github.com/go-gitea/gitea/pull/24451.
- Always show icons for each entry in the menu
- Make all checkboxes toggle only their feature, e.g. "seconds" and
"timestamps" can now be toggled on together.
- Reorder the items
<img width="845" alt="Screenshot 2023-08-01 at 19 19 27"
src="https://github.com/go-gitea/gitea/assets/115237/8a76e9bf-7966-42a6-87c9-e88cdddaec82">
Lunny Xiao [Sat, 12 Aug 2023 08:03:54 +0000 (16:03 +0800)]
Adjust minio new sequence, now it will check whether bucket exist first and then create one if it doesn't exist (#26420)
For some reason, the permission of the client_id and secret may cannot
create bucket, so now we will check whether bucket does exist first and
then try to create a bucket if it doesn't exist.
Jack Hay [Sat, 12 Aug 2023 07:33:12 +0000 (03:33 -0400)]
Set commit id when ref used explicitly (#26447)
In the `RepoRefForAPI()` context function `CommitID` is not set if `ref`
is used. It is set correctly for other if/else branches where `Commit`
is set. It doesn't appear that any routes that use `RepoRefForAPI()`
also use `CommitID` but that may be the case in the future.
## Changes
- Sets `ctx.Repo.CommitID` when `ref` is explicitly used for api routes
that use `RepoRefForAPI()`
CaiCandong [Sat, 12 Aug 2023 00:49:23 +0000 (08:49 +0800)]
Update index doc (#26455)
In the previous feature description, numerous functionalities of Gitea
were listed, which appeared redundant and failed to highlight the unique
characteristics of Gitea. Therefore, I have rewritten this section based
on the description provided on the official Gitea website
silverwind [Thu, 10 Aug 2023 21:53:44 +0000 (23:53 +0200)]
Lock go to 1.21 on CI (#26433)
To prevent unwanted surprises with new minor versions of go, lock the
version to minor version using [semver tilde
syntax](https://github.com/npm/node-semver#tilde-ranges-123-12-1). We
were already getting 1.21.0 since yesterday, so use that version now as
minimum.
Always show usernames in reaction tooltips (#26444)
Even if GetDisplayName() is normally preferred elsewhere, this change
provides more consistency, as usernames are also always being shown
when participating in a conversation taking place in an issue or
a pull request. This change makes conversations easier to follow, as
you would not have to have a mental association between someone's
username and someone's real name in order to follow what is happening.
This behavior matches GitHub's. Optimally, both the username and the
full name (if applicable) could be shown, but such an effort is a
much bigger task that needs to be thought out well.