32 Commits

Author SHA1 Message Date
Max Brenner
1f018cbd04 strip v character from tags 2021-03-03 19:00:56 +01:00
Max Brenner
bc57402aa9 enable docker push commands 2021-03-02 16:44:59 +01:00
Max Brenner
2692e6527f fix matching of optional v character 2021-03-02 16:35:49 +01:00
Max Brenner
f6d03b7a1b fix matching of optional v character 2021-03-02 16:20:55 +01:00
Max Brenner
3f1a85a9c0 adjust build for release branch 2021-03-02 16:04:53 +01:00
AkshayJagadish-ne
f1b0c54fc3 Merge pull request #89 from Telecominfraproject/WIFI-1669
WIFI:1669 TIP 1.0 Update SDK components  in release 1.0 branch
2021-02-27 22:02:31 -05:00
Akshay Jagadish
7659407562 WIFI:1669 TIP 1.0 Update SDK components and default container image tags in release 1.0 branch 2021-02-26 19:13:49 -05:00
Sean Macfarlane
cf5be15402 removed caching 2021-02-26 14:06:09 -05:00
Sean Macfarlane
f3ee2f5a7c fixed ap details profiles 2021-02-22 22:27:56 -05:00
Sean Macfarlane
6ddd9b30f3 updated library 2021-02-20 20:38:19 -05:00
Sean Macfarlane
8acdd0ca4a updated library 2021-02-18 14:10:41 -05:00
Sean Macfarlane
8670e74b77 Merge pull request #88 from Telecominfraproject/bugfix/WIFI-1442
Bugfix/WIFI-1442: Bulk-Edit APs Page Fixes
2021-02-18 11:10:06 -05:00
irtiza-h30
c8798dd6b3 fixed function for updated param type 2021-02-18 10:19:38 -05:00
Sean Macfarlane
82b5688503 WIFI-1557 2021-02-17 13:55:54 -05:00
irtiza-h30
fadb618c6a fixed column styling 2021-02-16 17:53:46 -05:00
Sean Macfarlane
dbf54d26b6 updated library 2021-02-16 14:36:42 -05:00
irtiza-h30
11e7b92902 null safe fix 2021-02-12 14:52:23 -05:00
irtiza-h30
cb8364b1ab fixed saving bug 2021-02-12 11:45:53 -05:00
Sean Macfarlane
796bf24ef9 updated library 2021-02-05 12:45:47 -05:00
Sean Macfarlane
444a9a929d updated library 2021-01-29 14:25:45 -05:00
Sean Macfarlane
efea725ce9 Merge pull request #87 from Telecominfraproject/hotfix/ProfilePages
hotfix/ProfilePages: fixed prop names
2021-01-23 16:01:41 -05:00
Sean Macfarlane
7a3bcbb2cb update versions 2021-01-23 16:00:06 -05:00
Sean Macfarlane
a3e304323d Merge branch 'master' into hotfix/ProfilePages 2021-01-22 19:04:16 -05:00
Sean Macfarlane
af182c93c6 fixed update equipment 2021-01-22 18:56:16 -05:00
irtiza-h30
78fde75678 fixed props 2021-01-21 19:32:14 -05:00
Sean Macfarlane
7eda2074b2 updated version 2021-01-20 12:22:44 -05:00
Sean Macfarlane
ded1b2d088 fixed error policies 2021-01-20 12:21:45 -05:00
Sean Macfarlane
e1f0357c1f Merge pull request #86 from Telecominfraproject/bugfix/NETEXP-523
bugfix/NETEXP-523: Passed down radius & captive profiles to AddProfile
2021-01-05 12:14:21 -05:00
ToanDo
b84e156f74 Passed down radius&captive profiles to AddProfile 2021-01-04 18:02:00 -05:00
Sean Macfarlane
cae23638ee Merge pull request #85 from Telecominfraproject/bugfix/NETEXP-839
bugfix/NETEXP-839: Added comparison to filter out negative values of the traffic graph
2020-12-21 21:59:40 -05:00
ToanDo
569154ff95 Added comparator to filter out negative traffic 2020-12-21 15:15:03 -05:00
Sean Macfarlane
78146969f3 update version 2020-12-16 13:22:20 -05:00
10 changed files with 177 additions and 321 deletions

