Add support for tags#1002

Merged
mmarif merged 27 commits from :tags into main 2022-02-12 14:41:12 +01:00
Contributor

Closes #983

TODO

  • create tags
  • view tags
  • apply pagination
  • delete tags
Closes #983 TODO - [x] create tags - [x] view tags - [x] apply pagination - [x] delete tags
qwerty287 added this to the 4.2.0 milestone 2021-10-18 17:00:48 +02:00
Owner

You can add pagination if you would like.

You can add pagination if you would like.
Author
Contributor

I know, forgot in todo list

I know, forgot in todo list
qwerty287 changed title from WIP: Add support for tags to Add support for tags 2021-10-20 16:38:33 +02:00
Author
Contributor

I think it's ready

I think it's ready
Owner

Thanks, I will review it soon when get some time.

Bdw, the pagination implementation with viewmodel will not work properly. Have you test it?

Thanks, I will review it soon when get some time. Bdw, the pagination implementation with viewmodel will not work properly. Have you test it?
Author
Contributor

Yes, and for me it's working (but it uses a simple workaround, just send the adapter as a parameter of the function, maybe that's what you mean)

Yes, and for me it's working (but it uses a simple workaround, just send the adapter as a parameter of the function, maybe that's what you mean)
Owner

Can we add a progress indicator when we switch with filter, and for pages load?

For creating tag, If I tap on create tag. Will it create a release too or just tag?

Maybe we can enhance creating release screen to accomodate tag properly.

Can we add a progress indicator when we switch with filter, and for pages load? For creating tag, If I tap on create tag. Will it create a release too or just tag? Maybe we can enhance creating release screen to accomodate tag properly.
@ -43,2 +50,4 @@
private String repoOwner;
private String releaseTag;
private boolean viewTypeIsTags = false;
private int page = 1;
Owner

Just initlization would work, private int page;

Just initlization would work, `private int page;`
Author
Contributor

Well, I tried this and in this case page was 0 at the beginning, it must be 1.

Well, I tried this and in this case `page` was 0 at the beginning, it must be 1.
6543 marked this conversation as resolved
@ -59,0 +73,4 @@
Call<List<GitTag>> call = RetrofitClient
.getApiInterface(ctx)
.getTags(token, owner, repo, 1, 50);
Owner

Page limit should come from helpers/Constants. Our default is 25 for new and 10 for old.

Page limit should come from `helpers/Constants`. Our default is 25 for new and 10 for old.
qwerty287 marked this conversation as resolved
@ -59,0 +99,4 @@
Call<List<GitTag>> call = RetrofitClient
.getApiInterface(ctx)
.getTags(token, owner, repo, page, 50);
Owner

Page limit should come from helpers/Constants. Our default is 25 for new and 10 for old.

Page limit should come from `helpers/Constants`. Our default is 25 for new and 10 for old.
qwerty287 marked this conversation as resolved
@ -772,0 +775,4 @@
<string name="tagCreated">Tag created</string>
<string name="asRef">Use as reference</string>
<string name="deleteTagConfirmation">Do you really want to delete this tag?</string>
<string name="deleteTagTitle">Delete tag %s</string>
Owner

How to delete a tag?

How to delete a tag?
Author
Contributor

There should be a button with three dots next to the tag name in the list, there is the option.

There should be a button with three dots next to the tag name in the list, there is the option.
Owner

Unfortunately I don't see one. I am on GitNex repo.

Unfortunately I don't see one. I am on GitNex repo.
Author
Contributor

Ok, I'll see what's wrong.

Ok, I'll see what's wrong.
Author
Contributor

Oh, I missed the permission system. I added the values used in #977 and currently this will always be false and it will be hidden... I'll disable the permission check so we can enable it if #977 is merged

Oh, I missed the permission system. I added the values used in #977 and currently this will always be false and it will be hidden... I'll disable the permission check so we can enable it if #977 is merged
Author
Contributor

Could you try again with this gitnex/GitNex@d27b0e0db7?

Could you try again with this https://codeberg.org/gitnex/GitNex/commit/d27b0e0db7b6c43a8ddefe686e5a5f13cb890595?
6543 marked this conversation as resolved
Owner

And while you are at it, can you add pagination to Releases too?

And while you are at it, can you add pagination to Releases too?
Author
Contributor

@mmarif

Can we add a progress indicator when we switch with filter, and for pages load?

Sure!

For creating tag, If I tap on create tag. Will it create a release too or just tag?

Only the tag

Maybe we can enhance creating release screen to accomodate tag properly.

I mostly copied this ui from gitea itself, but yes that would be probably good.

@mmarif >Can we add a progress indicator when we switch with filter, and for pages load? Sure! >For creating tag, If I tap on create tag. Will it create a release too or just tag? Only the tag >Maybe we can enhance creating release screen to accomodate tag properly. I mostly copied this ui from gitea itself, but yes that would be probably good.
Author
Contributor

