-
Notifications
You must be signed in to change notification settings - Fork 316
add DuplicateCustomAction( #1632) #1634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
2859641 to
9d70904
Compare
|
NOTE: A similar request (for a way to Clone a Custom Action) was recently brought up in this Discussion: #1479 |
9d70904 to
897329c
Compare
f325aaf to
6511d15
Compare
|
@love-linger, @heartacker - This is an excellent (and very simple / straight-forward) feature which deserves merging ASAP. However, it's so great that we should have the same feature for |
897329c to
03b86df
Compare
|
@love-linger 已经根据社区意见修改。麻烦看看这个是否有新的看到,并review 下。谢谢哈 |
|
|
||
| public CustomActionControl(CustomActionControl cac) | ||
| { | ||
| if (cac != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that you can assume that reference will not be null
|
|
||
| public CustomAction(CustomAction action) | ||
| { | ||
| if (action != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that you can assume that reference will not be null
| { | ||
| var act = new CustomAction(baseAct) | ||
| { | ||
| Name = baseAct.Name + " - (Copy)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be localizable
|
|
||
| var action = new Models.CustomAction(SelectedCustomAction) | ||
| { | ||
| Name = SelectedCustomAction.Name + " - (Copy)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be localizable
|
我并不想加入该功能。我认为在一个仓库中复制一个自定义动作是无意义的(它们不可能相同,且重新编辑一个又不耗费时间)。 I don't want to add this feature. I think it's meaningless to copy a custom action in a repository (they can't be the same, and it doesn't take time to re-edit one). |
|
对于此类需求,我自己来实现的话会是增加一个拷贝的操作(复制到剪贴板),允许从剪贴板创建。这样,就可以将某一个项目中已配置好的某些自定义操作直接拷贝到另一个仓库。 For such requirements, if I were to implement it myself, I would add a copy operation (copy to the clipboard) and allow creating a new one from the clipboard. In this way, user can copy existing custom action from one repository to another. |
|
其实主要是有参数配置的部分会比较麻烦,复制来复制去,挺不自在的 尤其是有好几个参数,有描述有定制,一个个复制很麻烦。甚至很记住 当然,如果是一行命令行,那确实很简单。 |
也是很好的主意,期待新的PR, 如果是这样的话,一个复制的按钮,也是不错的的,可以在用户点击复制按钮的时候,选复制到本repo 还是复制到 剪切板。 |
I would much prefer having a Save & Load mechanism for transfer of I would still, however, also keep the "Clone" mechanism proposed in this PR, since it's not for transfer but for quicker experimenting and creation of several similar or related actions / rules / templates. |
It's not meaningless, since the purpose is to make small changes to an existing Action in order to make a new variant. Also, it can certainly take time to "re-edit" one, since it can potentially have several Input Controls and multiple command arguments (with variables) etc. (For example, I recently created two very similar Actions, with nearly identical inputs and args but with different scope : "Rename remote branch" and "Rename remote tag". Having a Clone mechanism would have been very helpful when creating the 2nd one, since it was a bit tedious to copy individual settings from the 1st one.) That's why I suggest two complementary mechanisms:
For consistency, the same type of functionality (at least the Clone mechanism) should be added to the editors for Issue Tracker rules and for Commit Templates. |

No description provided.