[jira] [Commented] (NIFI-3926) Edit Template information
[ https://issues.apache.org/jira/browse/NIFI-3926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16315346#comment-16315346 ] ASF GitHub Bot commented on NIFI-3926: -- Github user yuri1969 commented on a diff in the pull request: https://github.com/apache/nifi/pull/#discussion_r160052865 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java --- @@ -2601,6 +2601,25 @@ public MutableVariableRegistry getVariableRegistry() { return variableRegistry; } +@Override +public void verifyCanUpdateTemplate(final String name, final String templateId) { +// ensure the name is specified +if (StringUtils.isBlank(name)) { +throw new IllegalArgumentException("Template name cannot be blank."); +} + +for (final Template template : getTemplates()) { +canUpdateTemplate(name, templateId, template.getDetails()); +} +} + +private void canUpdateTemplate(final String name, final String templateId, final TemplateDTO processGroupTemplate) { +// prevent renaming to another template's name +if (name.equals(processGroupTemplate.getName()) && !templateId.equals(processGroupTemplate.getId())) { --- End diff -- @alopresto I was sloppy with that name validation, my mistake. > Edit Template information > - > > Key: NIFI-3926 > URL: https://issues.apache.org/jira/browse/NIFI-3926 > Project: Apache NiFi > Issue Type: Improvement > Components: Core UI >Affects Versions: 1.2.0 >Reporter: Mark Bean >Assignee: Yuri >Priority: Minor > > Request the addition of an "edit" icon to each template in the list of NiFi > Templates (Global Menu > Templates.) The edit would allow the user to modify > the template name or description. Arguably, it may also allow the Process > Group Id to be editable, but that seems far less likely to be desired. > -Another option which is much more substantial and may require a separate > ticket is to be able to edit the Template contents itself. That is, editing > brings up the template on a fresh graph where components can be added, > removed or modified.- Extracted to NIFI-4512. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NIFI-3926) Edit Template information
[ https://issues.apache.org/jira/browse/NIFI-3926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16313303#comment-16313303 ] ASF GitHub Bot commented on NIFI-3926: -- Github user alopresto commented on a diff in the pull request: https://github.com/apache/nifi/pull/#discussion_r159901869 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java --- @@ -2601,6 +2601,25 @@ public MutableVariableRegistry getVariableRegistry() { return variableRegistry; } +@Override +public void verifyCanUpdateTemplate(final String name, final String templateId) { +// ensure the name is specified +if (StringUtils.isBlank(name)) { +throw new IllegalArgumentException("Template name cannot be blank."); +} + +for (final Template template : getTemplates()) { +canUpdateTemplate(name, templateId, template.getDetails()); +} +} + +private void canUpdateTemplate(final String name, final String templateId, final TemplateDTO processGroupTemplate) { +// prevent renaming to another template's name +if (name.equals(processGroupTemplate.getName()) && !templateId.equals(processGroupTemplate.getId())) { --- End diff -- Do we want the name comparison to be case-insensitive? > Edit Template information > - > > Key: NIFI-3926 > URL: https://issues.apache.org/jira/browse/NIFI-3926 > Project: Apache NiFi > Issue Type: Improvement > Components: Core UI >Affects Versions: 1.2.0 >Reporter: Mark Bean >Assignee: Yuri >Priority: Minor > > Request the addition of an "edit" icon to each template in the list of NiFi > Templates (Global Menu > Templates.) The edit would allow the user to modify > the template name or description. Arguably, it may also allow the Process > Group Id to be editable, but that seems far less likely to be desired. > -Another option which is much more substantial and may require a separate > ticket is to be able to edit the Template contents itself. That is, editing > brings up the template on a fresh graph where components can be added, > removed or modified.- Extracted to NIFI-4512. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (NIFI-3926) Edit Template information
[ https://issues.apache.org/jira/browse/NIFI-3926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16214344#comment-16214344 ] ASF GitHub Bot commented on NIFI-3926: -- GitHub user yuri1969 opened a pull request: https://github.com/apache/nifi/pull/ NIFI-3926 - Edit Template information * Added a new edit dialog to 'Global Menu - Templates'. * Omitted Process Group Id editing functionality. * Added a unit test for template DAO update logic. Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically master)? - [x] Is your initial contribution a single, squashed commit? ### For code changes: - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [x] Have you written or updated unit tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/yuri1969/nifi NIFI-3926 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes # commit 95953de1ba2bdbff388022577bb2b05877afe7ba Author: yuri1969 <1969yuri1...@gmail.com> Date: 2017-10-11T18:59:42Z NIFI-3926 - Edit Template information * Added a new edit dialog to 'Global Menu - Templates'. * Omitted Process Group Id editing functionality. * Added a unit test for template DAO update logic. > Edit Template information > - > > Key: NIFI-3926 > URL: https://issues.apache.org/jira/browse/NIFI-3926 > Project: Apache NiFi > Issue Type: Improvement > Components: Core UI >Affects Versions: 1.2.0 >Reporter: Mark Bean >Assignee: Yuri >Priority: Minor > > Request the addition of an "edit" icon to each template in the list of NiFi > Templates (Global Menu > Templates.) The edit would allow the user to modify > the template name or description. Arguably, it may also allow the Process > Group Id to be editable, but that seems far less likely to be desired. > -Another option which is much more substantial and may require a separate > ticket is to be able to edit the Template contents itself. That is, editing > brings up the template on a fresh graph where components can be added, > removed or modified.- Extracted to NIFI-4512. -- This message was sent by Atlassian JIRA (v6.4.14#64029)