View File

@@ -5,6 +5,7 @@ on:
# Publish `master` as Docker `latest` image.
branches:
- master
- 'release/**'
# Publish `v1.2.3` tags as releases.
tags:
@@ -56,8 +57,11 @@ jobs:
# Strip "v" prefix from tag name
[[ "${{ 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
[ "$VERSION" == "master" ] && VERSION=latest
[ "$VERSION" == "master" ] && VERSION=1.0.0-SNAPSHOT
TIMESTAMP=$(date +'%Y-%m-%d')
@@ -88,8 +92,11 @@ jobs:
# Strip "v" prefix from tag name
[[ "${{ 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
[ "$VERSION" == "master" ] && VERSION=latest
[ "$VERSION" == "master" ] && VERSION=1.0.0-SNAPSHOT
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION

View File

@@ -7,7 +7,7 @@ import { useHistory } from 'react-router-dom';
import { ROUTES } from 'constants/index';
import UserContext from 'contexts/UserContext';
import { GET_ALL_PROFILES } from 'graphql/queries';
import { updateQueryGetAllProfiles } from 'graphql/functions';
import { fetchMoreProfiles } from 'graphql/functions';
const CREATE_PROFILE = gql`
mutation CreateProfile(
@@ -37,24 +37,43 @@ const AddProfile = () => {
const { customerId } = useContext(UserContext);
const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
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(), {
variables: { customerId, type: 'passpoint_venue' },
fetchPolicy: 'network-only',
});
const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'passpoint_operator' },
fetchPolicy: 'network-only',
}
);
const { data: idProviderProfiles, fetchMore: fetchMoreIdProviderProfiles } = useQuery(
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'passpoint_osu_id_provider' },
fetchPolicy: 'network-only',
}
);
const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'rf' },
fetchPolicy: 'network-only',
});
const [createProfile] = useMutation(CREATE_PROFILE);
const history = useHistory();
@@ -84,111 +103,30 @@ const AddProfile = () => {
);
};
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 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;
const handleFetchMoreProfiles = (e, key) => {
if (key === 'radius') fetchMoreProfiles(e, radiusProfiles, fetchMoreRadiusProfiles);
else if (key === 'captive_portal')
fetchMoreProfiles(e, captiveProfiles, fetchMoreCaptiveProfiles);
else if (key === 'rf') fetchMoreProfiles(e, rfProfiles, fetchMoreRfProfiles);
else if (key === 'passpoint_venue') fetchMoreProfiles(e, venueProfiles, fetchMoreVenueProfiles);
else if (key === 'passpoint_operator')
fetchMoreProfiles(e, operatorProfiles, fetchMoreOperatorProfiles);
else if (key === 'passpoint_osu_id_provider')
fetchMoreProfiles(e, idProviderProfiles, fetchMoreIdProviderProfiles);
else fetchMoreProfiles(e, ssidProfiles, fetchMore);
};
return (
<AddProfilePage
onCreateProfile={handleAddProfile}
ssidProfiles={
(ssidProfiles && ssidProfiles.getAllProfiles && ssidProfiles.getAllProfiles.items) || []
}
ssidProfiles={ssidProfiles?.getAllProfiles?.items}
radiusProfiles={radiusProfiles?.getAllProfiles?.items}
captiveProfiles={captiveProfiles?.getAllProfiles?.items}
venueProfiles={venueProfiles?.getAllProfiles?.items}
operatorProfiles={operatorProfiles?.getAllProfiles?.items}
idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
rfProfiles={rfProfiles?.getAllProfiles?.items}
onFetchMoreProfiles={handleFetchProfiles}
onFetchMoreVenueProfiles={handleFetchVenueProfiles}
onFetchMoreOperatorProfiles={handleFetchOperatorProfiles}
onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles}
onFetchMoreRfProfiles={handleFetchRfProfiles}
onFetchMoreProfiles={handleFetchMoreProfiles}
/>
);
};

View File

@@ -129,11 +129,17 @@ const Dashboard = () => {
clientDevices2dot4GHz.push([eventTimestamp, radios.is2dot4GHz || 0]);
clientDevices5GHz.push([eventTimestamp, total5GHz || 0]);
trafficBytesDownstreamData.push([eventTimestamp, trafficBytesDownstream || 0]);
trafficBytesUpstreamData.push([eventTimestamp, trafficBytesUpstream || 0]);
trafficBytesDownstreamData.push([
eventTimestamp,
(trafficBytesDownstream > 0 && trafficBytesDownstream) || 0,
]);
trafficBytesUpstreamData.push([
eventTimestamp,
(trafficBytesUpstream > 0 && trafficBytesUpstream) || 0,
]);
totalDown += trafficBytesDownstream || 0;
totalUp += trafficBytesUpstream || 0;
totalDown += (trafficBytesDownstream > 0 && trafficBytesDownstream) || 0;
totalUp += (trafficBytesUpstream > 0 && trafficBytesUpstream) || 0;
}
);

View File

@@ -15,7 +15,7 @@ import {
REQUEST_EQUIPMENT_SWITCH_BANK,
REQUEST_EQUIPMENT_REBOOT,
} from 'graphql/mutations';
import { updateQueryGetAllProfiles } from 'graphql/functions';
import { fetchMoreProfiles } from 'graphql/functions';
import UserContext from 'contexts/UserContext';
const GET_EQUIPMENT = gql`
@@ -85,6 +85,7 @@ const UPDATE_EQUIPMENT = gql`
$profileId: ID!
$locationId: ID!
$name: String!
$baseMacAddress: String
$latitude: String
$longitude: String
$serial: String
@@ -99,6 +100,7 @@ const UPDATE_EQUIPMENT = gql`
profileId: $profileId
locationId: $locationId
name: $name
baseMacAddress: $baseMacAddress
latitude: $latitude
longitude: $longitude
serial: $serial
@@ -112,6 +114,7 @@ const UPDATE_EQUIPMENT = gql`
profileId
locationId
name
baseMacAddress
latitude
longitude
serial
@@ -142,6 +145,7 @@ const AccessPointDetails = ({ locations }) => {
id,
},
fetchPolicy: 'network-only',
errorPolicy: 'all',
});
const { data: dataFirmware, error: errorFirmware, loading: loadingFirmware } = useQuery(
@@ -149,9 +153,9 @@ const AccessPointDetails = ({ locations }) => {
{
skip: !data?.getEquipment?.model,
variables: { modelId: data?.getEquipment?.model },
errorPolicy: 'all',
}
);
const {
data: dataProfiles,
error: errorProfiles,
@@ -196,20 +200,21 @@ const AccessPointDetails = ({ locations }) => {
metricsRefetch();
};
const handleUpdateEquipment = (
equipmentId,
const handleUpdateEquipment = ({
id: equipmentId,
equipmentType,
inventoryId,
custId,
customerId: custId,
profileId,
locationId,
name,
baseMacAddress,
latitude,
longitude,
serial,
lastModifiedTimestamp,
details
) => {
formattedData,
}) => {
updateEquipment({
variables: {
id: equipmentId,
@@ -219,11 +224,12 @@ const AccessPointDetails = ({ locations }) => {
profileId,
locationId,
name,
baseMacAddress,
latitude,
longitude,
serial,
lastModifiedTimestamp,
details,
details: formattedData,
},
})
.then(() => {
@@ -327,28 +333,14 @@ const AccessPointDetails = ({ locations }) => {
);
const handleFetchProfiles = e => {
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;
fetchMoreProfiles(e, dataProfiles, fetchMore);
};
if (loading) {
return <Loading />;
}
if (error) {
if (error && !data?.getEquipment) {
return (
<Alert
message="Error"

View File

@@ -11,6 +11,8 @@ import { UPDATE_EQUIPMENT_BULK } from 'graphql/mutations';
import UserContext from 'contexts/UserContext';
import styles from './index.module.scss';
const defaultAppliedRadios = { is5GHzL: 'is5GHzL', is2dot4GHz: 'is2dot4GHz', is5GHzU: 'is5GHzU' };
const renderTableCell = tabCell => {
if (Array.isArray(tabCell)) {
return (
@@ -25,47 +27,54 @@ const renderTableCell = tabCell => {
return <span>{tabCell}</span>;
};
const accessPointsChannelTableColumns = [
{ title: 'NAME', dataIndex: 'name', key: 'name', render: renderTableCell },
{ title: 'Name', dataIndex: 'name', key: 'name', width: 150, render: renderTableCell },
{
title: 'CHANNEL',
title: 'Channel',
dataIndex: 'channel',
key: 'channel',
editable: true,
width: 150,
render: renderTableCell,
},
{
title: 'CELL SIZE',
title: 'Cell Size',
dataIndex: 'cellSize',
key: 'cellSize',
editable: true,
width: 150,
render: renderTableCell,
},
{
title: 'PROB RESPONSE THRESHOLD',
title: 'Probe Response Threshold',
dataIndex: 'probeResponseThreshold',
key: 'probeResponseThreshold',
editable: true,
width: 200,
render: renderTableCell,
},
{
title: 'CLIENT DISCONNECT THRESHOLD',
title: 'Client Disconnect Threshold',
dataIndex: 'clientDisconnectThreshold',
key: 'clientDisconnectThreshold',
editable: true,
width: 200,
render: renderTableCell,
},
{
title: 'SNR (% DROP)',
title: 'SNR (% Drop)',
dataIndex: 'snrDrop',
key: 'snrDrop',
editable: true,
width: 175,
render: renderTableCell,
},
{
title: 'MIN LOAD',
title: 'Min Load',
dataIndex: 'minLoad',
key: 'minLoad',
editable: true,
width: 150,
render: renderTableCell,
},
];
@@ -162,42 +171,44 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
const getRadioDetails = (radioDetails, type) => {
if (type === 'cellSize') {
const cellSizeValues = [];
Object.keys(radioDetails.radioMap).map(i => {
return cellSizeValues.push(radioDetails.radioMap[i].rxCellSizeDb.value);
Object.keys(radioDetails?.radioMap || {}).map(i => {
return cellSizeValues.push(radioDetails.radioMap[i]?.rxCellSizeDb?.value);
});
return cellSizeValues;
}
if (type === 'probeResponseThreshold') {
const probeResponseThresholdValues = [];
Object.keys(radioDetails.radioMap).map(i => {
Object.keys(radioDetails?.radioMap || {}).map(i => {
return probeResponseThresholdValues.push(
radioDetails.radioMap[i].probeResponseThresholdDb.value
radioDetails.radioMap[i]?.probeResponseThresholdDb?.value
);
});
return probeResponseThresholdValues;
}
if (type === 'clientDisconnectThreshold') {
const clientDisconnectThresholdValues = [];
Object.keys(radioDetails.radioMap).map(i => {
Object.keys(radioDetails?.radioMap || {}).map(i => {
return clientDisconnectThresholdValues.push(
radioDetails.radioMap[i].clientDisconnectThresholdDb.value
radioDetails.radioMap[i]?.clientDisconnectThresholdDb?.value
);
});
return clientDisconnectThresholdValues;
}
if (type === 'snrDrop') {
const snrDropValues = [];
Object.keys(radioDetails.advancedRadioMap).map(i => {
Object.keys(radioDetails?.radioMap || {}).map(i => {
return snrDropValues.push(
radioDetails.advancedRadioMap[i].bestApSettings.dropInSnrPercentage
radioDetails.advancedRadioMap[i]?.bestApSettings?.value?.dropInSnrPercentage
);
});
return snrDropValues;
}
const minLoadValue = [];
Object.keys(radioDetails.advancedRadioMap).map(i => {
return minLoadValue.push(radioDetails.advancedRadioMap[i].bestApSettings.minLoadFactor);
Object.keys(radioDetails?.radioMap || {}).map(i => {
return minLoadValue.push(
radioDetails.advancedRadioMap[i]?.bestApSettings?.value?.minLoadFactor
);
});
return minLoadValue;
};
@@ -234,7 +245,7 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
let minLoadFactor;
dataSource.items.forEach(({ id: itemId, details }) => {
if (equipmentId === itemId) {
Object.keys(details.radioMap).forEach((i, dataIndex) => {
Object.keys(details?.radioMap || defaultAppliedRadios).forEach((i, dataIndex) => {
const frequencies = {};
dropInSnrPercentage = snrDrop[dataIndex];
minLoadFactor = minLoad[dataIndex];
@@ -286,42 +297,39 @@ const BulkEditAPs = ({ locations, checkedLocations }) => {
const handleSaveChanges = updatedRows => {
const editedRowsArr = [];
if (updatedRows.length > 0) {
updatedRows.map(
({
id: equipmentId,
channel,
cellSize,
probeResponseThreshold,
clientDisconnectThreshold,
snrDrop,
minLoad,
}) => {
const updatedEuips = setUpdatedBulkEditTableData(
equipmentId,
channel,
cellSize,
probeResponseThreshold,
clientDisconnectThreshold,
snrDrop,
minLoad,
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);
}
Object.keys(updatedRows).forEach(key => {
const {
id: equipmentId,
channel,
cellSize,
probeResponseThreshold,
clientDisconnectThreshold,
snrDrop,
minLoad,
} = updatedRows[key];
const updatedEuips = setUpdatedBulkEditTableData(
equipmentId,
channel,
cellSize,
probeResponseThreshold,
clientDisconnectThreshold,
snrDrop,
minLoad,
equipData && equipData.filterEquipment
);
updateEquipments(editedRowsArr);
}
const tempObj = {
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 = () => {

View File

@@ -1,5 +1,4 @@
.tabColumn {
display: flex;
flex-direction: column;
padding: 0 30px;
}

View File

@@ -8,7 +8,7 @@ import { ROUTES } from 'constants/index';
import UserContext from 'contexts/UserContext';
import { GET_ALL_PROFILES } from 'graphql/queries';
import { FILE_UPLOAD } from 'graphql/mutations';
import { updateQueryGetAllProfiles } from 'graphql/functions';
import { fetchMoreProfiles } from 'graphql/functions';
const GET_PROFILE = gql`
query GetProfile($id: ID!) {
@@ -82,12 +82,14 @@ const ProfileDetails = () => {
const { data: ssidProfiles, fetchMore } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'ssid' },
fetchPolicy: 'network-only',
});
const { data: radiusProfiles, fetchMore: fetchMoreRadiusProfiles } = useQuery(
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'radius' },
fetchPolicy: 'network-only',
}
);
@@ -95,17 +97,20 @@ const ProfileDetails = () => {
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'captive_portal' },
fetchPolicy: 'network-only',
}
);
const { data: venueProfiles, fetchMore: fetchMoreVenueProfiles } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'passpoint_venue' },
fetchPolicy: 'network-only',
});
const { data: operatorProfiles, fetchMore: fetchMoreOperatorProfiles } = useQuery(
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'passpoint_operator' },
fetchPolicy: 'network-only',
}
);
@@ -113,11 +118,13 @@ const ProfileDetails = () => {
GET_ALL_PROFILES(),
{
variables: { customerId, type: 'passpoint_osu_id_provider' },
fetchPolicy: 'network-only',
}
);
const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'rf' },
fetchPolicy: 'network-only',
});
const [updateProfile] = useMutation(UPDATE_PROFILE);
@@ -185,130 +192,17 @@ const ProfileDetails = () => {
})
);
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 handleFetchRadiusProfiles = e => {
if (radiusProfiles.getAllProfiles.context.lastPage) {
return false;
}
e.persist();
const { target } = e;
if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
fetchMoreRadiusProfiles({
variables: { context: { ...radiusProfiles.getAllProfiles.context } },
updateQuery: updateQueryGetAllProfiles,
});
}
return true;
};
const handleFetchCaptiveProfiles = e => {
if (captiveProfiles.getAllProfiles.context.lastPage) {
return false;
}
e.persist();
const { target } = e;
if (target.scrollTop + target.offsetHeight === target.scrollHeight) {
fetchMoreCaptiveProfiles({
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;
const handleFetchMoreProfiles = (e, key) => {
if (key === 'radius') fetchMoreProfiles(e, radiusProfiles, fetchMoreRadiusProfiles);
else if (key === 'captive_portal')
fetchMoreProfiles(e, captiveProfiles, fetchMoreCaptiveProfiles);
else if (key === 'rf') fetchMoreProfiles(e, rfProfiles, fetchMoreRfProfiles);
else if (key === 'passpoint_venue') fetchMoreProfiles(e, venueProfiles, fetchMoreVenueProfiles);
else if (key === 'passpoint_operator')
fetchMoreProfiles(e, operatorProfiles, fetchMoreOperatorProfiles);
else if (key === 'passpoint_osu_id_provider')
fetchMoreProfiles(e, idProviderProfiles, fetchMoreIdProviderProfiles);
else fetchMoreProfiles(e, ssidProfiles, fetchMore);
};
if (loading) {
@@ -342,13 +236,7 @@ const ProfileDetails = () => {
operatorProfiles={operatorProfiles?.getAllProfiles?.items}
idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
fileUpload={handleFileUpload}
onFetchMoreProfiles={handleFetchProfiles}
onFetchMoreRfProfiles={handleFetchRfProfiles}
onFetchMoreRadiusProfiles={handleFetchRadiusProfiles}
onFetchMoreCaptiveProfiles={handleFetchCaptiveProfiles}
onFetchMoreVenueProfiles={handleFetchVenueProfiles}
onFetchMoreOperatorProfiles={handleFetchOperatorProfiles}
onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles}
onFetchMoreProfiles={handleFetchMoreProfiles}
/>
);
};

View File

@@ -10,3 +10,21 @@ 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;
};

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "wlan-cloud-ui",
"version": "0.7.5",
"version": "0.10.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1845,9 +1845,9 @@
}
},
"@tip-wlan/wlan-cloud-ui-library": {
"version": "0.7.6",
"resolved": "https://tip.jfrog.io/artifactory/api/npm/tip-wlan-cloud-npm-repo/@tip-wlan/wlan-cloud-ui-library/-/@tip-wlan/wlan-cloud-ui-library-0.7.6.tgz",
"integrity": "sha1-GW0Wz1L8OnAwRqlyjUNZnGIuWQg="
"version": "0.13.3",
"resolved": "https://tip.jfrog.io/artifactory/api/npm/tip-wlan-cloud-npm-repo/@tip-wlan/wlan-cloud-ui-library/-/@tip-wlan/wlan-cloud-ui-library-0.13.3.tgz",
"integrity": "sha1-iTZriIG3Yd9OdrSzBWz5JKO7Cyg="
},
"@types/anymatch": {
"version": "1.3.1",

View File

@@ -1,6 +1,6 @@
{
"name": "wlan-cloud-ui",
"version": "0.7.5",
"version": "0.10.2",
"author": "ConnectUs",
"description": "React Portal",
"engines": {
@@ -10,8 +10,8 @@
"scripts": {
"test": "jest --passWithNoTests --coverage",
"start": "cross-env NODE_ENV=development webpack-dev-server",
"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-graphql.qa.lab.wlan.tip.build NODE_ENV=development webpack-dev-server",
"start:bare": "cross-env API=ttps://portal.rtl.lab.netexperience.com NODE_ENV=bare webpack-dev-server",
"start:dev": "cross-env API=https://portal.rtl.lab.netexperience.com NODE_ENV=development webpack-dev-server",
"build": "webpack --mode=production",
"format": "prettier --write 'app/**/*{.js,.scss}'",
"eslint-fix": "eslint --fix 'app/**/*.js'",
@@ -21,7 +21,7 @@
"dependencies": {
"@ant-design/icons": "^4.2.1",
"@apollo/client": "^3.1.3",
"@tip-wlan/wlan-cloud-ui-library": "^0.7.6",
"@tip-wlan/wlan-cloud-ui-library": "^0.13.3",
"antd": "^4.5.2",
"apollo-upload-client": "^13.0.0",
"clean-webpack-plugin": "^3.0.0",