Skip to content
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

Update jstree actions #11

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3126128
Create node action in context menu working
programgames Dec 21, 2018
82add84
Added datagrid with parameters reloading in document tree view
programgames Dec 24, 2018
313509f
Changed formating of js tree data to add the top level root node ( no…
programgames Dec 24, 2018
66b8e42
Fix to prevent creating folder with a name already used using the con…
programgames Dec 24, 2018
1f301e3
Document datagrid updated ( view and update link )
programgames Dec 24, 2018
edb0f78
Fix missing exposing route for widget action and removed console.log
programgames Dec 24, 2018
3754231
Set every ajax request to asynchronous
programgames Dec 26, 2018
6a7eac1
Updated traduction for contextMenu
programgames Dec 26, 2018
2b40093
Remove delete action from node controller
programgames Dec 26, 2018
4ec6c6f
Add missing imports
programgames Dec 26, 2018
0c2625e
Fixed move action for context menu
programgames Dec 26, 2018
93f56ff
Renamed entity tables names and created install for DAMBundle
programgames Dec 26, 2018
cebb9a7
browse at node view added
programgames Dec 27, 2018
0f4040e
Node openening when refreshing working.
programgames Dec 28, 2018
d3bb796
Little refractor for some warnings
programgames Dec 28, 2018
cfff77f
Changed paramaters name for document node broswe view.
programgames Dec 28, 2018
5e1e5aa
prevent moving a child above or below the root
programgames Dec 28, 2018
31cc6d8
[WIP]
programgames Jan 2, 2019
46acaac
Updated datagrid
programgames Jan 3, 2019
a0c5bd1
Updated create Node root in browse view
programgames Jan 3, 2019
68c9292
Changed document node widget route
programgames Jan 3, 2019
45a3ce2
Changed the way js tree automaticly open selected node in browse to n…
programgames Jan 4, 2019
5ed7196
Changed wrong name file for the installer
programgames Jan 4, 2019
172404d
fix one route in js
programgames Jan 4, 2019
03754a1
Add missing file
Jan 17, 2019
8cc1072
Fix translation value & datagrid
Jan 17, 2019
4592527
Moved a data transformer for document node UUID
gplanchat Jan 17, 2019
a286aa5
Fixed DI declarations for the DocumentController
gplanchat Jan 17, 2019
ed89542
Fixed DI declarations for the AssetWidgetController
gplanchat Jan 17, 2019
858a45e
Changed routes conventions
gplanchat Jan 17, 2019
d312817
Customize document view with file info
Jan 17, 2019
168cadd
Merge branch 'update-jstree-actions' of github.com:kiboko-labs/dam-bu…
Jan 17, 2019
8899c4b
Fixed Node browsing
gplanchat Jan 17, 2019
e7a96ff
Added root node accessor on root nodes
gplanchat Jan 17, 2019
a6edc81
Fixed datagrids URL generation
gplanchat Jan 17, 2019
1b24f03
Fixed tree URL generation
gplanchat Jan 17, 2019
df7d508
Fixed js URL generation
gplanchat Jan 17, 2019
6153ffb
Fix document list grid on team storage
Jan 17, 2019
4f5cee6
Fixed tree URL generation
gplanchat Jan 17, 2019
f3165ae
Fixed DocumentNode form
gplanchat Jan 17, 2019
29057c9
Fixed JsTree root node ID
gplanchat Jan 17, 2019
349cb20
Removed Document datagrid listener
gplanchat Jan 17, 2019
19f4872
Fixed JsTree interactions with the datagrid
gplanchat Jan 17, 2019
adc7980
Merge branch 'master' into update-jstree-actions
gplanchat Jan 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/DAMBundle/Controller/Api/Rest/DocumentController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php


namespace Kiboko\Bundle\DAMBundle\Controller\Api\Rest;

use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use FOS\RestBundle\Util\Codes;
use Kiboko\Bundle\DAMBundle\Entity\Document;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Oro\Bundle\SecurityBundle\Annotation\Acl;
use Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Response;

/**
* @RouteResource("document")
* @NamePrefix("kiboko_api_")
*/
class DocumentController extends RestController
{
public function deleteAction(Document $document)
{
return $this->handleDeleteRequest($document->getId());
}

public function getForm()
{
// This method is not needed to delete entities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method MUST return a FormInterface object

//
// Note: You will need to provide a proper implementation here
// when you start working with more features of REST APIs.
}

public function getFormHandler()
{
// This method is not needed to delete entities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method MUST return a ApiFormHandler object

//
// Note: You will need to provide a proper implementation here
// when you start working with more features of REST APIs.
}

public function getManager()
{
return $this->get('kiboko_dam.document_manager.api');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass the service in the DI

}
}
44 changes: 44 additions & 0 deletions src/DAMBundle/Controller/Api/Rest/DocumentNodeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php


namespace Kiboko\Bundle\DAMBundle\Controller\Api\Rest;

use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use FOS\RestBundle\Util\Codes;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController;
use Symfony\Component\HttpFoundation\Response;

/**
* @RouteResource("document_node")
* @NamePrefix("kiboko_api_")
*/
class DocumentNodeController extends RestController
{
public function deleteAction($id)
{
return $this->handleDeleteRequest($id);
}

public function getForm()
{
// This method is not needed to delete entities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method MUST return a FormInterface object

//
// Note: You will need to provide a proper implementation here
// when you start working with more features of REST APIs.
}

public function getFormHandler()
{
// This method is not needed to delete entities.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method MUST return a ApiFormHandler object

//
// Note: You will need to provide a proper implementation here
// when you start working with more features of REST APIs.
}

public function getManager()
{
return $this->get('kiboko.document_node_manager.api');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass the service in the DI

}
}
4 changes: 3 additions & 1 deletion src/DAMBundle/Controller/AssetWidgetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public function __construct(
* @Route("/{uuid}",
* name="kiboko_dam_upload_asset_widget",
* requirements={"uuid"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"},
*
* options={
* "expose"=true,
* },
* )
*
* @ParamConverter("node",
Expand Down
79 changes: 79 additions & 0 deletions src/DAMBundle/Controller/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Kiboko\Bundle\DAMBundle\Entity\Document;
use Kiboko\Bundle\DAMBundle\Form\Handler\DocumentHandler;
use Kiboko\Bundle\DAMBundle\Form\Type\DocumentType;
use Kiboko\Bundle\DAMBundle\Model\DocumentNodeInterface;
use Oro\Bundle\SecurityBundle\Annotation\Acl;
use Oro\Bundle\UIBundle\Route\Router;
Expand All @@ -13,6 +14,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Translation\TranslatorInterface;

Expand Down Expand Up @@ -133,4 +135,81 @@ private function updateWidget(
]
);
}

/**
* @param Document $document
* @return array|Response
*
* @Route("/{uuid}/view",
* name="kiboko_dam_document_view",
* requirements={"uuid"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"}
gplanchat marked this conversation as resolved.
Show resolved Hide resolved
* )
* @ParamConverter("document",
* class="KibokoDAMBundle:Document",
* options={
* "mapping": {
* "uuid": "uuid",
* },
* "map_method_signature" = true,
* }
* )
* @Acl(
* id="kiboko_dam_document_view",
* type="entity",
* class="KibokoDAMBundle:DocumentDocument",
* permission="VIEW"
* )
* @Template()
*/
public function viewAction(Document $document)
{
return [
'entity' => $document,
];
}


/**
* @param Document $document
* @param Request $request
* @return array|Response
*
* @Route("/{uuid}/update",
* name="kiboko_dam_document_update",
* requirements={"uuid"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"}
* )
* @ParamConverter("document",
* class="KibokoDAMBundle:Document",
* options={
* "mapping": {
* "uuid": "uuid",
* },
* "map_method_signature" = true,
* }
* )
* @Acl(
* id="kiboko_dam_document_view",
* type="entity",
* class="KibokoDAMBundle:DocumentDocument",
* permission="VIEW"
* )
* @Template()
*/
public function updateAction(Document $document, Request $request)
{
return $this->update($document, $request);
}

protected function update(Document $document, Request $request)
{
$form = $this->createForm(DocumentType::class, $document);
gplanchat marked this conversation as resolved.
Show resolved Hide resolved

return $this->get('oro_form.update_handler')->update(
gplanchat marked this conversation as resolved.
Show resolved Hide resolved
$document,
$form,
$this->get('translator')->trans('kiboko.dam.views.document.update.save.label'),
gplanchat marked this conversation as resolved.
Show resolved Hide resolved
$request,
null
gplanchat marked this conversation as resolved.
Show resolved Hide resolved
);
}
}
Loading