2019-10-18 08:16:26 +00:00
|
|
|
import React from "react";
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
import { useSelector } from "react-redux";
|
2019-10-18 08:16:26 +00:00
|
|
|
import WidgetCard from "./WidgetCard";
|
|
|
|
|
import styled from "styled-components";
|
2019-11-25 05:07:27 +00:00
|
|
|
import { WidgetCardProps } from "widgets/BaseWidget";
|
|
|
|
|
import { getWidgetCards } from "selectors/editorSelectors";
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
import { getColorWithOpacity } from "constants/DefaultTheme";
|
2019-10-18 08:16:26 +00:00
|
|
|
|
|
|
|
|
type WidgetSidebarProps = {
|
|
|
|
|
cards: { [id: string]: WidgetCardProps[] };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const MainWrapper = styled.div`
|
|
|
|
|
text-transform: capitalize;
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
padding: 0 10px 20px 10px;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
scrollbar-color: ${props => props.theme.colors.paneCard}
|
|
|
|
|
${props => props.theme.colors.paneBG};
|
|
|
|
|
scrollbar-width: thin;
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
|
width: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-track {
|
|
|
|
|
box-shadow: inset 0 0 6px
|
|
|
|
|
${props => getColorWithOpacity(props.theme.colors.paneBG, 0.3)};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
|
|
background-color: ${props => props.theme.colors.paneCard};
|
|
|
|
|
outline: 1px solid ${props => props.theme.paneText};
|
|
|
|
|
border-radius: ${props => props.theme.radii[1]}px;
|
|
|
|
|
}
|
2019-10-18 08:16:26 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const CardsWrapper = styled.div`
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 1fr 1fr 1fr;
|
|
|
|
|
grid-gap: ${props => props.theme.spaces[1]}px;
|
|
|
|
|
justify-items: stretch;
|
|
|
|
|
align-items: stretch;
|
|
|
|
|
`;
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
const WidgetSidebar = () => {
|
|
|
|
|
const cards = useSelector(getWidgetCards);
|
|
|
|
|
const groups = Object.keys(cards);
|
|
|
|
|
return (
|
|
|
|
|
<MainWrapper>
|
|
|
|
|
{groups.map((group: string) => (
|
|
|
|
|
<React.Fragment key={group}>
|
|
|
|
|
<h5>{group}</h5>
|
|
|
|
|
<CardsWrapper>
|
|
|
|
|
{cards[group].map((card: WidgetCardProps) => (
|
|
|
|
|
<WidgetCard details={card} key={card.key} />
|
|
|
|
|
))}
|
|
|
|
|
</CardsWrapper>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
))}
|
|
|
|
|
</MainWrapper>
|
|
|
|
|
);
|
2019-10-18 08:16:26 +00:00
|
|
|
};
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
WidgetSidebar.displayName = "WidgetSidebar";
|
|
|
|
|
|
|
|
|
|
export default WidgetSidebar;
|