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 all 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
41 changes: 41 additions & 0 deletions src/DAMBundle/Controller/Api/Rest/DocumentController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

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

use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use Kiboko\Bundle\DAMBundle\Entity\Document;
use Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController;

/**
* @RouteResource("document")
* @NamePrefix("kiboko_api_")
*/
final 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

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

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

use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\RouteResource;
use Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController;

/**
* @RouteResource("document_node")
* @NamePrefix("kiboko_api_")
*/
final 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

}
}
59 changes: 31 additions & 28 deletions src/DAMBundle/Controller/AssetWidgetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,15 @@
use Symfony\Component\Translation\TranslatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;


/**
* @Route("/asset-widget", service="kiboko_dam.controller.asset_widget")
*/
class AssetWidgetController extends Controller
final class AssetWidgetController extends Controller
{
/**
* @var ContextHelper
*/
private $helper;

/**
* @var EntityManager $em
* @var FormInterface
*/
private $em;
private $form;

/**
* @var UpdateHandlerFacade
Expand All @@ -47,53 +41,61 @@ class AssetWidgetController extends Controller
private $translator;

/**
* @var FormInterface
* @var ContextHelper
*/
private $form;
private $helper;

/**
* @var EntityManager $em
*/
private $em;

/**
* @var string
*/
private $projectDir;

/**
* @param ContextHelper $helper
* @param FormInterface $form
* @param UpdateHandlerFacade $formUpdateHandler
* @param TranslatorInterface $translator
* @param FormInterface $form
* @param ContextHelper $helper
* @param EntityManager $em
* @param string $projectDir
*/
public function __construct(
ContextHelper $helper,
FormInterface $form,
UpdateHandlerFacade $formUpdateHandler,
TranslatorInterface $translator,
FormInterface $form,
ContextHelper $helper,
EntityManager $em,
string $projectDir
) {
$this->helper = $helper;
$this->form = $form;
$this->formUpdateHandler = $formUpdateHandler;
$this->translator = $translator;
$this->form = $form;
$this->helper = $helper;
$this->em = $em;
$this->projectDir = $projectDir;
}

/**
* @param Request $request
* @param DocumentNodeInterface $node
*
* @Route("/{uuid}",
* @Route("/{node}",
* name="kiboko_dam_upload_asset_widget",
* requirements={"uuid"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"},
*
* requirements={"node"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"},
* options={
* "expose"=true,
* },
* )
*
* @ParamConverter("node",
* class="KibokoDAMBundle:DocumentNode",
* options={
* "mapping": {"uuid": "uuid"},
* "mapping": {
* "node": "uuid"
* },
* "map_method_signature" = true,
* }
* )
Expand All @@ -102,16 +104,15 @@ public function __construct(
*
* @return array
*/
public function widgetAction(Request $request, DocumentNodeInterface $node)
public function widgetAction(DocumentNodeInterface $node)
{
return [
'form' => $this->form->createView(),
'formAction' => $this->generateUrl(
'kiboko_dam_upload_asset',
[
'uuid' => $node->getUuid()->toString(),
'node' => $node->getUuid()->toString(),
]

)
];
}
Expand All @@ -122,16 +123,18 @@ public function widgetAction(Request $request, DocumentNodeInterface $node)
*
* @return Response
*
* @Route("/{uuid}/upload",
* @Route("/{node}/upload",
* name="kiboko_dam_upload_asset",
* requirements={"uuid"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"},
* requirements={"node"="[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}"},
*
* )
* @Method({"POST", "PUT"})
* @ParamConverter("node",
* class="KibokoDAMBundle:DocumentNode",
* options={
* "mapping": {"uuid": "uuid"},
* "mapping": {
* "node": "uuid"
* },
* "map_method_signature" = true,
* }
* )
Expand Down
Loading