mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ui.git
				synced 2025-11-04 04:37:53 +00:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			v1.1.0
			...
			feature/NE
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					0439b052ca | ||
| 
						 | 
					448a198c23 | ||
| 
						 | 
					f989132de6 | ||
| 
						 | 
					a6406e2be3 | ||
| 
						 | 
					0748ddbed1 | 
							
								
								
									
										21
									
								
								.github/workflows/dockerpublish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/dockerpublish.yml
									
									
									
									
										vendored
									
									
								
							@@ -5,7 +5,6 @@ on:
 | 
				
			|||||||
    # Publish `master` as Docker `latest` image.
 | 
					    # Publish `master` as Docker `latest` image.
 | 
				
			||||||
    branches:
 | 
					    branches:
 | 
				
			||||||
      - master
 | 
					      - master
 | 
				
			||||||
      - 'release/**'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Publish `v1.2.3` tags as releases.
 | 
					    # Publish `v1.2.3` tags as releases.
 | 
				
			||||||
    tags:
 | 
					    tags:
 | 
				
			||||||
@@ -15,8 +14,8 @@ on:
 | 
				
			|||||||
  pull_request:
 | 
					  pull_request:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  schedule:
 | 
					  schedule:
 | 
				
			||||||
    # runs nightly build at 5AM
 | 
					      # runs nightly build at 5AM
 | 
				
			||||||
    - cron: '00 09 * * *'
 | 
					      - cron:  '00 09 * * *'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
env:
 | 
					env:
 | 
				
			||||||
  IMAGE_NAME: wlan-cloud-ui
 | 
					  IMAGE_NAME: wlan-cloud-ui
 | 
				
			||||||
@@ -49,7 +48,7 @@ jobs:
 | 
				
			|||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v2
 | 
					      - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Adding property file with component version and commit hash
 | 
					      - name: Adding property file with component version and commit hash 
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          # Strip git ref prefix from version
 | 
					          # Strip git ref prefix from version
 | 
				
			||||||
          VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
 | 
					          VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
 | 
				
			||||||
