mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-30 02:12:39 +00:00
Merge branch 'master' into feature/WIFI-661
# Conflicts: # app/containers/Profiles/index.js
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { useContext } from 'react';
|
||||
import { AddProfile as AddProfilePage } from '@tip-wlan/wlan-cloud-ui-library';
|
||||
import { useMutation, useQuery, gql } from '@apollo/client';
|
||||
import { notification } from 'antd';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import UserContext from 'contexts/UserContext';
|
||||
import { GET_ALL_PROFILES } from 'graphql/queries';
|
||||
@@ -36,6 +37,7 @@ const AddProfile = () => {
|
||||
variables: { customerId, type: 'ssid', limit: 100 },
|
||||
});
|
||||
const [createProfile] = useMutation(CREATE_PROFILE);
|
||||
const history = useHistory();
|
||||
|
||||
const handleAddProfile = (profileType, name, details, childProfileIds = []) => {
|
||||
createProfile({
|
||||
@@ -52,6 +54,7 @@ const AddProfile = () => {
|
||||
message: 'Success',
|
||||
description: 'Profile successfully created.',
|
||||
});
|
||||
history.push('/profiles', { refetch: true});
|
||||
})
|
||||
.catch(() =>
|
||||
notification.error({
|
||||
|
||||
@@ -12,7 +12,12 @@ import ClientDeviceDetails from 'containers/Network/containers/ClientDeviceDetai
|
||||
import BulkEditAccessPoints from 'containers/Network/containers/BulkEditAccessPoints';
|
||||
|
||||
import UserContext from 'contexts/UserContext';
|
||||
import { GET_ALL_LOCATIONS, GET_LOCATION, GET_ALL_PROFILES } from 'graphql/queries';
|
||||
import {
|
||||
GET_ALL_LOCATIONS,
|
||||
GET_LOCATION,
|
||||
GET_ALL_PROFILES,
|
||||
FILTER_EQUIPMENT,
|
||||
} from 'graphql/queries';
|
||||
import {
|
||||
CREATE_LOCATION,
|
||||
UPDATE_LOCATION,
|
||||
@@ -37,13 +42,21 @@ const Network = () => {
|
||||
const [createLocation] = useMutation(CREATE_LOCATION);
|
||||
const [updateLocation] = useMutation(UPDATE_LOCATION);
|
||||
const [deleteLocation] = useMutation(DELETE_LOCATION);
|
||||
const [createEquipment] = useMutation(CREATE_EQUIPMENT);
|
||||
const [checkedLocations, setCheckedLocations] = useState([]);
|
||||
const [deleteModal, setDeleteModal] = useState(false);
|
||||
const [editModal, setEditModal] = useState(false);
|
||||
const [addModal, setAddModal] = useState(false);
|
||||
const [apModal, setApModal] = useState(false);
|
||||
|
||||
const [createEquipment] = useMutation(CREATE_EQUIPMENT, {
|
||||
refetchQueries: [
|
||||
{
|
||||
query: FILTER_EQUIPMENT,
|
||||
variables: { customerId, locationIds: checkedLocations, equipmentType: 'AP' },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const handleGetSingleLocation = id => {
|
||||
getLocation({
|
||||
variables: { id },
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React, { useContext } from 'react';
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { useQuery, useMutation, gql } from '@apollo/client';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { Alert, notification } from 'antd';
|
||||
import { Profile as ProfilePage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
|
||||
|
||||
@@ -23,6 +24,13 @@ const Profiles = () => {
|
||||
}
|
||||
);
|
||||
const [deleteProfile] = useMutation(DELETE_PROFILE);
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (location.state && location.state.refetch) {
|
||||
refetch();
|
||||
}
|
||||
}, []);
|
||||
|
||||
const reloadTable = () => {
|
||||
refetch()
|
||||
|
||||
Reference in New Issue
Block a user