how to remove link to resource list view from menu? - react-admin

I'm currently building out an application that has a boatload of resources that i will need list views of but don't want links to the list views in the menu. Is there a way to have access to them without having links on the side? to create the list i'm doing the following.
<resources
list={EmployeeList}
/>
docs don't mention this so any help would be appreciated.
I have say ~45 resources that i will need to access list views but only 6 or so are major enough to be accessed from the main menu. i'd still want access to them by viewing details of the other lists or show pages.

I'm no sure how or where you need to access these resources, but this is what I've done with some "lesser" resources I don't need to have the "List" view or sidebar link to:
Define
<Resource name="myresource" />
in App.js. Now you can make a list for example inside another resource's "show" view by using <ReferenceManyField resource="myresource" />

Related

React Admin custom route to a Show view

I have an application with more than one show view for a resource. This is because there are different "views" on our complex "user" resource.
I have tried to add the path
<CustomRoutes>
<Route path="/customUserView/:id/show" element={(props) => <CustomShow id={props.match.params.id} resource={'user'}/>} />
</CustomRoutes>
My CustomShow view works perfectly when part of the react admin routes (placed as a show={CustomShow} in a regular resource component, but I can't seem to get it to work outside, in a CustomView.
Thanks for the help
If you are building your CustomShow component based on the standard Show component,
then it requires passing some of the parameters to it (for example, record) via ShowContext.
An implementation based on the RecordContextProvider component may be suitable for you, there is an example here: "SimpleShowLayout - Displays Fields In A Stack".

How do i refresh the sidebar menu after loading resources dynamically in react-admin

I am working on an application using react-admin, where each registered user will have it's own set of resources which are dynamically loaded, we don't know the exact resources upfront. Users register and login using Auth0. The data is fetched from Hasura. The solution is based on the following example to load the resources: https://marmelab.com/react-admin/Admin.html#unplugging-the-admin-using-admincontext-and-adminui
Loading the resources dynamically is working (see snippet below), however i need to refresh the page manually in order to see the resources in the sidebar menu, while the sidebar menu must be updated as soon as the dynamic resources are available. After logging out and logging back in, the resources are again not visible and a refresh is required again.
function AsyncResources() {
...
return (
<AdminUI
title="Hasura Dashboard"
dashboard={Dashboard}
history={history}
loginPage={LoginPage}
layout={Layout}
>
{resources.map(resource => (
<Resource name={resource.name} key={resource.name} options={getOptions(resource.name)} list={getList(resource.name)} />
))}
<Resource /> { /* Without this Resource, the initial page doesn't load */ }
</AdminUI>
);
}
I had a look at the following issues regarding the same topic, but i couldn't find a definite solution to my specific problem: https://github.com/marmelab/react-admin/issues/5177
with answer: "Basically you write components for every resource but only enable what you want." This is not a solution for me because that would mean i have to manually add every single resource of every new registered user.
I already created a custom Menu to see if that would help, but shows the same behaviour as the default Menu.
How can i make sure the dynamic loaded resources are visible in the menu without the user having to refresh the window after logging in?

Sensenet: Pagination on Document Library

It is possible to define pagination on document library?
I have a document library with more that 10000 documents... when I open the library occurs an timeout.
Actually SenseNet already does this! They just don't deliver it in the standard list control. If you open up the PRC and navigate to /Root/IMS/BuiltIn/Portal you'll see a list control with paging. The code can be found at /Root/Global/renderers/UserExploreGrid.ascx as User Control portlet. You can copy the code and change it to meet your needs.
Our company prefers to create User Control portlets and use Datatables with calls to the SenseNet OData API using skip and top to deliver pages.
Finally, given that SenseNet Content is stored as a tree structure (in SQL!), you can move the Content after creation so that data is organized hierarchically. A common solution is to take the first letter of the DisplayName and create a sub-folder from that letter, thereby reducing the number of items at a single node.
Here's what the paging looks like:
The short answer is no. Right now there isn't a built in functionality for that.
The long answer is that you can make a pagination yourself. One of the core member of sensenet made a grid where you can use pagination. It won't work with the current free to use releases because they lack the js files she used. But the idea behind it, is using a custom view. Which you can achieve by adding a system folder named Views under a the Document library and adding your custom view there.
You can use this grid for Explore, just follow these steps:
Go to the Explore action page, and switch editor mode on the PRC.
Place a ClientContext portlet (this can find under the Portlets->Application section in the portlet picker dialog) to the Wide column. Set portlet (client context porlet) properties, Apparance to None. It is a technical portlet, which allow get the CurrentContext in javascript. This is a very important element to work with this grid. The Grid use the client context.
Place a UserControlPortlet (In the portlet picker, Portlets->Application section) to the Wide Column.
Set portlet properties:
4.1. Portlet title: <%$ Resources: PortletTitles, Items%>
4.2. User Control path: /Root/Global/renderers/UserExploreGrid.ascx
Checkin Page modification on the PRC.
Enjoy your pageable explore portlet.
Keep in mind that this grid is specifically designed for users, so they will miss actions in the top menu. These must be handwritten. Then I suggest you copy the UserControl ( /Root/Global/renderers/UserExploreGrid.ascx)
and then put the action list on it . You can read more info about action list here: http://wiki.sensenet.com/ActionList
Br,
maros

Piranha CMS customisation

A few questions on customisation with Piranha CMS.
Is there a way to create additional custom site-wide items similar to those from the site helper? http://piranhacms.org/docs/api-reference/site-helper
e.g. to be able to set a phone number used throughout the site but still editable in the settings section of the manager.
Is is possible to create additional custom items for a page, e.g. page subtitle, and for those to appear in the Information section of page editing? Creating a region for say a page subtitle seems overkill.
Is it possible to create a custom page type with a region that is a collection of HtmlRegions or similar? e.g. for the purpose of managing a set of FAQs or similar enumerated content?
Is is possible to define custom settings properties for a page type?
Yes, you can add regions to your site in the same way as with page types under Settings > Sites. You then add content for them under Content > Pages > Edit Site.
You can add simple text properties on the page type. They will be shown as single line text inputs under Properties when editing the page.
No native support, however the region body can be anything that can be serialized to JSON so you have to handle this in the edit view for your region.
There is no support for injecting fields into the page settings, however if it's important you can override the whole edit view for pages and do anything you like by placing a copy of the view in the manager area in your local project. You can find the views in the github repo in the 2.2.5 branch.
Regards
HÃ¥kan

showing different views to different users in sharepoint 2010

I have a list in a sharepoint site and i want to show different views of the same list to different groups of users. Is it possible in sharepoint 2010?
I don't believe you can assign a view to an audience through default functionality.
There is a solution though. Each list view is assigned its own unique url. You can take the URL's for each view and add it to the Navigation bar. You can then assign an audience to each of the links. This will allow a member of that particular audience to have a link that will take them directly to the desired view.
DISCLAIMER: This should not be used as a form of security. I believe if someone has access to the list they will be able to change to any view that they want.
For anyone else finding this, you can also add multiple views as webparts and target them by audience. I have not noticed any performance issues doing this. The only problem I have had is that once the webpart takes the view it does not update when the view parameters change.
I achieved this by creating another view. The default view which is the All documents view had users able to see only documents they have uploaded. Then the other view i did a view permission to show/hide view to specific users