@@ -57,11 +56,8 @@ jobs:
 | 
				
			|||||||
          # Strip "v" prefix from tag name
 | 
					          # Strip "v" prefix from tag name
 | 
				
			||||||
          [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
 | 
					          [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          # Create a release snapshot if we are on release branch
 | 
					 | 
				
			||||||
          [[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          # Use Docker `latest` tag convention
 | 
					          # Use Docker `latest` tag convention
 | 
				
			||||||
          [ "$VERSION" == "master" ] && VERSION=1.1.0-SNAPSHOT
 | 
					          [ "$VERSION" == "master" ] && VERSION=latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          TIMESTAMP=$(date +'%Y-%m-%d')
 | 
					          TIMESTAMP=$(date +'%Y-%m-%d')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -92,11 +88,8 @@ jobs:
 | 
				
			|||||||
          # Strip "v" prefix from tag name
 | 
					          # Strip "v" prefix from tag name
 | 
				
			||||||
          [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
 | 
					          [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          # Create a release snapshot if we are on release branch
 | 
					 | 
				
			||||||
          [[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          # Use Docker `latest` tag convention
 | 
					          # Use Docker `latest` tag convention
 | 
				
			||||||
          [ "$VERSION" == "master" ] && VERSION=1.1.0-SNAPSHOT
 | 
					          [ "$VERSION" == "master" ] && VERSION=latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          echo IMAGE_ID=$IMAGE_ID
 | 
					          echo IMAGE_ID=$IMAGE_ID
 | 
				
			||||||
          echo VERSION=$VERSION
 | 
					          echo VERSION=$VERSION
 | 
				
			||||||
@@ -104,6 +97,6 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
          docker tag image $IMAGE_ID:$VERSION
 | 
					          docker tag image $IMAGE_ID:$VERSION
 | 
				
			||||||
          docker push $IMAGE_ID:$VERSION
 | 
					          docker push $IMAGE_ID:$VERSION
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
          docker tag image $IMAGE_ID:$VERSION-$TIMESTAMP
 | 
					          docker tag image $IMAGE_ID:$VERSION-$TIMESTAMP
 | 
				
			||||||
          docker push $IMAGE_ID:$VERSION-$TIMESTAMP
 | 
					          docker push $IMAGE_ID:$VERSION-$TIMESTAMP          
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										58
									
								
								app/components/UsersDropdown/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								app/components/UsersDropdown/index.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
				
			|||||||
 | 
					import React, { useState } from 'react';
 | 
				
			||||||
 | 
					import PropTypes from 'prop-types';
 | 
				
			||||||
 | 
					import { Link } from 'react-router-dom';
 | 
				
			||||||
 | 
					import { Popover, Row } from 'antd';
 | 
				
			||||||
 | 
					import { UserOutlined } from '@ant-design/icons';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import styles from './index.module.scss';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const UsersDropdown = ({ onLogout }) => {
 | 
				
			||||||
 | 
					  const [popoverVisible, setPopoverVisible] = useState(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const hidePopover = () => {
 | 
				
			||||||
 | 
					    setPopoverVisible(false);
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleVisibleChange = visible => {
 | 
				
			||||||
 | 
					    setPopoverVisible(visible);
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const userOptions = (
 | 
				
			||||||
 | 
					    <>
 | 
				
			||||||
 | 
					      <Row>
 | 
				
			||||||
 | 
					        <Link onClick={hidePopover} to="/account">
 | 
				
			||||||
 | 
					          Account
 | 
				
			||||||
 | 
					        </Link>
 | 
				
			||||||
 | 
					      </Row>
 | 
				
			||||||
 | 
					      <Row>
 | 
				
			||||||
 | 
					        <Link onClick={onLogout} to="/">
 | 
				
			||||||
 | 
					          Log Out
 | 
				
			||||||
 | 
					        </Link>
 | 
				
			||||||
 | 
					      </Row>
 | 
				
			||||||
 | 
					    </>
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return (
 | 
				
			||||||
 | 
					    <Popover
 | 
				
			||||||
 | 
					      content={userOptions}
 | 
				
			||||||
 | 
					      trigger="click"
 | 
				
			||||||
 | 
					      getPopupContainer={e => e.parentElement}
 | 
				
			||||||
 | 
					      visible={popoverVisible}
 | 
				
			||||||
 | 
					      onVisibleChange={handleVisibleChange}
 | 
				
			||||||
 | 
					      placement="bottomRight"
 | 
				
			||||||
 | 
					      arrowPointAtCenter
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
 | 
					      <UserOutlined className={styles.MenuIcon} />
 | 
				
			||||||
 | 
					    </Popover>
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					UsersDropdown.propTypes = {
 | 
				
			||||||
 | 
					  onLogout: PropTypes.func,
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					UsersDropdown.defaultProps = {
 | 
				
			||||||
 | 
					  onLogout: () => {},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default UsersDropdown;
 | 
				
			||||||
							
								
								
									
										7
									
								
								app/components/UsersDropdown/index.module.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								app/components/UsersDropdown/index.module.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					.MenuIcon {
 | 
				
			||||||
 | 
					    cursor: pointer;
 | 
				
			||||||
 | 
					    font-size: 18px;
 | 
				
			||||||
 | 
					    line-height: 64px;
 | 
				
			||||||
 | 
					    padding: 0 24px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
@@ -7,7 +7,7 @@ import { useHistory } from 'react-router-dom';
 | 
				
			|||||||
import { ROUTES } from 'constants/index';
 | 
					import { ROUTES } from 'constants/index';
 | 
				
			||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
import { GET_ALL_PROFILES } from 'graphql/queries';
 | 
					import { GET_ALL_PROFILES } from 'graphql/queries';
 | 
				
			||||||
import { fetchMoreProfiles } from 'graphql/functions';
 | 
					import { updateQueryGetAllProfiles } from 'graphql/functions';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const CREATE_PROFILE = gql`
 | 
					const CREATE_PROFILE = gql`
 | 
				
			||||||
  mutation CreateProfile(
 | 
					  mutation CreateProfile(
 | 
				
			||||||
@@ -37,43 +37,24 @@ const AddProfile = () => {
 | 
				
			|||||||
  const { customerId } = useContext(UserContext);
 | 
					  const { customerId } = useContext(UserContext);
 | 
				
			||||||
  const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'ssid' },
 | 
					    variables: { customerId, type: 'ssid' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  const { data: radiusProfiles, fetchMore: fetchMoreRadiusProfiles } = useQuery(
 | 
					 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      variables: { customerId, type: 'radius' },
 | 
					 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
  const { data: captiveProfiles, fetchMore: fetchMoreCaptiveProfiles } = useQuery(
 | 
					 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      variables: { customerId, type: 'captive_portal' },
 | 
					 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
  const { data: venueProfiles, fetchMore: fetchMoreVenueProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: venueProfiles, fetchMore: fetchMoreVenueProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'passpoint_venue' },
 | 
					    variables: { customerId, type: 'passpoint_venue' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
 | 
					  const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'passpoint_operator' },
 | 
					      variables: { customerId, type: 'passpoint_operator' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
  const { data: idProviderProfiles, fetchMore: fetchMoreIdProviderProfiles } = useQuery(
 | 
					  const { data: idProviderProfiles, fetchMore: fetchMoreIdProviderProfiles } = useQuery(
 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'passpoint_osu_id_provider' },
 | 
					      variables: { customerId, type: 'passpoint_osu_id_provider' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
  const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'rf' },
 | 
					    variables: { customerId, type: 'rf' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
  const [createProfile] = useMutation(CREATE_PROFILE);
 | 
					  const [createProfile] = useMutation(CREATE_PROFILE);
 | 
				
			||||||
  const history = useHistory();
 | 
					  const history = useHistory();
 | 
				
			||||||
@@ -103,30 +84,111 @@ const AddProfile = () => {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleFetchMoreProfiles = (e, key) => {
 | 
					  const handleFetchProfiles = e => {
 | 
				
			||||||
    if (key === 'radius') fetchMoreProfiles(e, radiusProfiles, fetchMoreRadiusProfiles);
 | 
					    if (ssidProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
    else if (key === 'captive_portal')
 | 
					      return false;
 | 
				
			||||||
      fetchMoreProfiles(e, captiveProfiles, fetchMoreCaptiveProfiles);
 | 
					    }
 | 
				
			||||||
    else if (key === 'rf') fetchMoreProfiles(e, rfProfiles, fetchMoreRfProfiles);
 | 
					
 | 
				
			||||||
    else if (key === 'passpoint_venue') fetchMoreProfiles(e, venueProfiles, fetchMoreVenueProfiles);
 | 
					    e.persist();
 | 
				
			||||||
    else if (key === 'passpoint_operator')
 | 
					    const { target } = e;
 | 
				
			||||||
      fetchMoreProfiles(e, operatorProfiles, fetchMoreOperatorProfiles);
 | 
					
 | 
				
			||||||
    else if (key === 'passpoint_osu_id_provider')
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
      fetchMoreProfiles(e, idProviderProfiles, fetchMoreIdProviderProfiles);
 | 
					      fetchMore({
 | 
				
			||||||
    else fetchMoreProfiles(e, ssidProfiles, fetchMore);
 | 
					        variables: { context: { ...ssidProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchVenueProfiles = e => {
 | 
				
			||||||
 | 
					    if (venueProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreVenueProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...venueProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchRfProfiles = e => {
 | 
				
			||||||
 | 
					    if (rfProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreRfProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...rfProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchOperatorProfiles = e => {
 | 
				
			||||||
 | 
					    if (operatorProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreOperatorProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...operatorProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchIdProviderProfiles = e => {
 | 
				
			||||||
 | 
					    if (idProviderProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreIdProviderProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...idProviderProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <AddProfilePage
 | 
					    <AddProfilePage
 | 
				
			||||||
      onCreateProfile={handleAddProfile}
 | 
					      onCreateProfile={handleAddProfile}
 | 
				
			||||||
      ssidProfiles={ssidProfiles?.getAllProfiles?.items}
 | 
					      ssidProfiles={
 | 
				
			||||||
      radiusProfiles={radiusProfiles?.getAllProfiles?.items}
 | 
					        (ssidProfiles && ssidProfiles.getAllProfiles && ssidProfiles.getAllProfiles.items) || []
 | 
				
			||||||
      captiveProfiles={captiveProfiles?.getAllProfiles?.items}
 | 
					      }
 | 
				
			||||||
      venueProfiles={venueProfiles?.getAllProfiles?.items}
 | 
					      venueProfiles={venueProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      operatorProfiles={operatorProfiles?.getAllProfiles?.items}
 | 
					      operatorProfiles={operatorProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
 | 
					      idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      rfProfiles={rfProfiles?.getAllProfiles?.items}
 | 
					      rfProfiles={rfProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      onFetchMoreProfiles={handleFetchMoreProfiles}
 | 
					      onFetchMoreProfiles={handleFetchProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreVenueProfiles={handleFetchVenueProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreOperatorProfiles={handleFetchOperatorProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreRfProfiles={handleFetchRfProfiles}
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -92,9 +92,7 @@ const App = () => {
 | 
				
			|||||||
          <ProtectedRouteWithLayout exact path={ROUTES.addprofile} component={AddProfile} />
 | 
					          <ProtectedRouteWithLayout exact path={ROUTES.addprofile} component={AddProfile} />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          <ProtectedRouteWithLayout exact path={ROUTES.alarms} component={Alarms} />
 | 
					          <ProtectedRouteWithLayout exact path={ROUTES.alarms} component={Alarms} />
 | 
				
			||||||
          {user?.id !== 0 && (
 | 
					          <ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
 | 
				
			||||||
            <ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
 | 
					 | 
				
			||||||
          )}
 | 
					 | 
				
			||||||
          {user?.roles?.[0] === 'SuperUser' && (
 | 
					          {user?.roles?.[0] === 'SuperUser' && (
 | 
				
			||||||
            <ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
 | 
					            <ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
 | 
				
			||||||
          )}
 | 
					          )}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,11 +20,8 @@ function formatBytes(bytes, decimals = 2) {
 | 
				
			|||||||
  return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i] || ''}`;
 | 
					  return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i] || ''}`;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function trafficLabelFormatter(bytes) {
 | 
					function trafficLabelFormatter() {
 | 
				
			||||||
  if (this?.value) {
 | 
					  return formatBytes(this.value);
 | 
				
			||||||
    return formatBytes(this.value);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  return formatBytes(bytes);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function trafficTooltipFormatter() {
 | 
					function trafficTooltipFormatter() {
 | 
				
			||||||
@@ -34,7 +31,7 @@ function trafficTooltipFormatter() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const lineChartConfig = [
 | 
					const lineChartConfig = [
 | 
				
			||||||
  { key: 'service', title: 'Inservice APs (24 hours)' },
 | 
					  { key: 'inservicesAPs', title: 'Inservice APs (24 hours)' },
 | 
				
			||||||
  { key: 'clientDevices', title: 'Client Devices (24 hours)' },
 | 
					  { key: 'clientDevices', title: 'Client Devices (24 hours)' },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    key: 'traffic',
 | 
					    key: 'traffic',
 | 
				
			||||||
@@ -59,11 +56,9 @@ const Dashboard = () => {
 | 
				
			|||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const [lineChartData, setLineChartData] = useState({
 | 
					  const [lineChartData, setLineChartData] = useState({
 | 
				
			||||||
    service: {
 | 
					    inservicesAPs: {
 | 
				
			||||||
      inservicesAPs: {
 | 
					      key: 'Inservice APs',
 | 
				
			||||||
        key: 'Inservice APs',
 | 
					      value: [],
 | 
				
			||||||
        value: [],
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    clientDevices: {
 | 
					    clientDevices: {
 | 
				
			||||||
      is2dot4GHz: {
 | 
					      is2dot4GHz: {
 | 
				
			||||||
@@ -126,35 +121,26 @@ const Dashboard = () => {
 | 
				
			|||||||
              },
 | 
					              },
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
          }) => {
 | 
					          }) => {
 | 
				
			||||||
            const timestamp = parseInt(eventTimestamp, 10);
 | 
					            inservicesAPs.push([eventTimestamp, equipmentInServiceCount]);
 | 
				
			||||||
            inservicesAPs.push({ timestamp, value: equipmentInServiceCount });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            let total5GHz = 0;
 | 
					            let total5GHz = 0;
 | 
				
			||||||
            total5GHz += (radios?.is5GHz || 0) + (radios?.is5GHzL || 0) + (radios?.is5GHzU || 0); // combine all 5GHz radios
 | 
					            total5GHz += (radios?.is5GHz || 0) + (radios?.is5GHzL || 0) + (radios?.is5GHzU || 0); // combine all 5GHz radios
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            clientDevices2dot4GHz.push({ timestamp, value: radios.is2dot4GHz || 0 });
 | 
					            clientDevices2dot4GHz.push([eventTimestamp, radios.is2dot4GHz || 0]);
 | 
				
			||||||
            clientDevices5GHz.push({ timestamp, value: total5GHz || 0 });
 | 
					            clientDevices5GHz.push([eventTimestamp, total5GHz || 0]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            trafficBytesDownstreamData.push({
 | 
					            trafficBytesDownstreamData.push([eventTimestamp, trafficBytesDownstream || 0]);
 | 
				
			||||||
              timestamp,
 | 
					            trafficBytesUpstreamData.push([eventTimestamp, trafficBytesUpstream || 0]);
 | 
				
			||||||
              value: (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0,
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            trafficBytesUpstreamData.push({
 | 
					 | 
				
			||||||
              timestamp,
 | 
					 | 
				
			||||||
              value: (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0,
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            totalDown += (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0;
 | 
					            totalDown += trafficBytesDownstream || 0;
 | 
				
			||||||
            totalUp += (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0;
 | 
					            totalUp += trafficBytesUpstream || 0;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
          service: {
 | 
					          inservicesAPs: {
 | 
				
			||||||
            inservicesAPs: {
 | 
					            ...prev.inservicesAPs,
 | 
				
			||||||
              ...prev.service.inservicesAPs,
 | 
					            value: [...prev.inservicesAPs.value, ...inservicesAPs],
 | 
				
			||||||
              value: [...prev.service.inservicesAPs.value, ...inservicesAPs],
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          clientDevices: {
 | 
					          clientDevices: {
 | 
				
			||||||
            is2dot4GHz: {
 | 
					            is2dot4GHz: {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,8 +12,10 @@ import { removeItem } from 'utils/localStorage';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import UsersDropdown from 'components/UsersDropdown';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const MasterLayout = ({ children }) => {
 | 
					const MasterLayout = ({ children }) => {
 | 
				
			||||||
  const { roles, customerId, id: currentUserId } = useContext(UserContext);
 | 
					  const { roles, customerId, email } = useContext(UserContext);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const client = useApolloClient();
 | 
					  const client = useApolloClient();
 | 
				
			||||||
  const location = useLocation();
 | 
					  const location = useLocation();
 | 
				
			||||||
@@ -56,15 +58,11 @@ const MasterLayout = ({ children }) => {
 | 
				
			|||||||
      key: 'settings',
 | 
					      key: 'settings',
 | 
				
			||||||
      text: 'Settings',
 | 
					      text: 'Settings',
 | 
				
			||||||
      children: [
 | 
					      children: [
 | 
				
			||||||
        ...(currentUserId !== 0
 | 
					        {
 | 
				
			||||||
          ? [
 | 
					          key: 'editAccount',
 | 
				
			||||||
              {
 | 
					          path: ROUTES.account,
 | 
				
			||||||
                key: 'editAccount',
 | 
					          text: 'Account',
 | 
				
			||||||
                path: ROUTES.account,
 | 
					        },
 | 
				
			||||||
                text: 'Edit Account',
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          : []),
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          key: 'logout',
 | 
					          key: 'logout',
 | 
				
			||||||
          path: ROUTES.root,
 | 
					          path: ROUTES.root,
 | 
				
			||||||
@@ -94,7 +92,8 @@ const MasterLayout = ({ children }) => {
 | 
				
			|||||||
      menuItems={menuItems}
 | 
					      menuItems={menuItems}
 | 
				
			||||||
      mobileMenuItems={mobileMenuItems}
 | 
					      mobileMenuItems={mobileMenuItems}
 | 
				
			||||||
      totalAlarms={data && data.getAlarmCount}
 | 
					      totalAlarms={data && data.getAlarmCount}
 | 
				
			||||||
      currentUserId={currentUserId}
 | 
					      currentUserEmail={email}
 | 
				
			||||||
 | 
					      usersDropdown={<UsersDropdown onLogout={handleLogout} />}
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
      {children}
 | 
					      {children}
 | 
				
			||||||
    </Layout>
 | 
					    </Layout>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
import React, { useContext } from 'react';
 | 
					import React, { useContext } from 'react';
 | 
				
			||||||
import PropTypes from 'prop-types';
 | 
					import PropTypes from 'prop-types';
 | 
				
			||||||
import { useParams, useHistory } from 'react-router-dom';
 | 
					import { useParams, useHistory } from 'react-router-dom';
 | 
				
			||||||
import { useQuery, useMutation } from '@apollo/client';
 | 
					import { useQuery, useMutation, gql } from '@apollo/client';
 | 
				
			||||||
import { Alert, notification } from 'antd';
 | 
					import { Alert, notification } from 'antd';
 | 
				
			||||||
import moment from 'moment';
 | 
					import moment from 'moment';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
@@ -9,22 +9,126 @@ import {
 | 
				
			|||||||
  Loading,
 | 
					  Loading,
 | 
				
			||||||
} from '@tip-wlan/wlan-cloud-ui-library';
 | 
					} from '@tip-wlan/wlan-cloud-ui-library';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { FILTER_SERVICE_METRICS, GET_ALL_FIRMWARE, GET_ALL_PROFILES } from 'graphql/queries';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
  GET_EQUIPMENT,
 | 
					 | 
				
			||||||
  FILTER_SERVICE_METRICS,
 | 
					 | 
				
			||||||
  GET_ALL_FIRMWARE,
 | 
					 | 
				
			||||||
  GET_ALL_PROFILES,
 | 
					 | 
				
			||||||
} from 'graphql/queries';
 | 
					 | 
				
			||||||
import {
 | 
					 | 
				
			||||||
  UPDATE_EQUIPMENT,
 | 
					 | 
				
			||||||
  DELETE_EQUIPMENT,
 | 
					 | 
				
			||||||
  UPDATE_EQUIPMENT_FIRMWARE,
 | 
					  UPDATE_EQUIPMENT_FIRMWARE,
 | 
				
			||||||
  REQUEST_EQUIPMENT_SWITCH_BANK,
 | 
					  REQUEST_EQUIPMENT_SWITCH_BANK,
 | 
				
			||||||
  REQUEST_EQUIPMENT_REBOOT,
 | 
					  REQUEST_EQUIPMENT_REBOOT,
 | 
				
			||||||
} from 'graphql/mutations';
 | 
					} from 'graphql/mutations';
 | 
				
			||||||
import { fetchMoreProfiles } from 'graphql/functions';
 | 
					import { updateQueryGetAllProfiles } from 'graphql/functions';
 | 
				
			||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const GET_EQUIPMENT = gql`
 | 
				
			||||||
 | 
					  query GetEquipment($id: ID!) {
 | 
				
			||||||
 | 
					    getEquipment(id: $id) {
 | 
				
			||||||
 | 
					      id
 | 
				
			||||||
 | 
					      equipmentType
 | 
				
			||||||
 | 
					      inventoryId
 | 
				
			||||||
 | 
					      customerId
 | 
				
			||||||
 | 
					      profileId
 | 
				
			||||||
 | 
					      locationId
 | 
				
			||||||
 | 
					      name
 | 
				
			||||||
 | 
					      latitude
 | 
				
			||||||
 | 
					      longitude
 | 
				
			||||||
 | 
					      serial
 | 
				
			||||||
 | 
					      lastModifiedTimestamp
 | 
				
			||||||
 | 
					      details
 | 
				
			||||||
 | 
					      profile {
 | 
				
			||||||
 | 
					        id
 | 
				
			||||||
 | 
					        name
 | 
				
			||||||
 | 
					        childProfiles {
 | 
				
			||||||
 | 
					          id
 | 
				
			||||||
 | 
					          name
 | 
				
			||||||
 | 
					          details
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      baseMacAddress
 | 
				
			||||||
 | 
					      manufacturer
 | 
				
			||||||
 | 
					      status {
 | 
				
			||||||
 | 
					        firmware {
 | 
				
			||||||
 | 
					          detailsJSON
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        protocol {
 | 
				
			||||||
 | 
					          detailsJSON
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        radioUtilization {
 | 
				
			||||||
 | 
					          detailsJSON
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        clientDetails {
 | 
				
			||||||
 | 
					          detailsJSON
 | 
				
			||||||
 | 
					          details {
 | 
				
			||||||
 | 
					            numClientsPerRadio
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        osPerformance {
 | 
				
			||||||
 | 
					          detailsJSON
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      model
 | 
				
			||||||
 | 
					      alarmsCount
 | 
				
			||||||
 | 
					      alarms {
 | 
				
			||||||
 | 
					        severity
 | 
				
			||||||
 | 
					        alarmCode
 | 
				
			||||||
 | 
					        details
 | 
				
			||||||
 | 
					        createdTimestamp
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const UPDATE_EQUIPMENT = gql`
 | 
				
			||||||
 | 
					  mutation UpdateEquipment(
 | 
				
			||||||
 | 
					    $id: ID!
 | 
				
			||||||
 | 
					    $equipmentType: String!
 | 
				
			||||||
 | 
					    $inventoryId: String!
 | 
				
			||||||
 | 
					    $customerId: ID!
 | 
				
			||||||
 | 
					    $profileId: ID!
 | 
				
			||||||
 | 
					    $locationId: ID!
 | 
				
			||||||
 | 
					    $name: String!
 | 
				
			||||||
 | 
					    $latitude: String
 | 
				
			||||||
 | 
					    $longitude: String
 | 
				
			||||||
 | 
					    $serial: String
 | 
				
			||||||
 | 
					    $lastModifiedTimestamp: String
 | 
				
			||||||
 | 
					    $details: JSONObject
 | 
				
			||||||
 | 
					  ) {
 | 
				
			||||||
 | 
					    updateEquipment(
 | 
				
			||||||
 | 
					      id: $id
 | 
				
			||||||
 | 
					      equipmentType: $equipmentType
 | 
				
			||||||
 | 
					      inventoryId: $inventoryId
 | 
				
			||||||
 | 
					      customerId: $customerId
 | 
				
			||||||
 | 
					      profileId: $profileId
 | 
				
			||||||
 | 
					      locationId: $locationId
 | 
				
			||||||
 | 
					      name: $name
 | 
				
			||||||
 | 
					      latitude: $latitude
 | 
				
			||||||
 | 
					      longitude: $longitude
 | 
				
			||||||
 | 
					      serial: $serial
 | 
				
			||||||
 | 
					      lastModifiedTimestamp: $lastModifiedTimestamp
 | 
				
			||||||
 | 
					      details: $details
 | 
				
			||||||
 | 
					    ) {
 | 
				
			||||||
 | 
					      id
 | 
				
			||||||
 | 
					      equipmentType
 | 
				
			||||||
 | 
					      inventoryId
 | 
				
			||||||
 | 
					      customerId
 | 
				
			||||||
 | 
					      profileId
 | 
				
			||||||
 | 
					      locationId
 | 
				
			||||||
 | 
					      name
 | 
				
			||||||
 | 
					      latitude
 | 
				
			||||||
 | 
					      longitude
 | 
				
			||||||
 | 
					      serial
 | 
				
			||||||
 | 
					      lastModifiedTimestamp
 | 
				
			||||||
 | 
					      details
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const DELETE_EQUIPMENT = gql`
 | 
				
			||||||
 | 
					  mutation DeleteEquipment($id: ID!) {
 | 
				
			||||||
 | 
					    deleteEquipment(id: $id) {
 | 
				
			||||||
 | 
					      id
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const toTime = moment();
 | 
					const toTime = moment();
 | 
				
			||||||
const fromTime = moment().subtract(1, 'hour');
 | 
					const fromTime = moment().subtract(1, 'hour');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -38,7 +142,6 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
      id,
 | 
					      id,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					    fetchPolicy: 'network-only',
 | 
				
			||||||
    errorPolicy: 'all',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: dataFirmware, error: errorFirmware, loading: loadingFirmware } = useQuery(
 | 
					  const { data: dataFirmware, error: errorFirmware, loading: loadingFirmware } = useQuery(
 | 
				
			||||||
@@ -46,9 +149,9 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      skip: !data?.getEquipment?.model,
 | 
					      skip: !data?.getEquipment?.model,
 | 
				
			||||||
      variables: { modelId: data?.getEquipment?.model },
 | 
					      variables: { modelId: data?.getEquipment?.model },
 | 
				
			||||||
      errorPolicy: 'all',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const {
 | 
					  const {
 | 
				
			||||||
    data: dataProfiles,
 | 
					    data: dataProfiles,
 | 
				
			||||||
    error: errorProfiles,
 | 
					    error: errorProfiles,
 | 
				
			||||||
@@ -63,7 +166,6 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
    }`),
 | 
					    }`),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'equipment_ap' },
 | 
					      variables: { customerId, type: 'equipment_ap' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,7 +173,7 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
    loading: metricsLoading,
 | 
					    loading: metricsLoading,
 | 
				
			||||||
    error: metricsError,
 | 
					    error: metricsError,
 | 
				
			||||||
    data: metricsData,
 | 
					    data: metricsData,
 | 
				
			||||||
    fetchMore: fetchMoreServiceMetrics,
 | 
					    refetch: metricsRefetch,
 | 
				
			||||||
  } = useQuery(FILTER_SERVICE_METRICS, {
 | 
					  } = useQuery(FILTER_SERVICE_METRICS, {
 | 
				
			||||||
    variables: {
 | 
					    variables: {
 | 
				
			||||||
      customerId,
 | 
					      customerId,
 | 
				
			||||||
@@ -91,46 +193,23 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const refetchData = () => {
 | 
					  const refetchData = () => {
 | 
				
			||||||
    refetch();
 | 
					    refetch();
 | 
				
			||||||
    fetchMoreServiceMetrics({
 | 
					    metricsRefetch();
 | 
				
			||||||
      variables: {
 | 
					 | 
				
			||||||
        fromTime: moment()
 | 
					 | 
				
			||||||
          .subtract(2, 'minutes')
 | 
					 | 
				
			||||||
          .valueOf()
 | 
					 | 
				
			||||||
          .toString(),
 | 
					 | 
				
			||||||
        toTime: moment()
 | 
					 | 
				
			||||||
          .valueOf()
 | 
					 | 
				
			||||||
          .toString(),
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      updateQuery: (previousResult, { fetchMoreResult }) => {
 | 
					 | 
				
			||||||
        const previousEntry = previousResult.filterServiceMetrics;
 | 
					 | 
				
			||||||
        const newItems = fetchMoreResult.filterServiceMetrics.items;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return {
 | 
					 | 
				
			||||||
          filterServiceMetrics: {
 | 
					 | 
				
			||||||
            context: fetchMoreResult.filterServiceMetrics.context,
 | 
					 | 
				
			||||||
            items: [...previousEntry.items, ...newItems],
 | 
					 | 
				
			||||||
            __typename: previousEntry.__typename,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        };
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleUpdateEquipment = ({
 | 
					  const handleUpdateEquipment = (
 | 
				
			||||||
    id: equipmentId,
 | 
					    equipmentId,
 | 
				
			||||||
    equipmentType,
 | 
					    equipmentType,
 | 
				
			||||||
    inventoryId,
 | 
					    inventoryId,
 | 
				
			||||||
    customerId: custId,
 | 
					    custId,
 | 
				
			||||||
    profileId,
 | 
					    profileId,
 | 
				
			||||||
    locationId,
 | 
					    locationId,
 | 
				
			||||||
    name,
 | 
					    name,
 | 
				
			||||||
    baseMacAddress,
 | 
					 | 
				
			||||||
    latitude,
 | 
					    latitude,
 | 
				
			||||||
    longitude,
 | 
					    longitude,
 | 
				
			||||||
    serial,
 | 
					    serial,
 | 
				
			||||||
    lastModifiedTimestamp,
 | 
					    lastModifiedTimestamp,
 | 
				
			||||||
    formattedData,
 | 
					    details
 | 
				
			||||||
  }) => {
 | 
					  ) => {
 | 
				
			||||||
    updateEquipment({
 | 
					    updateEquipment({
 | 
				
			||||||
      variables: {
 | 
					      variables: {
 | 
				
			||||||
        id: equipmentId,
 | 
					        id: equipmentId,
 | 
				
			||||||
@@ -140,12 +219,11 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
        profileId,
 | 
					        profileId,
 | 
				
			||||||
        locationId,
 | 
					        locationId,
 | 
				
			||||||
        name,
 | 
					        name,
 | 
				
			||||||
        baseMacAddress,
 | 
					 | 
				
			||||||
        latitude,
 | 
					        latitude,
 | 
				
			||||||
        longitude,
 | 
					        longitude,
 | 
				
			||||||
        serial,
 | 
					        serial,
 | 
				
			||||||
        lastModifiedTimestamp,
 | 
					        lastModifiedTimestamp,
 | 
				
			||||||
        details: formattedData,
 | 
					        details,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
      .then(() => {
 | 
					      .then(() => {
 | 
				
			||||||
@@ -249,14 +327,28 @@ const AccessPointDetails = ({ locations }) => {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleFetchProfiles = e => {
 | 
					  const handleFetchProfiles = e => {
 | 
				
			||||||
    fetchMoreProfiles(e, dataProfiles, fetchMore);
 | 
					    if (dataProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMore({
 | 
				
			||||||
 | 
					        variables: { context: { ...dataProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (loading) {
 | 
					  if (loading) {
 | 
				
			||||||
    return <Loading />;
 | 
					    return <Loading />;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (error && !data?.getEquipment) {
 | 
					  if (error) {
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
      <Alert
 | 
					      <Alert
 | 
				
			||||||
        message="Error"
 | 
					        message="Error"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,8 +89,8 @@ const accessPointsTableColumns = [
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'CHANNEL',
 | 
					    title: 'CHANNEL',
 | 
				
			||||||
    dataIndex: ['status', 'channel', 'detailsJSON', 'channelNumberStatusDataMap'],
 | 
					    dataIndex: 'channel',
 | 
				
			||||||
    render: text => renderTableCell(Object.values(text ?? [])),
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'OCCUPANCY',
 | 
					    title: 'OCCUPANCY',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,8 +11,6 @@ import { UPDATE_EQUIPMENT_BULK } from 'graphql/mutations';
 | 
				
			|||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
import styles from './index.module.scss';
 | 
					import styles from './index.module.scss';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const defaultAppliedRadios = { is5GHzL: 'is5GHzL', is2dot4GHz: 'is2dot4GHz', is5GHzU: 'is5GHzU' };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const renderTableCell = tabCell => {
 | 
					const renderTableCell = tabCell => {
 | 
				
			||||||
  if (Array.isArray(tabCell)) {
 | 
					  if (Array.isArray(tabCell)) {
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
@@ -27,63 +25,47 @@ const renderTableCell = tabCell => {
 | 
				
			|||||||
  return <span>{tabCell}</span>;
 | 
					  return <span>{tabCell}</span>;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const accessPointsChannelTableColumns = [
 | 
					const accessPointsChannelTableColumns = [
 | 
				
			||||||
  { title: 'Name', dataIndex: 'name', key: 'name', width: 250, render: renderTableCell },
 | 
					  { title: 'NAME', dataIndex: 'name', key: 'name', render: renderTableCell },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'Manual Active Channel',
 | 
					    title: 'CHANNEL',
 | 
				
			||||||
    dataIndex: 'manualChannelNumber',
 | 
					    dataIndex: 'channel',
 | 
				
			||||||
    key: 'manualChannelNumber',
 | 
					    key: 'channel',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 200,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    title: 'Manual Backup Channel',
 | 
					 | 
				
			||||||
    dataIndex: 'manualBackupChannelNumber',
 | 
					 | 
				
			||||||
    key: 'manualBackupChannelNumber',
 | 
					 | 
				
			||||||
    editable: true,
 | 
					 | 
				
			||||||
    width: 210,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'Cell Size',
 | 
					    title: 'CELL SIZE',
 | 
				
			||||||
    dataIndex: 'cellSize',
 | 
					    dataIndex: 'cellSize',
 | 
				
			||||||
    key: 'cellSize',
 | 
					    key: 'cellSize',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 150,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'Probe Response Threshold',
 | 
					    title: 'PROB RESPONSE THRESHOLD',
 | 
				
			||||||
    dataIndex: 'probeResponseThreshold',
 | 
					    dataIndex: 'probeResponseThreshold',
 | 
				
			||||||
    key: 'probeResponseThreshold',
 | 
					    key: 'probeResponseThreshold',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 210,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'Client Disconnect Threshold',
 | 
					    title: 'CLIENT DISCONNECT THRESHOLD',
 | 
				
			||||||
    dataIndex: 'clientDisconnectThreshold',
 | 
					    dataIndex: 'clientDisconnectThreshold',
 | 
				
			||||||
    key: 'clientDisconnectThreshold',
 | 
					    key: 'clientDisconnectThreshold',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 210,
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'SNR (% Drop)',
 | 
					    title: 'SNR (% DROP)',
 | 
				
			||||||
    dataIndex: 'snrDrop',
 | 
					    dataIndex: 'snrDrop',
 | 
				
			||||||
    key: 'snrDrop',
 | 
					    key: 'snrDrop',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 150,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    title: 'Min Load',
 | 
					    title: 'MIN LOAD',
 | 
				
			||||||
    dataIndex: 'minLoad',
 | 
					    dataIndex: 'minLoad',
 | 
				
			||||||
    key: 'minLoad',
 | 
					    key: 'minLoad',
 | 
				
			||||||
    editable: true,
 | 
					    editable: true,
 | 
				
			||||||
    width: 150,
 | 
					 | 
				
			||||||
    render: renderTableCell,
 | 
					    render: renderTableCell,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
@@ -178,84 +160,68 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
 | 
				
			|||||||
  const [updateEquipmentBulk] = useMutation(UPDATE_EQUIPMENT_BULK);
 | 
					  const [updateEquipmentBulk] = useMutation(UPDATE_EQUIPMENT_BULK);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const getRadioDetails = (radioDetails, type) => {
 | 
					  const getRadioDetails = (radioDetails, type) => {
 | 
				
			||||||
    if (type === 'manualChannelNumber') {
 | 
					 | 
				
			||||||
      const manualChannelNumbers = [];
 | 
					 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					 | 
				
			||||||
        return manualChannelNumbers.push(radioDetails.radioMap[i]?.manualChannelNumber);
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      return manualChannelNumbers;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (type === 'manualBackupChannelNumber') {
 | 
					 | 
				
			||||||
      const manualBackupChannelNumbers = [];
 | 
					 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					 | 
				
			||||||
        return manualBackupChannelNumbers.push(radioDetails.radioMap[i]?.manualBackupChannelNumber);
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      return manualBackupChannelNumbers;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (type === 'cellSize') {
 | 
					    if (type === 'cellSize') {
 | 
				
			||||||
      const cellSizeValues = [];
 | 
					      const cellSizeValues = [];
 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					      Object.keys(radioDetails.radioMap).map(i => {
 | 
				
			||||||
        return cellSizeValues.push(radioDetails.radioMap[i]?.rxCellSizeDb?.value);
 | 
					        return cellSizeValues.push(radioDetails.radioMap[i].rxCellSizeDb.value);
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      return cellSizeValues;
 | 
					      return cellSizeValues;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (type === 'probeResponseThreshold') {
 | 
					    if (type === 'probeResponseThreshold') {
 | 
				
			||||||
      const probeResponseThresholdValues = [];
 | 
					      const probeResponseThresholdValues = [];
 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					      Object.keys(radioDetails.radioMap).map(i => {
 | 
				
			||||||
        return probeResponseThresholdValues.push(
 | 
					        return probeResponseThresholdValues.push(
 | 
				
			||||||
          radioDetails.radioMap[i]?.probeResponseThresholdDb?.value
 | 
					          radioDetails.radioMap[i].probeResponseThresholdDb.value
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      return probeResponseThresholdValues;
 | 
					      return probeResponseThresholdValues;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (type === 'clientDisconnectThreshold') {
 | 
					    if (type === 'clientDisconnectThreshold') {
 | 
				
			||||||
      const clientDisconnectThresholdValues = [];
 | 
					      const clientDisconnectThresholdValues = [];
 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					      Object.keys(radioDetails.radioMap).map(i => {
 | 
				
			||||||
        return clientDisconnectThresholdValues.push(
 | 
					        return clientDisconnectThresholdValues.push(
 | 
				
			||||||
          radioDetails.radioMap[i]?.clientDisconnectThresholdDb?.value
 | 
					          radioDetails.radioMap[i].clientDisconnectThresholdDb.value
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      return clientDisconnectThresholdValues;
 | 
					      return clientDisconnectThresholdValues;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (type === 'snrDrop') {
 | 
					    if (type === 'snrDrop') {
 | 
				
			||||||
      const snrDropValues = [];
 | 
					      const snrDropValues = [];
 | 
				
			||||||
      Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					      Object.keys(radioDetails.advancedRadioMap).map(i => {
 | 
				
			||||||
        return snrDropValues.push(
 | 
					        return snrDropValues.push(
 | 
				
			||||||
          radioDetails.advancedRadioMap[i]?.bestApSettings?.value?.dropInSnrPercentage
 | 
					          radioDetails.advancedRadioMap[i].bestApSettings.dropInSnrPercentage
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      return snrDropValues;
 | 
					      return snrDropValues;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const minLoadValue = [];
 | 
					    const minLoadValue = [];
 | 
				
			||||||
    Object.keys(radioDetails?.radioMap || {}).map(i => {
 | 
					    Object.keys(radioDetails.advancedRadioMap).map(i => {
 | 
				
			||||||
      return minLoadValue.push(
 | 
					      return minLoadValue.push(radioDetails.advancedRadioMap[i].bestApSettings.minLoadFactor);
 | 
				
			||||||
        radioDetails.advancedRadioMap[i]?.bestApSettings?.value?.minLoadFactor
 | 
					 | 
				
			||||||
      );
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    return minLoadValue;
 | 
					    return minLoadValue;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const setAccessPointsBulkEditTableData = (dataSource = []) =>
 | 
					  const setAccessPointsBulkEditTableData = (dataSource = []) => {
 | 
				
			||||||
    dataSource.items.map(({ id: key, name, details }) => ({
 | 
					    const tableData = dataSource.items.map(({ id: key, name, channel, details }) => {
 | 
				
			||||||
      key,
 | 
					      return {
 | 
				
			||||||
      id: key,
 | 
					        key,
 | 
				
			||||||
      name,
 | 
					        id: key,
 | 
				
			||||||
      manualChannelNumber: getRadioDetails(details, 'manualChannelNumber'),
 | 
					        name,
 | 
				
			||||||
      manualBackupChannelNumber: getRadioDetails(details, 'manualBackupChannelNumber'),
 | 
					        channel,
 | 
				
			||||||
      cellSize: getRadioDetails(details, 'cellSize'),
 | 
					        cellSize: getRadioDetails(details, 'cellSize'),
 | 
				
			||||||
      probeResponseThreshold: getRadioDetails(details, 'probeResponseThreshold'),
 | 
					        probeResponseThreshold: getRadioDetails(details, 'probeResponseThreshold'),
 | 
				
			||||||
      clientDisconnectThreshold: getRadioDetails(details, 'clientDisconnectThreshold'),
 | 
					        clientDisconnectThreshold: getRadioDetails(details, 'clientDisconnectThreshold'),
 | 
				
			||||||
      snrDrop: getRadioDetails(details, 'snrDrop'),
 | 
					        snrDrop: getRadioDetails(details, 'snrDrop'),
 | 
				
			||||||
      minLoad: getRadioDetails(details, 'minLoad'),
 | 
					        minLoad: getRadioDetails(details, 'minLoad'),
 | 
				
			||||||
      radioMap: Object.keys(details?.radioMap || {}),
 | 
					      };
 | 
				
			||||||
    }));
 | 
					    });
 | 
				
			||||||
 | 
					    return tableData;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const setUpdatedBulkEditTableData = (
 | 
					  const setUpdatedBulkEditTableData = (
 | 
				
			||||||
    equipmentId,
 | 
					    equipmentId,
 | 
				
			||||||
    manualChannelNumber,
 | 
					    channel,
 | 
				
			||||||
    manualBackupChannelNumber,
 | 
					 | 
				
			||||||
    cellSize,
 | 
					    cellSize,
 | 
				
			||||||
    probeResponseThreshold,
 | 
					    probeResponseThreshold,
 | 
				
			||||||
    clientDisconnectThreshold,
 | 
					    clientDisconnectThreshold,
 | 
				
			||||||
@@ -268,14 +234,13 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
 | 
				
			|||||||
    let minLoadFactor;
 | 
					    let minLoadFactor;
 | 
				
			||||||
    dataSource.items.forEach(({ id: itemId, details }) => {
 | 
					    dataSource.items.forEach(({ id: itemId, details }) => {
 | 
				
			||||||
      if (equipmentId === itemId) {
 | 
					      if (equipmentId === itemId) {
 | 
				
			||||||
        Object.keys(details?.radioMap || defaultAppliedRadios).forEach((i, dataIndex) => {
 | 
					        Object.keys(details.radioMap).forEach((i, dataIndex) => {
 | 
				
			||||||
          const frequencies = {};
 | 
					          const frequencies = {};
 | 
				
			||||||
          dropInSnrPercentage = snrDrop[dataIndex];
 | 
					          dropInSnrPercentage = snrDrop[dataIndex];
 | 
				
			||||||
          minLoadFactor = minLoad[dataIndex];
 | 
					          minLoadFactor = minLoad[dataIndex];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          frequencies[`${i}`] = {
 | 
					          frequencies[`${i}`] = {
 | 
				
			||||||
            channelNumber: manualChannelNumber[dataIndex],
 | 
					            channelNumber: channel[dataIndex],
 | 
				
			||||||
            backupChannelNumber: manualBackupChannelNumber[dataIndex],
 | 
					 | 
				
			||||||
            rxCellSizeDb: {
 | 
					            rxCellSizeDb: {
 | 
				
			||||||
              auto: true,
 | 
					              auto: true,
 | 
				
			||||||
              value: cellSize[dataIndex],
 | 
					              value: cellSize[dataIndex],
 | 
				
			||||||
@@ -321,41 +286,42 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const handleSaveChanges = updatedRows => {
 | 
					  const handleSaveChanges = updatedRows => {
 | 
				
			||||||
    const editedRowsArr = [];
 | 
					    const editedRowsArr = [];
 | 
				
			||||||
    Object.keys(updatedRows).forEach(key => {
 | 
					    if (updatedRows.length > 0) {
 | 
				
			||||||
      const {
 | 
					      updatedRows.map(
 | 
				
			||||||
        id: equipmentId,
 | 
					        ({
 | 
				
			||||||
        manualChannelNumber,
 | 
					          id: equipmentId,
 | 
				
			||||||
        manualBackupChannelNumber,
 | 
					          channel,
 | 
				
			||||||
        cellSize,
 | 
					          cellSize,
 | 
				
			||||||
        probeResponseThreshold,
 | 
					          probeResponseThreshold,
 | 
				
			||||||
        clientDisconnectThreshold,
 | 
					          clientDisconnectThreshold,
 | 
				
			||||||
        snrDrop,
 | 
					          snrDrop,
 | 
				
			||||||
        minLoad,
 | 
					          minLoad,
 | 
				
			||||||
      } = updatedRows[key];
 | 
					        }) => {
 | 
				
			||||||
      const updatedEuips = setUpdatedBulkEditTableData(
 | 
					          const updatedEuips = setUpdatedBulkEditTableData(
 | 
				
			||||||
        equipmentId,
 | 
					            equipmentId,
 | 
				
			||||||
        manualChannelNumber,
 | 
					            channel,
 | 
				
			||||||
        manualBackupChannelNumber,
 | 
					            cellSize,
 | 
				
			||||||
        cellSize,
 | 
					            probeResponseThreshold,
 | 
				
			||||||
        probeResponseThreshold,
 | 
					            clientDisconnectThreshold,
 | 
				
			||||||
        clientDisconnectThreshold,
 | 
					            snrDrop,
 | 
				
			||||||
        snrDrop,
 | 
					            minLoad,
 | 
				
			||||||
        minLoad,
 | 
					            equipData && equipData.filterEquipment
 | 
				
			||||||
        equipData && equipData.filterEquipment
 | 
					          );
 | 
				
			||||||
 | 
					          const tempObj = {
 | 
				
			||||||
 | 
					            equipmentId,
 | 
				
			||||||
 | 
					            perRadioDetails: {},
 | 
				
			||||||
 | 
					          };
 | 
				
			||||||
 | 
					          updatedEuips.map(item => {
 | 
				
			||||||
 | 
					            Object.keys(item).forEach(i => {
 | 
				
			||||||
 | 
					              tempObj.perRadioDetails[i] = item[i];
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            return tempObj;
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					          return editedRowsArr.push(tempObj);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
      const tempObj = {
 | 
					      updateEquipments(editedRowsArr);
 | 
				
			||||||
        equipmentId,
 | 
					    }
 | 
				
			||||||
        perRadioDetails: {},
 | 
					 | 
				
			||||||
      };
 | 
					 | 
				
			||||||
      updatedEuips.map(item => {
 | 
					 | 
				
			||||||
        Object.keys(item).forEach(i => {
 | 
					 | 
				
			||||||
          tempObj.perRadioDetails[i] = item[i];
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        return tempObj;
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      return editedRowsArr.push(tempObj);
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
    updateEquipments(editedRowsArr);
 | 
					 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleLoadMore = () => {
 | 
					  const handleLoadMore = () => {
 | 
				
			||||||
@@ -390,9 +356,18 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
 | 
				
			|||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <BulkEditAccessPoints
 | 
					    <BulkEditAccessPoints
 | 
				
			||||||
      tableColumns={accessPointsChannelTableColumns}
 | 
					      tableColumns={accessPointsChannelTableColumns}
 | 
				
			||||||
      tableData={setAccessPointsBulkEditTableData(equipData?.filterEquipment)}
 | 
					      tableData={
 | 
				
			||||||
 | 
					        equipData &&
 | 
				
			||||||
 | 
					        equipData.filterEquipment &&
 | 
				
			||||||
 | 
					        setAccessPointsBulkEditTableData(equipData && equipData.filterEquipment)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      onLoadMore={handleLoadMore}
 | 
					      onLoadMore={handleLoadMore}
 | 
				
			||||||
      isLastPage={equipData?.filterEquipment?.context?.lastPage}
 | 
					      isLastPage={
 | 
				
			||||||
 | 
					        equipData &&
 | 
				
			||||||
 | 
					        equipData.filterEquipment &&
 | 
				
			||||||
 | 
					        equipData.filterEquipment.context &&
 | 
				
			||||||
 | 
					        equipData.filterEquipment.context.lastPage
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      onSaveChanges={handleSaveChanges}
 | 
					      onSaveChanges={handleSaveChanges}
 | 
				
			||||||
      breadcrumbPath={getBreadcrumbPath(id, locations)}
 | 
					      breadcrumbPath={getBreadcrumbPath(id, locations)}
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
.tabColumn {
 | 
					.tabColumn {
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
  flex-direction: column;
 | 
					  flex-direction: column;
 | 
				
			||||||
 | 
					  padding: 0 30px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,11 +4,11 @@ import { useQuery, useMutation, gql } from '@apollo/client';
 | 
				
			|||||||
import { Alert, notification } from 'antd';
 | 
					import { Alert, notification } from 'antd';
 | 
				
			||||||
import { ProfileDetails as ProfileDetailsPage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
 | 
					import { ProfileDetails as ProfileDetailsPage, Loading } from '@tip-wlan/wlan-cloud-ui-library';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { ROUTES, AUTH_TOKEN } from 'constants/index';
 | 
					import { ROUTES } from 'constants/index';
 | 
				
			||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
import { GET_ALL_PROFILES, GET_API_URL } from 'graphql/queries';
 | 
					import { GET_ALL_PROFILES } from 'graphql/queries';
 | 
				
			||||||
import { fetchMoreProfiles } from 'graphql/functions';
 | 
					import { FILE_UPLOAD } from 'graphql/mutations';
 | 
				
			||||||
import { getItem } from 'utils/localStorage';
 | 
					import { updateQueryGetAllProfiles } from 'graphql/functions';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const GET_PROFILE = gql`
 | 
					const GET_PROFILE = gql`
 | 
				
			||||||
  query GetProfile($id: ID!) {
 | 
					  query GetProfile($id: ID!) {
 | 
				
			||||||
@@ -23,16 +23,6 @@ const GET_PROFILE = gql`
 | 
				
			|||||||
        profileType
 | 
					        profileType
 | 
				
			||||||
        details
 | 
					        details
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      associatedSsidProfiles {
 | 
					 | 
				
			||||||
        id
 | 
					 | 
				
			||||||
        name
 | 
					 | 
				
			||||||
        profileType
 | 
					 | 
				
			||||||
        details
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      osuSsidProfile {
 | 
					 | 
				
			||||||
        id
 | 
					 | 
				
			||||||
        name
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      childProfileIds
 | 
					      childProfileIds
 | 
				
			||||||
      createdTimestamp
 | 
					      createdTimestamp
 | 
				
			||||||
      lastModifiedTimestamp
 | 
					      lastModifiedTimestamp
 | 
				
			||||||
@@ -85,8 +75,6 @@ const ProfileDetails = () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const [redirect, setRedirect] = useState(false);
 | 
					  const [redirect, setRedirect] = useState(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: apiUrl } = useQuery(GET_API_URL);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  const { loading, error, data } = useQuery(GET_PROFILE, {
 | 
					  const { loading, error, data } = useQuery(GET_PROFILE, {
 | 
				
			||||||
    variables: { id },
 | 
					    variables: { id },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					    fetchPolicy: 'network-only',
 | 
				
			||||||
@@ -94,14 +82,12 @@ const ProfileDetails = () => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'ssid' },
 | 
					    variables: { customerId, type: 'ssid' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: radiusProfiles, fetchMore: fetchMoreRadiusProfiles } = useQuery(
 | 
					  const { data: radiusProfiles, fetchMore: fetchMoreRadiusProfiles } = useQuery(
 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'radius' },
 | 
					      variables: { customerId, type: 'radius' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -109,20 +95,17 @@ const ProfileDetails = () => {
 | 
				
			|||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'captive_portal' },
 | 
					      variables: { customerId, type: 'captive_portal' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: venueProfiles, fetchMore: fetchMoreVenueProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: venueProfiles, fetchMore: fetchMoreVenueProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'passpoint_venue' },
 | 
					    variables: { customerId, type: 'passpoint_venue' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
 | 
					  const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'passpoint_operator' },
 | 
					      variables: { customerId, type: 'passpoint_operator' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -130,18 +113,18 @@ const ProfileDetails = () => {
 | 
				
			|||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'passpoint_osu_id_provider' },
 | 
					      variables: { customerId, type: 'passpoint_osu_id_provider' },
 | 
				
			||||||
      fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
					  const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
 | 
				
			||||||
    variables: { customerId, type: 'rf' },
 | 
					    variables: { customerId, type: 'rf' },
 | 
				
			||||||
    fetchPolicy: 'network-only',
 | 
					 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const [updateProfile] = useMutation(UPDATE_PROFILE);
 | 
					  const [updateProfile] = useMutation(UPDATE_PROFILE);
 | 
				
			||||||
  const [deleteProfile] = useMutation(DELETE_PROFILE);
 | 
					  const [deleteProfile] = useMutation(DELETE_PROFILE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const [fileUpload] = useMutation(FILE_UPLOAD);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleDeleteProfile = () => {
 | 
					  const handleDeleteProfile = () => {
 | 
				
			||||||
    deleteProfile({ variables: { id } })
 | 
					    deleteProfile({ variables: { id } })
 | 
				
			||||||
      .then(() => {
 | 
					      .then(() => {
 | 
				
			||||||
@@ -187,89 +170,145 @@ const ProfileDetails = () => {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleFileUpload = async (fileName, file) => {
 | 
					  const handleFileUpload = (fileName, file) =>
 | 
				
			||||||
    const token = getItem(AUTH_TOKEN);
 | 
					    fileUpload({ variables: { fileName, file } })
 | 
				
			||||||
 | 
					      .then(() => {
 | 
				
			||||||
    if (apiUrl?.getApiUrl) {
 | 
					        notification.success({
 | 
				
			||||||
      fetch(`${apiUrl?.getApiUrl}filestore/${fileName}`, {
 | 
					          message: 'Success',
 | 
				
			||||||
        method: 'POST',
 | 
					          description: 'File successfully uploaded.',
 | 
				
			||||||
        headers: {
 | 
					 | 
				
			||||||
          Authorization: token ? `Bearer ${token.access_token}` : '',
 | 
					 | 
				
			||||||
          'Content-Type': 'application/octet-stream',
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        body: file,
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
        .then(response => response.json())
 | 
					 | 
				
			||||||
        .then(resp => {
 | 
					 | 
				
			||||||
          if (resp?.success) {
 | 
					 | 
				
			||||||
            notification.success({
 | 
					 | 
				
			||||||
              message: 'Success',
 | 
					 | 
				
			||||||
              description: 'File successfully uploaded.',
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          } else {
 | 
					 | 
				
			||||||
            notification.error({
 | 
					 | 
				
			||||||
              message: 'Error',
 | 
					 | 
				
			||||||
              description: 'File could not be uploaded.',
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .catch(() => {
 | 
					 | 
				
			||||||
          notification.error({
 | 
					 | 
				
			||||||
            message: 'Error',
 | 
					 | 
				
			||||||
            description: 'File could not be uploaded.',
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    } else {
 | 
					      })
 | 
				
			||||||
      notification.error({
 | 
					      .catch(() =>
 | 
				
			||||||
        message: 'Error',
 | 
					        notification.error({
 | 
				
			||||||
        description: 'File could not be uploaded.',
 | 
					          message: 'Error',
 | 
				
			||||||
 | 
					          description: 'File could not be uploaded.',
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchProfiles = e => {
 | 
				
			||||||
 | 
					    if (ssidProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMore({
 | 
				
			||||||
 | 
					        variables: { context: { ...ssidProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleDownloadFile = async name => {
 | 
					  const handleFetchRadiusProfiles = e => {
 | 
				
			||||||
    const token = getItem(AUTH_TOKEN);
 | 
					    if (radiusProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
    if (apiUrl?.getApiUrl) {
 | 
					      return false;
 | 
				
			||||||
      return fetch(`${apiUrl?.getApiUrl}filestore/${encodeURIComponent(name)}`, {
 | 
					 | 
				
			||||||
        method: 'GET',
 | 
					 | 
				
			||||||
        headers: {
 | 
					 | 
				
			||||||
          'Content-Type': 'application/octet-stream',
 | 
					 | 
				
			||||||
          Authorization: token ? `Bearer ${token.access_token}` : '',
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
        .then(response => response.blob())
 | 
					 | 
				
			||||||
        .then(blob => {
 | 
					 | 
				
			||||||
          return new Promise((resolve, reject) => {
 | 
					 | 
				
			||||||
            const reader = new FileReader();
 | 
					 | 
				
			||||||
            reader.onloadend = () => resolve(reader.result);
 | 
					 | 
				
			||||||
            reader.onerror = reject;
 | 
					 | 
				
			||||||
            reader.readAsDataURL(blob);
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        .catch(() => {
 | 
					 | 
				
			||||||
          notification.error({
 | 
					 | 
				
			||||||
            message: 'Error',
 | 
					 | 
				
			||||||
            description: 'File could not be retrieved.',
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return notification.error({
 | 
					
 | 
				
			||||||
      message: 'Error',
 | 
					    e.persist();
 | 
				
			||||||
      description: 'File could not be retrieved.',
 | 
					    const { target } = e;
 | 
				
			||||||
    });
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreRadiusProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...radiusProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleFetchMoreProfiles = (e, key) => {
 | 
					  const handleFetchCaptiveProfiles = e => {
 | 
				
			||||||
    if (key === 'radius') fetchMoreProfiles(e, radiusProfiles, fetchMoreRadiusProfiles);
 | 
					    if (captiveProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
    else if (key === 'captive_portal')
 | 
					      return false;
 | 
				
			||||||
      fetchMoreProfiles(e, captiveProfiles, fetchMoreCaptiveProfiles);
 | 
					    }
 | 
				
			||||||
    else if (key === 'rf') fetchMoreProfiles(e, rfProfiles, fetchMoreRfProfiles);
 | 
					
 | 
				
			||||||
    else if (key === 'passpoint_venue') fetchMoreProfiles(e, venueProfiles, fetchMoreVenueProfiles);
 | 
					    e.persist();
 | 
				
			||||||
    else if (key === 'passpoint_operator')
 | 
					    const { target } = e;
 | 
				
			||||||
      fetchMoreProfiles(e, operatorProfiles, fetchMoreOperatorProfiles);
 | 
					
 | 
				
			||||||
    else if (key === 'passpoint_osu_id_provider')
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
      fetchMoreProfiles(e, idProviderProfiles, fetchMoreIdProviderProfiles);
 | 
					      fetchMoreCaptiveProfiles({
 | 
				
			||||||
    else fetchMoreProfiles(e, ssidProfiles, fetchMore);
 | 
					        variables: { context: { ...captiveProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchVenueProfiles = e => {
 | 
				
			||||||
 | 
					    if (venueProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreVenueProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...venueProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchRfProfiles = e => {
 | 
				
			||||||
 | 
					    if (rfProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreRfProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...rfProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchOperatorProfiles = e => {
 | 
				
			||||||
 | 
					    if (operatorProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreOperatorProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...operatorProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const handleFetchIdProviderProfiles = e => {
 | 
				
			||||||
 | 
					    if (idProviderProfiles.getAllProfiles.context.lastPage) {
 | 
				
			||||||
 | 
					      return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    e.persist();
 | 
				
			||||||
 | 
					    const { target } = e;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
 | 
				
			||||||
 | 
					      fetchMoreIdProviderProfiles({
 | 
				
			||||||
 | 
					        variables: { context: { ...idProviderProfiles.getAllProfiles.context } },
 | 
				
			||||||
 | 
					        updateQuery: updateQueryGetAllProfiles,
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (loading) {
 | 
					  if (loading) {
 | 
				
			||||||
@@ -302,11 +341,14 @@ const ProfileDetails = () => {
 | 
				
			|||||||
      venueProfiles={venueProfiles?.getAllProfiles?.items}
 | 
					      venueProfiles={venueProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      operatorProfiles={operatorProfiles?.getAllProfiles?.items}
 | 
					      operatorProfiles={operatorProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
 | 
					      idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
 | 
				
			||||||
      associatedSsidProfiles={data.getProfile?.associatedSsidProfiles}
 | 
					 | 
				
			||||||
      osuSsidProfile={data.getProfile?.osuSsidProfile}
 | 
					 | 
				
			||||||
      fileUpload={handleFileUpload}
 | 
					      fileUpload={handleFileUpload}
 | 
				
			||||||
      onFetchMoreProfiles={handleFetchMoreProfiles}
 | 
					      onFetchMoreProfiles={handleFetchProfiles}
 | 
				
			||||||
      onDownloadFile={handleDownloadFile}
 | 
					      onFetchMoreRfProfiles={handleFetchRfProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreRadiusProfiles={handleFetchRadiusProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreCaptiveProfiles={handleFetchCaptiveProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreVenueProfiles={handleFetchVenueProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreOperatorProfiles={handleFetchOperatorProfiles}
 | 
				
			||||||
 | 
					      onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles}
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,6 @@ import { AutoProvision as AutoProvisionPage, Loading } from '@tip-wlan/wlan-clou
 | 
				
			|||||||
import UserContext from 'contexts/UserContext';
 | 
					import UserContext from 'contexts/UserContext';
 | 
				
			||||||
import { GET_CUSTOMER, GET_ALL_LOCATIONS, GET_ALL_PROFILES } from 'graphql/queries';
 | 
					import { GET_CUSTOMER, GET_ALL_LOCATIONS, GET_ALL_PROFILES } from 'graphql/queries';
 | 
				
			||||||
import { UPDATE_CUSTOMER } from 'graphql/mutations';
 | 
					import { UPDATE_CUSTOMER } from 'graphql/mutations';
 | 
				
			||||||
import { fetchMoreProfiles } from 'graphql/functions';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const AutoProvision = () => {
 | 
					const AutoProvision = () => {
 | 
				
			||||||
  const { customerId } = useContext(UserContext);
 | 
					  const { customerId } = useContext(UserContext);
 | 
				
			||||||
@@ -15,13 +14,13 @@ const AutoProvision = () => {
 | 
				
			|||||||
  });
 | 
					  });
 | 
				
			||||||
  const [updateCustomer] = useMutation(UPDATE_CUSTOMER);
 | 
					  const [updateCustomer] = useMutation(UPDATE_CUSTOMER);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const { data: dataLocation, loading: loadingLocation, error: errorLocation } = useQuery(
 | 
					  const { data: dataLocation, loading: loadingLoaction, error: errorLocation } = useQuery(
 | 
				
			||||||
    GET_ALL_LOCATIONS,
 | 
					    GET_ALL_LOCATIONS,
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId },
 | 
					      variables: { customerId },
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
  const { data: dataProfile, loading: loadingProfile, error: errorProfile, fetchMore } = useQuery(
 | 
					  const { data: dataProfile, loading: loadingProfile, error: errorProfile } = useQuery(
 | 
				
			||||||
    GET_ALL_PROFILES(),
 | 
					    GET_ALL_PROFILES(),
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      variables: { customerId, type: 'equipment_ap', limit: 100 },
 | 
					      variables: { customerId, type: 'equipment_ap', limit: 100 },
 | 
				
			||||||
@@ -61,10 +60,6 @@ const AutoProvision = () => {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const handleFetchMoreProfiles = e => {
 | 
					 | 
				
			||||||
    fetchMoreProfiles(e, dataProfile, fetchMore);
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (loading) {
 | 
					  if (loading) {
 | 
				
			||||||
    return <Loading />;
 | 
					    return <Loading />;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -80,12 +75,11 @@ const AutoProvision = () => {
 | 
				
			|||||||
      data={data && data.getCustomer}
 | 
					      data={data && data.getCustomer}
 | 
				
			||||||
      dataLocation={dataLocation && dataLocation.getAllLocations}
 | 
					      dataLocation={dataLocation && dataLocation.getAllLocations}
 | 
				
			||||||
      dataProfile={dataProfile && dataProfile.getAllProfiles.items}
 | 
					      dataProfile={dataProfile && dataProfile.getAllProfiles.items}
 | 
				
			||||||
      loadingLocation={loadingLocation}
 | 
					      loadingLoaction={loadingLoaction}
 | 
				
			||||||
      loadingProfile={loadingProfile}
 | 
					      loadingProfile={loadingProfile}
 | 
				
			||||||
      errorLocation={errorLocation}
 | 
					      errorLocation={errorLocation}
 | 
				
			||||||
      errorProfile={errorProfile}
 | 
					      errorProfile={errorProfile}
 | 
				
			||||||
      onUpdateCustomer={handleUpdateCustomer}
 | 
					      onUpdateCustomer={handleUpdateCustomer}
 | 
				
			||||||
      onFetchMoreProfiles={handleFetchMoreProfiles}
 | 
					 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,21 +10,3 @@ export const updateQueryGetAllProfiles = (previousResult, { fetchMoreResult }) =
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					 | 
				
			||||||
export const fetchMoreProfiles = (e, profile, fetchMore) => {
 | 
					 | 
				
			||||||
  if (profile.getAllProfiles.context.lastPage) {
 | 
					 | 
				
			||||||
    return false;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  e.persist();
 | 
					 | 
				
			||||||
  const { target } = e;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (target.scrollTop + target.offsetHeight + 10 >= target.scrollHeight) {
 | 
					 | 
				
			||||||
    fetchMore({
 | 
					 | 
				
			||||||
      variables: { context: { ...profile.getAllProfiles.context } },
 | 
					 | 
				
			||||||
      updateQuery: updateQueryGetAllProfiles,
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return true;
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -255,62 +255,6 @@ export const CREATE_EQUIPMENT = gql`
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
`;
 | 
					`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const UPDATE_EQUIPMENT = gql`
 | 
					 | 
				
			||||||
  mutation UpdateEquipment(
 | 
					 | 
				
			||||||
    $id: ID!
 | 
					 | 
				
			||||||
    $equipmentType: String!
 | 
					 | 
				
			||||||
    $inventoryId: String!
 | 
					 | 
				
			||||||
    $customerId: ID!
 | 
					 | 
				
			||||||
    $profileId: ID!
 | 
					 | 
				
			||||||
    $locationId: ID!
 | 
					 | 
				
			||||||
    $name: String!
 | 
					 | 
				
			||||||
    $baseMacAddress: String
 | 
					 | 
				
			||||||
    $latitude: String
 | 
					 | 
				
			||||||
    $longitude: String
 | 
					 | 
				
			||||||
    $serial: String
 | 
					 | 
				
			||||||
    $lastModifiedTimestamp: String
 | 
					 | 
				
			||||||
    $details: JSONObject
 | 
					 | 
				
			||||||
  ) {
 | 
					 | 
				
			||||||
    updateEquipment(
 | 
					 | 
				
			||||||
      id: $id
 | 
					 | 
				
			||||||
      equipmentType: $equipmentType
 | 
					 | 
				
			||||||
      inventoryId: $inventoryId
 | 
					 | 
				
			||||||
      customerId: $customerId
 | 
					 | 
				
			||||||
      profileId: $profileId
 | 
					 | 
				
			||||||
      locationId: $locationId
 | 
					 | 
				
			||||||
      name: $name
 | 
					 | 
				
			||||||
      baseMacAddress: $baseMacAddress
 | 
					 | 
				
			||||||
      latitude: $latitude
 | 
					 | 
				
			||||||
      longitude: $longitude
 | 
					 | 
				
			||||||
      serial: $serial
 | 
					 | 
				
			||||||
      lastModifiedTimestamp: $lastModifiedTimestamp
 | 
					 | 
				
			||||||
      details: $details
 | 
					 | 
				
			||||||
    ) {
 | 
					 | 
				
			||||||
      id
 | 
					 | 
				
			||||||
      equipmentType
 | 
					 | 
				
			||||||
      inventoryId
 | 
					 | 
				
			||||||
      customerId
 | 
					 | 
				
			||||||
      profileId
 | 
					 | 
				
			||||||
      locationId
 | 
					 | 
				
			||||||
      name
 | 
					 | 
				
			||||||
      baseMacAddress
 | 
					 | 
				
			||||||
      latitude
 | 
					 | 
				
			||||||
      longitude
 | 
					 | 
				
			||||||
      serial
 | 
					 | 
				
			||||||
      lastModifiedTimestamp
 | 
					 | 
				
			||||||
      details
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
`;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export const DELETE_EQUIPMENT = gql`
 | 
					 | 
				
			||||||
  mutation DeleteEquipment($id: ID!) {
 | 
					 | 
				
			||||||
    deleteEquipment(id: $id) {
 | 
					 | 
				
			||||||
      id
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
`;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export const UPDATE_CUSTOMER = gql`
 | 
					export const UPDATE_CUSTOMER = gql`
 | 
				
			||||||
  mutation UpdateCustomer(
 | 
					  mutation UpdateCustomer(
 | 
				
			||||||
    $id: ID!
 | 
					    $id: ID!
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,9 +70,6 @@ export const FILTER_EQUIPMENT = gql`
 | 
				
			|||||||
          firmware {
 | 
					          firmware {
 | 
				
			||||||
            detailsJSON
 | 
					            detailsJSON
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          channel {
 | 
					 | 
				
			||||||
            detailsJSON
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      context
 | 
					      context
 | 
				
			||||||
@@ -80,67 +77,6 @@ export const FILTER_EQUIPMENT = gql`
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
`;
 | 
					`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const GET_EQUIPMENT = gql`
 | 
					 | 
				
			||||||
  query GetEquipment($id: ID!) {
 | 
					 | 
				
			||||||
    getEquipment(id: $id) {
 | 
					 | 
				
			||||||
      id
 | 
					 | 
				
			||||||
      equipmentType
 | 
					 | 
				
			||||||
      inventoryId
 | 
					 | 
				
			||||||
      customerId
 | 
					 | 
				
			||||||
      profileId
 | 
					 | 
				
			||||||
      locationId
 | 
					 | 
				
			||||||
      name
 | 
					 | 
				
			||||||
      latitude
 | 
					 | 
				
			||||||
      longitude
 | 
					 | 
				
			||||||
      serial
 | 
					 | 
				
			||||||
      lastModifiedTimestamp
 | 
					 | 
				
			||||||
      details
 | 
					 | 
				
			||||||
      profile {
 | 
					 | 
				
			||||||
        id
 | 
					 | 
				
			||||||
        name
 | 
					 | 
				
			||||||
        childProfiles {
 | 
					 | 
				
			||||||
          id
 | 
					 | 
				
			||||||
          name
 | 
					 | 
				
			||||||
          details
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      baseMacAddress
 | 
					 | 
				
			||||||
      manufacturer
 | 
					 | 
				
			||||||
      status {
 | 
					 | 
				
			||||||
        firmware {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        protocol {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        radioUtilization {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        clientDetails {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
          details {
 | 
					 | 
				
			||||||
            numClientsPerRadio
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        osPerformance {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        channel {
 | 
					 | 
				
			||||||
          detailsJSON
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      model
 | 
					 | 
				
			||||||
      alarmsCount
 | 
					 | 
				
			||||||
      alarms {
 | 
					 | 
				
			||||||
        severity
 | 
					 | 
				
			||||||
        alarmCode
 | 
					 | 
				
			||||||
        details
 | 
					 | 
				
			||||||
        createdTimestamp
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
`;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export const FILTER_EQUIPMENT_BULK_EDIT_APS = gql`
 | 
					export const FILTER_EQUIPMENT_BULK_EDIT_APS = gql`
 | 
				
			||||||
  query FilterEquipment(
 | 
					  query FilterEquipment(
 | 
				
			||||||
    $locationIds: [ID]
 | 
					    $locationIds: [ID]
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10807
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10807
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										38
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								package.json
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "wlan-cloud-ui",
 | 
					  "name": "wlan-cloud-ui",
 | 
				
			||||||
  "version": "1.1.8",
 | 
					  "version": "0.7.5",
 | 
				
			||||||
  "author": "ConnectUs",
 | 
					  "author": "ConnectUs",
 | 
				
			||||||
  "description": "React Portal",
 | 
					  "description": "React Portal",
 | 
				
			||||||
  "engines": {
 | 
					  "engines": {
 | 
				
			||||||
@@ -9,9 +9,9 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "test": "jest --passWithNoTests --coverage",
 | 
					    "test": "jest --passWithNoTests --coverage",
 | 
				
			||||||
    "start": "cross-env NODE_ENV=development webpack serve --mode development",
 | 
					    "start": "cross-env NODE_ENV=development webpack-dev-server",
 | 
				
			||||||
    "start:bare": "cross-env API=https://wlan-ui.tip-sdk.lab.netexperience.com NODE_ENV=bare webpack serve --mode development",
 | 
					    "start:bare": "cross-env API=https://wlan-graphql.qa.lab.wlan.tip.build NODE_ENV=bare webpack-dev-server",
 | 
				
			||||||
    "start:dev": "cross-env API=https://wlan-ui.tip-sdk.lab.netexperience.com NODE_ENV=development webpack serve --mode development",
 | 
					    "start:dev": "cross-env API=https://wlan-graphql.qa.lab.wlan.tip.build NODE_ENV=development webpack-dev-server",
 | 
				
			||||||
    "build": "webpack --mode=production",
 | 
					    "build": "webpack --mode=production",
 | 
				
			||||||
    "format": "prettier --write 'app/**/*{.js,.scss}'",
 | 
					    "format": "prettier --write 'app/**/*{.js,.scss}'",
 | 
				
			||||||
    "eslint-fix": "eslint --fix 'app/**/*.js'",
 | 
					    "eslint-fix": "eslint --fix 'app/**/*.js'",
 | 
				
			||||||
@@ -21,26 +21,33 @@
 | 
				
			|||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@ant-design/icons": "^4.2.1",
 | 
					    "@ant-design/icons": "^4.2.1",
 | 
				
			||||||
    "@apollo/client": "^3.1.3",
 | 
					    "@apollo/client": "^3.1.3",
 | 
				
			||||||
    "@tip-wlan/wlan-cloud-ui-library": "^1.1.14",
 | 
					    "@tip-wlan/wlan-cloud-ui-library": "^0.7.6",
 | 
				
			||||||
    "antd": "^4.5.2",
 | 
					    "antd": "^4.5.2",
 | 
				
			||||||
    "apollo-upload-client": "^13.0.0",
 | 
					    "apollo-upload-client": "^13.0.0",
 | 
				
			||||||
    "graphql": "^15.5.0",
 | 
					    "clean-webpack-plugin": "^3.0.0",
 | 
				
			||||||
 | 
					    "graphql": "^14.6.0",
 | 
				
			||||||
 | 
					    "highcharts": "^8.1.0",
 | 
				
			||||||
 | 
					    "highcharts-react-official": "^3.0.0",
 | 
				
			||||||
    "history": "^4.10.1",
 | 
					    "history": "^4.10.1",
 | 
				
			||||||
 | 
					    "html-webpack-plugin": "^3.2.0",
 | 
				
			||||||
    "lodash": "^4.17.15",
 | 
					    "lodash": "^4.17.15",
 | 
				
			||||||
 | 
					    "mini-css-extract-plugin": "^0.9.0",
 | 
				
			||||||
    "moment": "^2.26.0",
 | 
					    "moment": "^2.26.0",
 | 
				
			||||||
 | 
					    "optimize-css-assets-webpack-plugin": "^5.0.3",
 | 
				
			||||||
    "prop-types": "^15.7.2",
 | 
					    "prop-types": "^15.7.2",
 | 
				
			||||||
    "react": "^16.13.0",
 | 
					    "react": "^16.13.0",
 | 
				
			||||||
    "react-dom": "^16.13.0",
 | 
					    "react-dom": "^16.13.0",
 | 
				
			||||||
    "react-helmet": "^5.2.1",
 | 
					    "react-helmet": "^5.2.1",
 | 
				
			||||||
 | 
					    "react-jsx-highcharts": "^4.1.0",
 | 
				
			||||||
 | 
					    "react-jsx-highstock": "^4.1.0",
 | 
				
			||||||
    "react-router-dom": "^5.1.2",
 | 
					    "react-router-dom": "^5.1.2",
 | 
				
			||||||
    "recharts": "^2.0.9"
 | 
					    "terser-webpack-plugin": "^2.3.5"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@babel/core": "^7.8.7",
 | 
					    "@babel/core": "^7.8.7",
 | 
				
			||||||
    "@babel/plugin-proposal-class-properties": "^7.8.3",
 | 
					    "@babel/plugin-proposal-class-properties": "^7.8.3",
 | 
				
			||||||
    "@babel/preset-env": "^7.8.7",
 | 
					    "@babel/preset-env": "^7.8.7",
 | 
				
			||||||
    "@babel/preset-react": "^7.8.3",
 | 
					    "@babel/preset-react": "^7.8.3",
 | 
				
			||||||
    "@babel/runtime": "^7.13.10",
 | 
					 | 
				
			||||||
    "@testing-library/react": "^10.0.3",
 | 
					    "@testing-library/react": "^10.0.3",
 | 
				
			||||||
    "babel-core": "^6.26.3",
 | 
					    "babel-core": "^6.26.3",
 | 
				
			||||||
    "babel-eslint": "^10.1.0",
 | 
					    "babel-eslint": "^10.1.0",
 | 
				
			||||||
@@ -48,10 +55,8 @@
 | 
				
			|||||||
    "babel-loader": "^8.0.6",
 | 
					    "babel-loader": "^8.0.6",
 | 
				
			||||||
    "babel-plugin-root-import": "^6.4.1",
 | 
					    "babel-plugin-root-import": "^6.4.1",
 | 
				
			||||||
    "babel-polyfill": "^6.26.0",
 | 
					    "babel-polyfill": "^6.26.0",
 | 
				
			||||||
    "clean-webpack-plugin": "^3.0.0",
 | 
					 | 
				
			||||||
    "cross-env": "^7.0.2",
 | 
					    "cross-env": "^7.0.2",
 | 
				
			||||||
    "css-loader": "^3.4.2",
 | 
					    "css-loader": "^3.4.2",
 | 
				
			||||||
    "css-minimizer-webpack-plugin": "^1.3.0",
 | 
					 | 
				
			||||||
    "eslint": "^6.8.0",
 | 
					    "eslint": "^6.8.0",
 | 
				
			||||||
    "eslint-config-airbnb": "^18.0.1",
 | 
					    "eslint-config-airbnb": "^18.0.1",
 | 
				
			||||||
    "eslint-config-prettier": "^6.10.0",
 | 
					    "eslint-config-prettier": "^6.10.0",
 | 
				
			||||||
@@ -63,23 +68,20 @@
 | 
				
			|||||||
    "eslint-plugin-react": "^7.19.0",
 | 
					    "eslint-plugin-react": "^7.19.0",
 | 
				
			||||||
    "eslint-plugin-react-hooks": "^2.5.0",
 | 
					    "eslint-plugin-react-hooks": "^2.5.0",
 | 
				
			||||||
    "file-loader": "^5.1.0",
 | 
					    "file-loader": "^5.1.0",
 | 
				
			||||||
    "html-webpack-plugin": "^5.3.1",
 | 
					 | 
				
			||||||
    "husky": "^4.2.3",
 | 
					    "husky": "^4.2.3",
 | 
				
			||||||
    "jest": "^25.4.0",
 | 
					    "jest": "^25.4.0",
 | 
				
			||||||
    "less": "^3.11.1",
 | 
					    "less": "^3.11.1",
 | 
				
			||||||
    "less-loader": "^6.2.0",
 | 
					    "less-loader": "^5.0.0",
 | 
				
			||||||
    "lint-staged": "^10.0.8",
 | 
					    "lint-staged": "^10.0.8",
 | 
				
			||||||
    "mini-css-extract-plugin": "^1.3.9",
 | 
					 | 
				
			||||||
    "node-sass": "^4.13.1",
 | 
					    "node-sass": "^4.13.1",
 | 
				
			||||||
    "prettier": "^1.19.1",
 | 
					    "prettier": "^1.19.1",
 | 
				
			||||||
    "react-test-renderer": "^16.13.1",
 | 
					    "react-test-renderer": "^16.13.1",
 | 
				
			||||||
    "sass-loader": "^8.0.2",
 | 
					    "sass-loader": "^8.0.2",
 | 
				
			||||||
    "style-loader": "^1.1.3",
 | 
					    "style-loader": "^1.1.3",
 | 
				
			||||||
    "terser-webpack-plugin": "^5.1.1",
 | 
					    "webpack": "^4.42.0",
 | 
				
			||||||
    "webpack": "^5.28.0",
 | 
					    "webpack-cli": "^3.3.11",
 | 
				
			||||||
    "webpack-cli": "^4.5.0",
 | 
					    "webpack-dev-server": "^3.11.0",
 | 
				
			||||||
    "webpack-dev-server": "^3.11.2",
 | 
					    "webpack-merge": "^4.2.2"
 | 
				
			||||||
    "webpack-merge": "^5.7.3"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "browserslist": [
 | 
					  "browserslist": [
 | 
				
			||||||
    "last 2 versions",
 | 
					    "last 2 versions",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,4 @@
 | 
				
			|||||||
/* eslint-disable import/no-extraneous-dependencies */
 | 
					const webpackMerge = require('webpack-merge');
 | 
				
			||||||
const { merge } = require('webpack-merge');
 | 
					 | 
				
			||||||
const common = require('./webpack/webpack.common');
 | 
					const common = require('./webpack/webpack.common');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const envs = {
 | 
					const envs = {
 | 
				
			||||||
@@ -10,4 +9,4 @@ const envs = {
 | 
				
			|||||||
/* eslint-disable global-require,import/no-dynamic-require */
 | 
					/* eslint-disable global-require,import/no-dynamic-require */
 | 
				
			||||||
const env = envs[process.env.NODE_ENV || 'production'];
 | 
					const env = envs[process.env.NODE_ENV || 'production'];
 | 
				
			||||||
const envConfig = require(`./webpack/webpack.${env}.js`);
 | 
					const envConfig = require(`./webpack/webpack.${env}.js`);
 | 
				
			||||||
module.exports = merge(common, envConfig);
 | 
					module.exports = webpackMerge(common, envConfig);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					const HtmlWebPackPlugin = require('html-webpack-plugin');
 | 
				
			||||||
/* eslint-disable import/no-extraneous-dependencies */
 | 
					/* eslint-disable import/no-extraneous-dependencies */
 | 
				
			||||||
const webpack = require('webpack');
 | 
					const webpack = require('webpack');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -24,6 +25,10 @@ module.exports = {
 | 
				
			|||||||
    ],
 | 
					    ],
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  plugins: [
 | 
					  plugins: [
 | 
				
			||||||
 | 
					    new HtmlWebPackPlugin({
 | 
				
			||||||
 | 
					      template: commonPaths.templatePath,
 | 
				
			||||||
 | 
					      favicon: './app/images/favicon.ico',
 | 
				
			||||||
 | 
					    }),
 | 
				
			||||||
    new webpack.DefinePlugin({
 | 
					    new webpack.DefinePlugin({
 | 
				
			||||||
      'process.env.API': JSON.stringify(process.env.API || 'http://localhost:4000'),
 | 
					      'process.env.API': JSON.stringify(process.env.API || 'http://localhost:4000'),
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,4 @@
 | 
				
			|||||||
/* eslint-disable import/no-extraneous-dependencies */
 | 
					 | 
				
			||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const commonPaths = require('./paths');
 | 
					const commonPaths = require('./paths');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,9 +52,7 @@ module.exports = {
 | 
				
			|||||||
          {
 | 
					          {
 | 
				
			||||||
            loader: 'less-loader', // compiles Less to CSS
 | 
					            loader: 'less-loader', // compiles Less to CSS
 | 
				
			||||||
            options: {
 | 
					            options: {
 | 
				
			||||||
              lessOptions: {
 | 
					              javascriptEnabled: true,
 | 
				
			||||||
                javascriptEnabled: true,
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
@@ -83,11 +79,4 @@ module.exports = {
 | 
				
			|||||||
      ),
 | 
					      ),
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					 | 
				
			||||||
  plugins: [
 | 
					 | 
				
			||||||
    new HtmlWebpackPlugin({
 | 
					 | 
				
			||||||
      template: commonPaths.templatePath,
 | 
					 | 
				
			||||||
      favicon: './app/images/favicon.ico',
 | 
					 | 
				
			||||||
    }),
 | 
					 | 
				
			||||||
  ],
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,6 @@
 | 
				
			|||||||
/* eslint-disable import/no-extraneous-dependencies */
 | 
					 | 
				
			||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
 | 
					 | 
				
			||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
 | 
					 | 
				
			||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 | 
					const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 | 
				
			||||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
 | 
					const { CleanWebpackPlugin } = require('clean-webpack-plugin');
 | 
				
			||||||
 | 
					const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
 | 
				
			||||||
const TerserPlugin = require('terser-webpack-plugin');
 | 
					const TerserPlugin = require('terser-webpack-plugin');
 | 
				
			||||||
const path = require('path');
 | 
					const path = require('path');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -10,50 +8,45 @@ const commonPaths = require('./paths');
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
module.exports = {
 | 
					module.exports = {
 | 
				
			||||||
  output: {
 | 
					  output: {
 | 
				
			||||||
 | 
					    filename: `${commonPaths.jsFolder}/[name].[hash].js`,
 | 
				
			||||||
    path: commonPaths.outputPath,
 | 
					    path: commonPaths.outputPath,
 | 
				
			||||||
    publicPath: '/',
 | 
					    publicPath: '/',
 | 
				
			||||||
    filename: `${commonPaths.jsFolder}/[name].[chunkhash].js`,
 | 
					    chunkFilename: `${commonPaths.jsFolder}/[name].[chunkhash].js`,
 | 
				
			||||||
    chunkFilename: `${commonPaths.jsFolder}/[id].[chunkhash].js`,
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					 | 
				
			||||||
  optimization: {
 | 
					  optimization: {
 | 
				
			||||||
    minimize: true,
 | 
					    minimize: true,
 | 
				
			||||||
    minimizer: [
 | 
					    minimizer: [
 | 
				
			||||||
      new TerserPlugin({
 | 
					      new TerserPlugin({
 | 
				
			||||||
        terserOptions: {
 | 
					        // Use multi-process parallel running to improve the build speed
 | 
				
			||||||
          warnings: false,
 | 
					        // Default number of concurrent runs: os.cpus().length - 1
 | 
				
			||||||
          compress: {
 | 
					 | 
				
			||||||
            comparisons: false,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          parse: {},
 | 
					 | 
				
			||||||
          mangle: true,
 | 
					 | 
				
			||||||
          output: {
 | 
					 | 
				
			||||||
            comments: false,
 | 
					 | 
				
			||||||
            ascii_only: true,
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        parallel: true,
 | 
					        parallel: true,
 | 
				
			||||||
 | 
					        // Enable file caching
 | 
				
			||||||
 | 
					        cache: true,
 | 
				
			||||||
 | 
					        sourceMap: true,
 | 
				
			||||||
      }),
 | 
					      }),
 | 
				
			||||||
      new CssMinimizerPlugin(),
 | 
					      new OptimizeCSSAssetsPlugin(),
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    nodeEnv: 'production',
 | 
					    // Automatically split vendor and commons
 | 
				
			||||||
    sideEffects: true,
 | 
					    // https://twitter.com/wSokra/status/969633336732905474
 | 
				
			||||||
    concatenateModules: true,
 | 
					    // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
 | 
				
			||||||
    runtimeChunk: 'single',
 | 
					 | 
				
			||||||
    splitChunks: {
 | 
					    splitChunks: {
 | 
				
			||||||
      chunks: 'all',
 | 
					 | 
				
			||||||
      maxInitialRequests: 10,
 | 
					 | 
				
			||||||
      minSize: 0,
 | 
					 | 
				
			||||||
      cacheGroups: {
 | 
					      cacheGroups: {
 | 
				
			||||||
        vendor: {
 | 
					        vendors: {
 | 
				
			||||||
          test: /[\\/]node_modules[\\/]/,
 | 
					          test: /[\\/]node_modules[\\/]/,
 | 
				
			||||||
          name(module) {
 | 
					          name: 'vendors',
 | 
				
			||||||
            const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
 | 
					          chunks: 'initial',
 | 
				
			||||||
            return `npm.${packageName.replace('@', '')}`;
 | 
					        },
 | 
				
			||||||
          },
 | 
					        async: {
 | 
				
			||||||
 | 
					          test: /[\\/]node_modules[\\/]/,
 | 
				
			||||||
 | 
					          name: 'async',
 | 
				
			||||||
 | 
					          chunks: 'async',
 | 
				
			||||||
 | 
					          minChunks: 4,
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // Keep the runtime chunk seperated to enable long term caching
 | 
				
			||||||
 | 
					    // https://twitter.com/wSokra/status/969679223278505985
 | 
				
			||||||
 | 
					    runtimeChunk: true,
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  module: {
 | 
					  module: {
 | 
				
			||||||
@@ -85,48 +78,25 @@ module.exports = {
 | 
				
			|||||||
          {
 | 
					          {
 | 
				
			||||||
            loader: 'less-loader', // compiles Less to CSS
 | 
					            loader: 'less-loader', // compiles Less to CSS
 | 
				
			||||||
            options: {
 | 
					            options: {
 | 
				
			||||||
              lessOptions: {
 | 
					              javascriptEnabled: true,
 | 
				
			||||||
                javascriptEnabled: true,
 | 
					 | 
				
			||||||
              },
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					 | 
				
			||||||
  resolve: {
 | 
					  resolve: {
 | 
				
			||||||
    modules: ['node_modules', 'app'],
 | 
					    modules: ['node_modules', 'app'],
 | 
				
			||||||
    alias: {
 | 
					    alias: {
 | 
				
			||||||
      app: path.resolve(__dirname, '../', 'app'),
 | 
					      app: path.resolve(__dirname, '../', 'app'),
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					 | 
				
			||||||
  plugins: [
 | 
					  plugins: [
 | 
				
			||||||
    new CleanWebpackPlugin(),
 | 
					    new CleanWebpackPlugin(),
 | 
				
			||||||
 | 
					 | 
				
			||||||
    // Minify and optimize the index.html
 | 
					 | 
				
			||||||
    new HtmlWebpackPlugin({
 | 
					 | 
				
			||||||
      template: commonPaths.templatePath,
 | 
					 | 
				
			||||||
      favicon: './app/images/favicon.ico',
 | 
					 | 
				
			||||||
      minify: {
 | 
					 | 
				
			||||||
        removeComments: true,
 | 
					 | 
				
			||||||
        collapseWhitespace: true,
 | 
					 | 
				
			||||||
        removeRedundantAttributes: true,
 | 
					 | 
				
			||||||
        useShortDoctype: true,
 | 
					 | 
				
			||||||
        removeEmptyAttributes: true,
 | 
					 | 
				
			||||||
        removeStyleLinkTypeAttributes: true,
 | 
					 | 
				
			||||||
        keepClosingSlash: true,
 | 
					 | 
				
			||||||
        minifyJS: true,
 | 
					 | 
				
			||||||
        minifyCSS: true,
 | 
					 | 
				
			||||||
        minifyURLs: true,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      inject: true,
 | 
					 | 
				
			||||||
    }),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    new MiniCssExtractPlugin({
 | 
					    new MiniCssExtractPlugin({
 | 
				
			||||||
      filename: `${commonPaths.cssFolder}/[name].css`,
 | 
					      filename: `${commonPaths.cssFolder}/[name].css`,
 | 
				
			||||||
      chunkFilename: `${commonPaths.cssFolder}/[id].css`,
 | 
					      chunkFilename: `${commonPaths.cssFolder}/[name].css`,
 | 
				
			||||||
    }),
 | 
					    }),
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
 | 
					  devtool: 'source-map',
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user