mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix delete category issue
This commit is contained in:
parent
c0ff4ba34d
commit
62d6abe68e
@ -65,17 +65,19 @@ class ManageCategories extends React.Component {
|
||||
"Category Removed Successfully!",
|
||||
});
|
||||
|
||||
this.setState({
|
||||
loading: false
|
||||
|
||||
console.log("g");
|
||||
const {categories} = this.state;
|
||||
const remainingElements = categories.filter(function (value) {
|
||||
return value.categoryName !== id;
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.setState({
|
||||
loading: false,
|
||||
categories: remainingElements
|
||||
});
|
||||
// this.setState({
|
||||
// categories: [...categories, ...tempElements],
|
||||
// tempElements: [],
|
||||
// inputVisible: false,
|
||||
// inputValue: '',
|
||||
// loading: false,
|
||||
// isAddNewVisible: false
|
||||
// });
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
@ -135,12 +137,12 @@ class ManageCategories extends React.Component {
|
||||
};
|
||||
|
||||
renderTempElement = (category) => {
|
||||
const {tempElements} = this.state;
|
||||
const tagElem = (
|
||||
<Tag
|
||||
closable
|
||||
onClose={e => {
|
||||
onClose={e=>{
|
||||
e.preventDefault();
|
||||
const {tempElements} = this.state;
|
||||
const remainingElements = tempElements.filter(function (value) {
|
||||
|
||||
return value.categoryName !== category.categoryName;
|
||||
|
||||
@ -4,9 +4,9 @@ import {Layout, Menu, Icon} from 'antd';
|
||||
const {Header, Content, Footer} = Layout;
|
||||
|
||||
import Logo from "../../../public/images/logo.svg";
|
||||
import {Link, NavLink} from "react-router-dom";
|
||||
import {BrowserRouter,Switch,Link, NavLink} from "react-router-dom";
|
||||
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
|
||||
import {Switch, Redirect} from 'react-router'
|
||||
import {Redirect} from 'react-router'
|
||||
import "../../App.css";
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
@ -41,13 +41,15 @@ class Dashboard extends React.Component {
|
||||
</Layout>
|
||||
<Layout>
|
||||
<Content style={{padding: '0 0'}}>
|
||||
<Switch>
|
||||
<Redirect exact from="/publisher" to="/publisher/apps"/>
|
||||
{this.state.routes.map((route) => (
|
||||
<RouteWithSubRoutes key={route.path} {...route} />
|
||||
))}
|
||||
<BrowserRouter>
|
||||
<Switch>
|
||||
<Redirect exact from="/publisher" to="/publisher/apps"/>
|
||||
{this.state.routes.map((route) => (
|
||||
<RouteWithSubRoutes key={route.path} {...route} />
|
||||
))}
|
||||
|
||||
</Switch>
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
|
||||
</Content>
|
||||
<Footer style={{textAlign: 'center'}}>
|
||||
|
||||
@ -35,7 +35,7 @@ class Manage extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<PageHeader
|
||||
breadcrumb={{routes}}
|
||||
// breadcrumb={{routes}}
|
||||
title = "Manage"
|
||||
>
|
||||
<div className="wrap">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user