Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b30d1bf
[#762] Create entity tab and update master data tab
ifirmawan Dec 8, 2023
3668c37
[#762] Implements entity list API
ifirmawan Dec 8, 2023
1f33566
[#762] Implements add/edit and delete entity API
ifirmawan Dec 8, 2023
56c3d38
[#762] Create entity data list page & implements the list API
ifirmawan Dec 8, 2023
f2d3cd0
[#762] Create entity data form and implements the CRUD API
ifirmawan Dec 8, 2023
3686ae6
[#762] Update master data entities routes
ifirmawan Dec 8, 2023
62485f4
[#762] Remove unused placeholders
ifirmawan Dec 8, 2023
c576643
Merge branch 'develop' into feature/762-entities-management-api-imple…
ifirmawan Dec 8, 2023
18fbb68
[#762] Fix missing store, uiText, page_path after merging develop
ifirmawan Dec 8, 2023
2243610
[#762] Remove unused detail table component
ifirmawan Dec 8, 2023
dfce78c
[#762] Add ui-text for master data entity & some common text
ifirmawan Dec 8, 2023
0b590b4
[#762] Update ui-text in entity list page
ifirmawan Dec 8, 2023
2a4f342
[#762] Update ui-text in entity data page
ifirmawan Dec 8, 2023
a196647
Merge branch 'develop' into feature/762-entities-management-api-imple…
ifirmawan Dec 8, 2023
b385cb6
Merge branch 'develop' into feature/762-entities-management-api-imple…
ifirmawan Dec 11, 2023
672aca7
[#762] Add entities & entity type in masterdata tab
ifirmawan Dec 11, 2023
6d21bdb
[#762] Remove inner entity tabs
ifirmawan Dec 11, 2023
941da73
[#762] Replace card with table wrapper in entity types page
ifirmawan Dec 11, 2023
d5f6f78
[#762] Create initial filter entity data component
ifirmawan Dec 11, 2023
49754b6
[#762] Replace card with table wrapper in entity data page
ifirmawan Dec 11, 2023
7a23ebf
[#762] Add slash in master data entities URL
ifirmawan Dec 11, 2023
255fda0
Merge branch 'develop' into feature/762-entities-management-api-imple…
ifirmawan Dec 11, 2023
efa7ec8
[#762] Remove unused EntityTab
ifirmawan Dec 12, 2023
4e0ca2f
[#762] Add entity types text
ifirmawan Dec 12, 2023
4480f71
[#762] Refact: manage entities routes
ifirmawan Dec 12, 2023
a69e8d6
[#762] Add entity type text
ifirmawan Dec 12, 2023
d05a871
[#762] Fix master data entities column order
ifirmawan Dec 12, 2023
698fdb5
Merge branch 'develop' into feature/762-entities-management-api-imple…
ifirmawan Dec 12, 2023
6a0ed53
[#762] Add search text for manage entities
ifirmawan Dec 12, 2023
0a411d0
[#762] Remove unused adm dropdown in entity type filter
ifirmawan Dec 12, 2023
594fdcc
[#762] Update search placeholder in entity filter
ifirmawan Dec 12, 2023
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
22 changes: 20 additions & 2 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import {
AddAdministration,
AddAttribute,
AddEntity,
EntityData,
AddEntityData,
// Visualisation,
} from "./pages";
import { useCookies } from "react-cookie";
Expand Down Expand Up @@ -199,13 +201,29 @@ const RouteList = () => {
element={<Private element={AddAttribute} alias="master-data" />}
/>
<Route
path="/master-data/entities"
path="/master-data/entity-types"
element={<Private element={MasterDataEntities} alias="master-data" />}
/>
<Route
path="/master-data/entities/add"
path="/master-data/entity-types/add"
element={<Private element={AddEntity} alias="master-data" />}
/>
<Route
path="/master-data/entity-types/:id/edit"
element={<Private element={AddEntity} alias="master-data" />}
/>
<Route
path="/master-data/entities"
element={<Private element={EntityData} alias="master-data" />}
/>
<Route
path="/master-data/entities/add"
element={<Private element={AddEntityData} alias="master-data" />}
/>
<Route
path="/master-data/entities/:id/edit"
element={<Private element={AddEntityData} alias="master-data" />}
/>
<Route path="/news-events" element={<NewsEvents />} />
<Route path="/how-we-work" element={<HowWeWork />} />
<Route path="/terms" element={<Terms />} />
Expand Down
124 changes: 0 additions & 124 deletions frontend/src/components/DetailTable.jsx

This file was deleted.

56 changes: 56 additions & 0 deletions frontend/src/components/filters/EntityDataFilters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, { useMemo } from "react";
import { Link } from "react-router-dom";
import { Button, Col, Input, Row, Space } from "antd";
import RemoveFiltersButton from "./RemoveFiltersButton";
import AdministrationDropdown from "./AdministrationDropdown";
import { store, uiText } from "../../lib";

const { Search } = Input;

const EntityDataFilters = ({ loading }) => {
const authUser = store.useState((s) => s.user);
const language = store.useState((s) => s.language);
const { active: activeLang } = language;
const text = useMemo(() => {
return uiText[activeLang];
}, [activeLang]);

return (
<Row>
<Col flex={1}>
<Space>
<Search
placeholder={text.searchEntity}
// value={query}
// onChange={(e) => {
// setQuery(e.target.value);
// }}
// onSearch={(e) => {
// fetchData(e);
// }}
style={{ width: 240 }}
// loading={loading && !!query}
allowClear
/>
<AdministrationDropdown loading={loading} />
<RemoveFiltersButton
extra={(s) => {
s.filters = { trained: null, role: null, organisation: null };
}}
/>
</Space>
</Col>
{["Super Admin"].includes(authUser?.role?.value) && (
<Col>
<Space>
<Button type="primary">{text.exportButton}</Button>
<Link to="/master-data/entities/add">
<Button type="primary">{text.addEntityData}</Button>
</Link>
</Space>
</Col>
)}
</Row>
);
};
export default EntityDataFilters;
41 changes: 12 additions & 29 deletions frontend/src/components/filters/EntityFilters.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { Button, Col, Input, Row, Space } from "antd";
import RemoveFiltersButton from "./RemoveFiltersButton";
import AdministrationDropdown from "./AdministrationDropdown";
import { store } from "../../lib";
import React, { useMemo } from "react";
import { Link } from "react-router-dom";
import {
PlusOutlined,
DownloadOutlined,
UploadOutlined,
} from "@ant-design/icons";
import { Button, Col, Input, Row, Space } from "antd";
import { store, uiText } from "../../lib";

const { Search } = Input;

const EntityFilters = ({ loading }) => {
const EntityFilters = () => {
const authUser = store.useState((s) => s.user);
const language = store.useState((s) => s.language);
const { active: activeLang } = language;
const text = useMemo(() => {
return uiText[activeLang];
}, [activeLang]);

return (
<Row>
<Col flex={1}>
<Space>
<Search
placeholder="Enter name..."
placeholder={text.searchEntityType}
// value={query}
// onChange={(e) => {
// setQuery(e.target.value);
Expand All @@ -31,29 +30,13 @@ const EntityFilters = ({ loading }) => {
// loading={loading && !!query}
allowClear
/>
<AdministrationDropdown loading={loading} />
<RemoveFiltersButton
extra={(s) => {
s.filters = { trained: null, role: null, organisation: null };
}}
/>
</Space>
</Col>
{["Super Admin"].includes(authUser?.role?.value) && (
<Col>
<Space>
<Link to="/data/upload">
<Button icon={<UploadOutlined />} shape="round">
Bulk Upload
</Button>
</Link>
<Button icon={<DownloadOutlined />} shape="round">
Export
</Button>
<Link to="/master-data/entities/add">
<Button type="primary" icon={<PlusOutlined />} shape="round">
Add New
</Button>
<Link to="/master-data/entity-types/add">
<Button type="primary">{text.addEntity}</Button>
</Link>
</Space>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export { default as DataTab } from "./tabs/DataTab";
export { default as ContactForm } from "./contact-form/ContactForm";
export { default as ManageDataTab } from "./tabs/MasterDataTab";
export { default as AdministrationFilters } from "./filters/AdministrationFilters";
export { default as DetailTable } from "./DetailTable";
export { default as InputAttributes } from "./InputAttributes";
export { default as EntityFilters } from "./filters/EntityFilters";
export { default as EntityDataFilters } from "./filters/EntityDataFilters";
5 changes: 4 additions & 1 deletion frontend/src/components/tabs/MasterDataTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const MasterDataTab = ({ tabBarExtraContent }) => {
<TabPane tab="Attributes" key="/master-data/attributes">
&nbsp;
</TabPane>
<TabPane tab="Entities" key="/master-data/entities">
<TabPane tab="Entities" key="/master-data/entities/">
&nbsp;
</TabPane>
<TabPane tab="Entity Types" key="/master-data/entity-types/">
&nbsp;
</TabPane>
<TabPane tab="Organisations" key="/master-data/organisations">
Expand Down
Loading