@mmarif

And while you are at it, can you add pagination to Releases too?

Requires a tea4j update, but yes I can do this👍

@mmarif >And while you are at it, can you add pagination to Releases too? Requires a tea4j update, but yes I can do this👍
@ -771,1 +771,4 @@
<string name="selectUpdateStrategy">Select Update Strategy</string>
<string name="tags">Tags</string>
<string name="releasesTags">Releases/Tags</string>
<string name="create_tag">Create Tag</string>
Owner

As it is following the web UI, in that case can you change the button text to Create Tag Only

As it is following the web UI, in that case can you change the button text to `Create Tag Only`
Author
Contributor
https://codeberg.org/gitnex/GitNex/commit/49ce8763323c14dd75a1d822e1019e6ce12cce89
qwerty287 marked this conversation as resolved
Member

@qwerty287 can you add a check and only show this if gitea instance is >= 1.15 ?

@qwerty287 can you add a check and only show this if gitea instance is >= 1.15 ?
Member

conflicts :D

conflicts :D
Owner

@qwerty287 can you fix the conflicts?

@qwerty287 can you fix the conflicts?
Owner

This @string/labelMenuDelete does not exist in bottom_sheet_tag_in_list.xml. Am I missing something?

This `@string/labelMenuDelete` does not exist in `bottom_sheet_tag_in_list.xml`. Am I missing something?
Author
Contributor

It does in line 21 - 34?

It does in line 21 - 34?
Owner

@qwerty287

It does in line 21 - 34?

Sorry I was not clear. I mean that string is missing in strings.xml.

@qwerty287 >It does in line 21 - 34? Sorry I was not clear. I mean that string is missing in strings.xml.
Author
Contributor

Yes, fixed it.

Yes, fixed it.
@ -111,0 +159,4 @@
enableProcessButton();
AlertDialogs.authorizationTokenRevokedDialog(ctx, ctx.getResources().getString(R.string.alertDialogTokenRevokedTitle),
ctx.getResources().getString(R.string.alertDialogTokenRevokedMessage),
ctx.getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
Owner

This should be R.string.cancelButton as there is no such string for alertDialogTokenRevokedCopyNegativeButton.

This should be `R.string.cancelButton` as there is no such string for `alertDialogTokenRevokedCopyNegativeButton`.
@ -111,0 +160,4 @@
AlertDialogs.authorizationTokenRevokedDialog(ctx, ctx.getResources().getString(R.string.alertDialogTokenRevokedTitle),
ctx.getResources().getString(R.string.alertDialogTokenRevokedMessage),
ctx.getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
ctx.getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
Owner

This should be R.string.navLogout instead of alertDialogTokenRevokedCopyPositiveButton. No such string.

This should be `R.string.navLogout` instead of `alertDialogTokenRevokedCopyPositiveButton`. No such string.
Owner

Can you help build the app from this PR to fix the missing bits. Thanks

Can you help build the app from this PR to fix the missing bits. Thanks
closes #919 TODO - [X] repo and file actions (create release, label...)	- [X] allow for repo admins - [x] label actions (edit, delete)	- [x] allow for repo admins - [X] issue/pr action that are available for creators (close...)	- [X] allow for creator - [X] allow for repo admins - [x] pr actions that are allowed when having push access to pr source (there was a bug in Gitea that makes that this was not working and these features were not accessible -> https://github.com/go-gitea/gitea/issues/17181) - [x] allow deleting of head branch/updates only if you can do this - [x] issue/pr action that are available for repo admins (merge) - [x] allow for repo admins - [x] milestone actions (close/reopen) - [x] allow for repo admins - [x] comment actions (delete, edit...)	- [X] allow for creators - [x] allow for repo admins - [x] org actions (create label, team, repo; req gitea 1.16.0) - [x] actions when creating/editing issues - [x] delete head when merging - [x] All actions available to instance admins? (handled through API) Maybe as extras: - [x] Allow close/reopen also for PRs - [x] Improve handling of these (multiple btns for the same action) Co-authored-by: qwerty287 <ndev@web.de> Co-authored-by: M M Arif <mmarif@noreply.codeberg.org> Reviewed-on: #977 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org> Co-authored-by: qwerty287 <qwerty287@noreply.codeberg.org> Co-committed-by: qwerty287 <qwerty287@noreply.codeberg.org>
Owner

@qwerty287 this is ready for mergning. Just one thing I wish was there, when delete a tag, refresh the view with updated list. But it can be done in another PR.

@qwerty287 this is ready for mergning. Just one thing I wish was there, when delete a tag, refresh the view with updated list. But it can be done in another PR.
mmarif approved these changes 2022-02-12 14:40:24 +01:00
mmarif merged commit f79d227bff into main 2022-02-12 14:41:12 +01:00
mmarif referenced this pull request from a commit 2022-02-12 14:41:12 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gitnex/GitNex!1002
No description provided.