You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/03/07 19:22:55 UTC

[GitHub] [netbeans-tools] matthiasblaesing opened a new pull request #44: Improve PP3

matthiasblaesing opened a new pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44


   - Enhance authorship for plugins to allow multiple owners
   - Fix an issue when rebuilding catalogs as admin (happens when deleting a plugin as admin)
   - Show groupId for plugins - both grooup and artifact id are required to identify a plugin


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] jkovalsky commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
jkovalsky commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-793816857


   Works fine. Thanks Matthias!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] matthiasblaesing commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-792337164


   @jkovalsky @jpirek could you please have a look?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] matthiasblaesing commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-792337427


   A staging instance can be found here: https://doppel-helix.eu/pp3/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] jkovalsky commented on a change in pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
jkovalsky commented on a change in pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#discussion_r589388576



##########
File path: pp3/module/Application/src/Application/Entity/Plugin.php
##########
@@ -116,6 +116,19 @@ private function updateVersions($versioning) {
         }
     }
 
+    public function removeAuthor($user) {
+        $this->authors->removeElement($user);
+    }
+
+    public function addAuthor($user) {

Review comment:
       Could return true/false if user was actually added or not which could then be reflected in both **Plugin/AdminControllers** by displaying "_Cannot add the same user twice._" information message.

##########
File path: pp3/module/Application/src/Application/Controller/AdminController.php
##########
@@ -404,60 +407,96 @@ private function _checkAdminUser() {
     public function editAction() {
         $this->_checkAdminUser();
         $pId = $this->params()->fromQuery('id');
-        $plugin = $this->_pluginRepository->find($pId);        
+        $plugin = $this->_pluginRepository->find($pId);
         if (!$plugin || empty($pId)) {
             return $this->redirect()->toRoute('admin');
         }
         $req = $this->request;
         if ($req->isPost()) {
-            $validatedData = $this->_validateAndCleanPluginData(
-                $this->params()->fromPost('name'),
-                $this->params()->fromPost('license'),
-                $this->params()->fromPost('description'),
-                $this->params()->fromPost('short_description'),
-                $this->params()->fromPost('category')
-            );
-            if ($validatedData) {
-                $plugin->setName($validatedData['name']);
-                $plugin->setLicense($validatedData['license']);
-                $plugin->setDescription($validatedData['description']);
-                $plugin->setShortDescription($validatedData['short_description']);
-                $plugin->setLastUpdatedAt(new \DateTime('now'));                
-
-                // save image
-                $im = $this->handleImgUpload($this->_config['pp3']['catalogSavepath'].'/plugins/'.$plugin->getId());
-                if ($im) {                    
-                    $plugin->setImage($im);
+            $queryString = "";
+            if ($this->params()->fromPost('addUserByEMail')) {
+                $queryString = '&activeTab=authors';
+                $users = $this->_userRepository->findByEmail($this->params()->fromPost('addUserByEMail'));
+                if (count($users) > 0) {
+                    foreach ($users as $user) {
+                        $plugin->addAuthor($user);
+                    }
+                    $this->flashMessenger()->setNamespace('success')->addMessage('Authors updated.');
+                    $this->_pluginRepository->persist($plugin);
+                } else {
+                    $this->flashMessenger()->setNamespace('error')->addMessage('No user found with specified address.');
                 }
+            } else if ($this->params()->fromPost('removeAuthor')) {
+                $queryString = '&activeTab=authors';
+                $user = $this->_userRepository->find($this->params()->fromPost('removeAuthor'));
+                if (!$user) {
+                    $this->flashMessenger()->setNamespace('error')->addMessage('No user found with specified id.');
+                } else {
+                    $plugin->removeAuthor($user);
+                    if (count($plugin->getAuthors()) > 0) {
+                        $this->_pluginRepository->persist($plugin);
+                        $this->flashMessenger()->setNamespace('success')->addMessage('Author was removed.');
+                    } else {
+                        $this->flashMessenger()->setNamespace('error')->addMessage('Last author can not be removed.');
+                    }
+                }
+            } else {
+                $validatedData = $this->_validateAndCleanPluginData(
+                        $this->params()->fromPost('name'),
+                        $this->params()->fromPost('license'),
+                        $this->params()->fromPost('description'),
+                        $this->params()->fromPost('short_description'),
+                        $this->params()->fromPost('category')
+                );
+                if ($validatedData) {
+                    $plugin->setName($validatedData['name']);
+                    $plugin->setLicense($validatedData['license']);
+                    $plugin->setDescription($validatedData['description']);
+                    $plugin->setShortDescription($validatedData['short_description']);
+                    $plugin->setLastUpdatedAt(new \DateTime('now'));
 
+                    // save image
+                    $im = $this->handleImgUpload($this->_config['pp3']['catalogSavepath'] . '/plugins/' . $plugin->getId());
+                    if ($im) {
+                        $plugin->setImage($im);
+                    }
 
-                // categ
-                $plugin->removeCategories();
-                $this->_pluginRepository->persist($plugin);
-                $cat = $this->_categoryRepository->find($validatedData['category']);
-                if ($cat) {
-                    $plugin->addCategory($cat);
-                }
-                $cat2 = $this->params()->fromPost('category2');
-                if ($cat2 && (!$cat || ($cat2 != $cat->getId()))) {
-                    $cat2 = $this->_categoryRepository->find($this->params()->fromPost('category2'));
-                    if ($cat2) {
-                        //die(var_dump($cat2, $plugin->getCategories()[1], $validatedData['category']));
-                        $plugin->addCategory($cat2);
+
+                    // categ
+                    $plugin->removeCategories();
+                    $this->_pluginRepository->persist($plugin);
+                    $cat = $this->_categoryRepository->find($validatedData['category']);
+                    if ($cat) {
+                        $plugin->addCategory($cat);
+                    }
+                    $cat2 = $this->params()->fromPost('category2');
+                    if ($cat2 && (!$cat || ($cat2 != $cat->getId()))) {
+                        $cat2 = $this->_categoryRepository->find($this->params()->fromPost('category2'));
+                        if ($cat2) {
+                            //die(var_dump($cat2, $plugin->getCategories()[1], $validatedData['category']));

Review comment:
       Commented out code should not be committed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] jpirek commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
jpirek commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-792550973


   Looks good. Thanks Matthias.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] matthiasblaesing merged pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
matthiasblaesing merged pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] matthiasblaesing commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-795963049


   Thank you both for review.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans-tools] matthiasblaesing commented on pull request #44: Improve PP3

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #44:
URL: https://github.com/apache/netbeans-tools/pull/44#issuecomment-793035678


   > Provided a few minor comments. 
   
   Both addressed in update (if nothing further comes up, I plan to squash commits 1,2 and 5 before merge).
   
   > Also noticed that it is possible to add your e-mail twice? See: https://doppel-helix.eu/pp3/catalogue/?id=20
   
   Yes and no. What you are seeing are not the same users - one is an AWS account and one is a google account, but both registered with the same e-mail address. So you added another instance of the same e-mail address, but you added distinct users.  I think this is the sanest variant - others would need to expose much more information.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists