Merge branch 'master' into feature/WIFI-1089

This commit is contained in:
Sean Macfarlane
2020-12-09 15:48:19 -05:00
12 changed files with 150 additions and 16296 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ const GET_ALL_USERS = gql`
items { items {
id id
email: username email: username
role roles
lastModifiedTimestamp lastModifiedTimestamp
customerId customerId
} }
@@ -22,10 +22,10 @@ const GET_ALL_USERS = gql`
`; `;
const CREATE_USER = gql` const CREATE_USER = gql`
mutation CreateUser($username: String!, $password: String!, $role: String!, $customerId: ID!) { mutation CreateUser($username: String!, $password: String!, $roles: [String], $customerId: ID!) {
createUser(username: $username, password: $password, role: $role, customerId: $customerId) { createUser(username: $username, password: $password, roles: $roles, customerId: $customerId) {
username username
role roles
customerId customerId
} }
} }
@@ -36,7 +36,7 @@ const UPDATE_USER = gql`
$id: ID! $id: ID!
$username: String! $username: String!
$password: String! $password: String!
$role: String! $roles: [String]
$customerId: ID! $customerId: ID!
$lastModifiedTimestamp: String $lastModifiedTimestamp: String
) { ) {
@@ -44,13 +44,13 @@ const UPDATE_USER = gql`
id: $id id: $id
username: $username username: $username
password: $password password: $password
role: $role roles: $roles
customerId: $customerId customerId: $customerId
lastModifiedTimestamp: $lastModifiedTimestamp lastModifiedTimestamp: $lastModifiedTimestamp
) { ) {
id id
username username
role roles
customerId customerId
lastModifiedTimestamp lastModifiedTimestamp
} }
@@ -95,12 +95,12 @@ const Accounts = () => {
} }
}; };
const handleCreateUser = (email, password, role) => { const handleCreateUser = (email, password, roles) => {
createUser({ createUser({
variables: { variables: {
username: email, username: email,
password, password,
role, roles: [roles],
customerId, customerId,
}, },
}) })
@@ -119,13 +119,13 @@ const Accounts = () => {
); );
}; };
const handleEditUser = (id, email, password, role, lastModifiedTimestamp) => { const handleEditUser = (id, email, password, roles, lastModifiedTimestamp) => {
updateUser({ updateUser({
variables: { variables: {
id, id,
username: email, username: email,
password, password,
role, roles: [roles],
customerId, customerId,
lastModifiedTimestamp, lastModifiedTimestamp,
}, },

View File

@@ -4,6 +4,7 @@ import { useMutation, useQuery, gql } from '@apollo/client';
import { notification } from 'antd'; import { notification } from 'antd';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
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 { updateQueryGetAllProfiles } from 'graphql/functions'; import { updateQueryGetAllProfiles } from 'graphql/functions';
@@ -52,6 +53,9 @@ const AddProfile = () => {
variables: { customerId, type: 'passpoint_osu_id_provider' }, variables: { customerId, type: 'passpoint_osu_id_provider' },
} }
); );
const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'rf' },
});
const [createProfile] = useMutation(CREATE_PROFILE); const [createProfile] = useMutation(CREATE_PROFILE);
const history = useHistory(); const history = useHistory();
@@ -70,7 +74,7 @@ const AddProfile = () => {
message: 'Success', message: 'Success',
description: 'Profile successfully created.', description: 'Profile successfully created.',
}); });
history.push('/profiles', { refetch: true }); history.push(ROUTES.profiles, { refetch: true });
}) })
.catch(() => .catch(() =>
notification.error({ notification.error({
@@ -116,6 +120,24 @@ const AddProfile = () => {
return true; 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 => { const handleFetchOperatorProfiles = e => {
if (operatorProfiles.getAllProfiles.context.lastPage) { if (operatorProfiles.getAllProfiles.context.lastPage) {
return false; return false;
@@ -161,10 +183,12 @@ const AddProfile = () => {
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}
onFetchMoreProfiles={handleFetchProfiles} onFetchMoreProfiles={handleFetchProfiles}
onFetchMoreVenueProfiles={handleFetchVenueProfiles} onFetchMoreVenueProfiles={handleFetchVenueProfiles}
onFetchMoreOperatorProfiles={handleFetchOperatorProfiles} onFetchMoreOperatorProfiles={handleFetchOperatorProfiles}
onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles} onFetchMoreIdProviderProfiles={handleFetchIdProviderProfiles}
onFetchMoreRfProfiles={handleFetchRfProfiles}
/> />
); );
}; };

View File

@@ -2,12 +2,12 @@ import React, { useState } from 'react';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { Switch, Redirect } from 'react-router-dom'; import { Switch, Redirect } from 'react-router-dom';
import { ThemeProvider } from '@tip-wlan/wlan-cloud-ui-library'; import { ThemeProvider, GenericNotFound } from '@tip-wlan/wlan-cloud-ui-library';
import logo from 'images/tip-logo.png'; import logo from 'images/tip-logo.png';
import logoMobile from 'images/tip-logo-mobile.png'; import logoMobile from 'images/tip-logo-mobile.png';
import { AUTH_TOKEN, COMPANY } from 'constants/index'; import { AUTH_TOKEN, COMPANY, ROUTES } from 'constants/index';
import Login from 'containers/Login'; import Login from 'containers/Login';
import Network from 'containers/Network'; import Network from 'containers/Network';
@@ -32,7 +32,7 @@ import ProtectedRouteWithLayout from './components/ProtectedRouteWithLayout';
const RedirectToDashboard = () => ( const RedirectToDashboard = () => (
<Redirect <Redirect
to={{ to={{
pathname: '/dashboard', pathname: ROUTES.dashboard,
}} }}
/> />
); );
@@ -42,7 +42,7 @@ const App = () => {
let initialUser = {}; let initialUser = {};
if (token) { if (token) {
const { userId, userName, userRole, customerId } = parseJwt(token.access_token); const { userId, userName, userRole, customerId } = parseJwt(token.access_token);
initialUser = { id: userId, email: userName, role: userRole, customerId }; initialUser = { id: userId, email: userName, roles: userRole, customerId };
} }
const [user, setUser] = useState(initialUser); const [user, setUser] = useState(initialUser);
@@ -50,7 +50,7 @@ const App = () => {
setItem(AUTH_TOKEN, newToken); setItem(AUTH_TOKEN, newToken);
if (newToken) { if (newToken) {
const { userId, userName, userRole, customerId } = parseJwt(newToken.access_token); const { userId, userName, userRole, customerId } = parseJwt(newToken.access_token);
setUser({ id: userId, email: userName, role: userRole, customerId }); setUser({ id: userId, email: userName, roles: userRole, customerId });
} }
}; };
@@ -60,32 +60,37 @@ const App = () => {
<UserProvider <UserProvider
id={user.id} id={user.id}
email={user.email} email={user.email}
role={user.role} roles={user.roles}
customerId={user.customerId} customerId={user.customerId}
updateUser={updateUser} updateUser={updateUser}
updateToken={updateToken} updateToken={updateToken}
> >
<ThemeProvider company={COMPANY} logo={logo} logoMobile={logoMobile}> <ThemeProvider company={COMPANY} logo={logo} logoMobile={logoMobile} routes={ROUTES}>
<Helmet titleTemplate={`%s - ${COMPANY}`} defaultTitle={COMPANY}> <Helmet titleTemplate={`%s - ${COMPANY}`} defaultTitle={COMPANY}>
<meta name="description" content={COMPANY} /> <meta name="description" content={COMPANY} />
</Helmet> </Helmet>
<Switch> <Switch>
<UnauthenticatedRoute exact path="/login" component={Login} /> <UnauthenticatedRoute exact path={ROUTES.login} component={Login} />
<ProtectedRouteWithLayout exact path="/" component={RedirectToDashboard} /> <ProtectedRouteWithLayout exact path={ROUTES.root} component={RedirectToDashboard} />
<ProtectedRouteWithLayout exact path="/dashboard" component={Dashboard} /> <ProtectedRouteWithLayout exact path={ROUTES.dashboard} component={Dashboard} />
<ProtectedRouteWithLayout path="/network" component={Network} /> <ProtectedRouteWithLayout path={ROUTES.network} component={Network} />
<ProtectedRouteWithLayout path="/system" component={System} /> <ProtectedRouteWithLayout path={ROUTES.system} component={System} />
<ProtectedRouteWithLayout exact path="/profiles" component={Profiles} /> <ProtectedRouteWithLayout exact path={ROUTES.profiles} component={Profiles} />
<ProtectedRouteWithLayout exact path="/profiles/:id" component={ProfileDetails} /> <ProtectedRouteWithLayout
<ProtectedRouteWithLayout exact path="/addprofile" component={AddProfile} /> exact
path={`${ROUTES.profiles}/:id`}
component={ProfileDetails}
/>
<ProtectedRouteWithLayout exact path={ROUTES.addprofile} component={AddProfile} />
<ProtectedRouteWithLayout exact path="/alarms" component={Alarms} /> <ProtectedRouteWithLayout exact path={ROUTES.alarms} component={Alarms} />
<ProtectedRouteWithLayout exact path="/account/edit" component={EditAccount} /> <ProtectedRouteWithLayout exact path={ROUTES.account} component={EditAccount} />
{user.role === 'SuperUser' && ( {user?.roles?.[0] === 'SuperUser' && (
<ProtectedRouteWithLayout exact path="/accounts" component={Accounts} /> <ProtectedRouteWithLayout exact path={ROUTES.users} component={Accounts} />
)} )}
<ProtectedRouteWithLayout component={GenericNotFound} />
</Switch> </Switch>
</ThemeProvider> </ThemeProvider>
</UserProvider> </UserProvider>

View File

@@ -10,7 +10,7 @@ const GET_USER = gql`
getUser(id: $id) { getUser(id: $id) {
id id
username username
role roles
customerId customerId
lastModifiedTimestamp lastModifiedTimestamp
} }
@@ -22,7 +22,7 @@ const UPDATE_USER = gql`
$id: ID! $id: ID!
$username: String! $username: String!
$password: String! $password: String!
$role: String! $roles: [String]
$customerId: ID! $customerId: ID!
$lastModifiedTimestamp: String $lastModifiedTimestamp: String
) { ) {
@@ -30,13 +30,13 @@ const UPDATE_USER = gql`
id: $id id: $id
username: $username username: $username
password: $password password: $password
role: $role roles: $roles
customerId: $customerId customerId: $customerId
lastModifiedTimestamp: $lastModifiedTimestamp lastModifiedTimestamp: $lastModifiedTimestamp
) { ) {
id id
username username
role roles
customerId customerId
lastModifiedTimestamp lastModifiedTimestamp
} }
@@ -49,14 +49,14 @@ const EditAccount = () => {
const [updateUser] = useMutation(UPDATE_USER); const [updateUser] = useMutation(UPDATE_USER);
const handleSubmit = newPassword => { const handleSubmit = newPassword => {
const { role, customerId, lastModifiedTimestamp } = data.getUser; const { roles, customerId, lastModifiedTimestamp } = data.getUser;
updateUser({ updateUser({
variables: { variables: {
id, id,
username: email, username: email,
password: newPassword, password: newPassword,
role, roles,
customerId, customerId,
lastModifiedTimestamp, lastModifiedTimestamp,
}, },

View File

@@ -6,14 +6,14 @@ import { AppLayout as Layout } from '@tip-wlan/wlan-cloud-ui-library';
import { GET_ALARM_COUNT } from 'graphql/queries'; import { GET_ALARM_COUNT } from 'graphql/queries';
import { AUTH_TOKEN } from 'constants/index'; import { AUTH_TOKEN, ROUTES } from 'constants/index';
import { removeItem } from 'utils/localStorage'; import { removeItem } from 'utils/localStorage';
import UserContext from 'contexts/UserContext'; import UserContext from 'contexts/UserContext';
const MasterLayout = ({ children }) => { const MasterLayout = ({ children }) => {
const { role, customerId } = useContext(UserContext); const { roles, customerId } = useContext(UserContext);
const client = useApolloClient(); const client = useApolloClient();
const location = useLocation(); const location = useLocation();
@@ -30,75 +30,56 @@ const MasterLayout = ({ children }) => {
const menuItems = [ const menuItems = [
{ {
key: 'dashboard', key: 'dashboard',
path: '/dashboard', path: ROUTES.dashboard,
text: 'Dashboard', text: 'Dashboard',
}, },
{ {
key: 'network', key: 'network',
path: '/network', path: ROUTES.network,
text: 'Network', text: 'Network',
}, },
{ {
key: 'profiles', key: 'profiles',
path: '/profiles', path: ROUTES.profiles,
text: 'Profiles', text: 'Profiles',
}, },
{ {
key: 'system', key: 'system',
path: '/system', path: ROUTES.system,
text: 'System', text: 'System',
}, },
]; ];
const mobileMenuItems = [ const mobileMenuItems = [
{ ...menuItems,
key: 'dashboard',
path: '/dashboard',
text: 'Dashboard',
},
{
key: 'network',
path: '/network',
text: 'Network',
},
{
key: 'profiles',
path: '/profiles',
text: 'Profiles',
},
{
key: 'system',
path: '/system',
text: 'System',
},
{ {
key: 'settings', key: 'settings',
text: 'Settings', text: 'Settings',
children: [ children: [
{ {
key: 'editAccount', key: 'editAccount',
path: '/account/edit', path: ROUTES.account,
text: 'Edit Account', text: 'Edit Account',
}, },
{ {
key: 'logout', key: 'logout',
path: '/', path: ROUTES.root,
text: 'Log Out', text: 'Log Out',
}, },
], ],
}, },
]; ];
if (role === 'SuperUser') { if (roles?.[0] === 'SuperUser') {
menuItems.push({ menuItems.push({
key: 'accounts', key: 'users',
path: '/accounts', path: ROUTES.users,
text: 'Accounts', text: 'Users',
}); });
mobileMenuItems.push({ mobileMenuItems.push({
key: 'accounts', key: 'users',
path: '/accounts', path: ROUTES.users,
text: 'Accounts', text: 'Users',
}); });
} }

View File

@@ -6,6 +6,7 @@ import { notification } from 'antd';
import { floor, padStart } from 'lodash'; import { floor, padStart } from 'lodash';
import { NetworkTableContainer } from '@tip-wlan/wlan-cloud-ui-library'; import { NetworkTableContainer } from '@tip-wlan/wlan-cloud-ui-library';
import { ROUTES } from 'constants/index';
import UserContext from 'contexts/UserContext'; import UserContext from 'contexts/UserContext';
import { FILTER_EQUIPMENT } from 'graphql/queries'; import { FILTER_EQUIPMENT } from 'graphql/queries';
@@ -165,7 +166,7 @@ const AccessPoints = ({ checkedLocations }) => {
return ( return (
<NetworkTableContainer <NetworkTableContainer
activeTab="/network/access-points" activeTab={ROUTES.accessPoints}
onRefresh={handleOnRefresh} onRefresh={handleOnRefresh}
tableColumns={accessPointsTableColumns} tableColumns={accessPointsTableColumns}
tableData={equipData && equipData.filterEquipment && equipData.filterEquipment.items} tableData={equipData && equipData.filterEquipment && equipData.filterEquipment.items}

View File

@@ -5,6 +5,7 @@ import { notification } from 'antd';
import { NetworkTableContainer } from '@tip-wlan/wlan-cloud-ui-library'; import { NetworkTableContainer } from '@tip-wlan/wlan-cloud-ui-library';
import { ROUTES } from 'constants/index';
import UserContext from 'contexts/UserContext'; import UserContext from 'contexts/UserContext';
import { FILTER_CLIENT_SESSIONS } from 'graphql/queries'; import { FILTER_CLIENT_SESSIONS } from 'graphql/queries';
@@ -96,7 +97,7 @@ const ClientDevices = ({ checkedLocations }) => {
return ( return (
<NetworkTableContainer <NetworkTableContainer
activeTab="/network/client-devices" activeTab={ROUTES.clientDevices}
tableColumns={clientDevicesTableColumns} tableColumns={clientDevicesTableColumns}
tableData={data?.filterClientSessions?.items} tableData={data?.filterClientSessions?.items}
onLoadMore={handleLoadMore} onLoadMore={handleLoadMore}

View File

@@ -4,6 +4,7 @@ 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 } 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 { FILE_UPLOAD } from 'graphql/mutations'; import { FILE_UPLOAD } from 'graphql/mutations';
@@ -115,6 +116,10 @@ const ProfileDetails = () => {
} }
); );
const { data: rfProfiles, fetchMore: fetchMoreRfProfiles } = useQuery(GET_ALL_PROFILES(), {
variables: { customerId, type: 'rf' },
});
const [updateProfile] = useMutation(UPDATE_PROFILE); const [updateProfile] = useMutation(UPDATE_PROFILE);
const [deleteProfile] = useMutation(DELETE_PROFILE); const [deleteProfile] = useMutation(DELETE_PROFILE);
@@ -252,6 +257,24 @@ const ProfileDetails = () => {
return true; 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 => { const handleFetchOperatorProfiles = e => {
if (operatorProfiles.getAllProfiles.context.lastPage) { if (operatorProfiles.getAllProfiles.context.lastPage) {
return false; return false;
@@ -299,7 +322,7 @@ const ProfileDetails = () => {
} }
if (redirect) { if (redirect) {
return <Redirect to="/profiles" />; return <Redirect to={ROUTES.profiles} />;
} }
return ( return (
@@ -307,13 +330,12 @@ const ProfileDetails = () => {
name={data.getProfile.name} name={data.getProfile.name}
profileType={data.getProfile.profileType} profileType={data.getProfile.profileType}
details={data.getProfile.details} details={data.getProfile.details}
childProfileIds={data.getProfile.childProfileIds}
childProfiles={data.getProfile.childProfiles} childProfiles={data.getProfile.childProfiles}
childProfileIds={data.getProfile.childProfileIds}
onDeleteProfile={handleDeleteProfile} onDeleteProfile={handleDeleteProfile}
onUpdateProfile={handleUpdateProfile} onUpdateProfile={handleUpdateProfile}
ssidProfiles={ ssidProfiles={ssidProfiles?.getAllProfiles?.items}
(ssidProfiles && ssidProfiles.getAllProfiles && ssidProfiles.getAllProfiles.items) || [] rfProfiles={rfProfiles?.getAllProfiles?.items}
}
radiusProfiles={radiusProfiles?.getAllProfiles?.items} radiusProfiles={radiusProfiles?.getAllProfiles?.items}
captiveProfiles={captiveProfiles?.getAllProfiles?.items} captiveProfiles={captiveProfiles?.getAllProfiles?.items}
venueProfiles={venueProfiles?.getAllProfiles?.items} venueProfiles={venueProfiles?.getAllProfiles?.items}
@@ -321,6 +343,7 @@ const ProfileDetails = () => {
idProviderProfiles={idProviderProfiles?.getAllProfiles?.items} idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
fileUpload={handleFileUpload} fileUpload={handleFileUpload}
onFetchMoreProfiles={handleFetchProfiles} onFetchMoreProfiles={handleFetchProfiles}
onFetchMoreRfProfiles={handleFetchRfProfiles}
onFetchMoreRadiusProfiles={handleFetchRadiusProfiles} onFetchMoreRadiusProfiles={handleFetchRadiusProfiles}
onFetchMoreCaptiveProfiles={handleFetchCaptiveProfiles} onFetchMoreCaptiveProfiles={handleFetchCaptiveProfiles}
onFetchMoreVenueProfiles={handleFetchVenueProfiles} onFetchMoreVenueProfiles={handleFetchVenueProfiles}

View File

@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import UserContext from 'contexts/UserContext'; import UserContext from 'contexts/UserContext';
const UserProvider = ({ children, id, email, role, customerId, updateUser, updateToken }) => ( const UserProvider = ({ children, id, email, roles, customerId, updateUser, updateToken }) => (
<UserContext.Provider value={{ id, email, role, customerId, updateUser, updateToken }}> <UserContext.Provider value={{ id, email, roles, customerId, updateUser, updateToken }}>
{children} {children}
</UserContext.Provider> </UserContext.Provider>
); );
@@ -15,14 +15,14 @@ UserProvider.propTypes = {
updateToken: PropTypes.func.isRequired, updateToken: PropTypes.func.isRequired,
id: PropTypes.number, id: PropTypes.number,
email: PropTypes.string, email: PropTypes.string,
role: PropTypes.string, roles: PropTypes.instanceOf(Array),
customerId: PropTypes.number, customerId: PropTypes.number,
}; };
UserProvider.defaultProps = { UserProvider.defaultProps = {
id: null, id: null,
email: null, email: null,
role: null, roles: [],
customerId: null, customerId: null,
}; };

14757
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "wlan-cloud-ui", "name": "wlan-cloud-ui",
"version": "0.5.4", "version": "0.7.1",
"author": "ConnectUs", "author": "ConnectUs",
"description": "React Portal", "description": "React Portal",
"engines": { "engines": {
@@ -10,7 +10,7 @@
"scripts": { "scripts": {
"test": "jest --passWithNoTests --coverage", "test": "jest --passWithNoTests --coverage",
"start": "cross-env NODE_ENV=development webpack-dev-server", "start": "cross-env NODE_ENV=development webpack-dev-server",
"start:bare": "cross-env API=https://wlan-graphql.zone3.lab.connectus.ai NODE_ENV=bare 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: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}'",
@@ -21,7 +21,7 @@
"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": "^0.3.19", "@tip-wlan/wlan-cloud-ui-library": "^0.6.3",
"antd": "^4.5.2", "antd": "^4.5.2",
"apollo-upload-client": "^13.0.0", "apollo-upload-client": "^13.0.0",
"clean-webpack-plugin": "^3.0.0", "clean-webpack-plugin": "^3.0.0",
@@ -75,7 +75,6 @@
"lint-staged": "^10.0.8", "lint-staged": "^10.0.8",
"node-sass": "^4.13.1", "node-sass": "^4.13.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"pretty-quick": "^2.0.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",
@@ -84,22 +83,20 @@
"webpack-dev-server": "^3.11.0", "webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2" "webpack-merge": "^4.2.2"
}, },
"precommit": "NODE_ENV=production lint-staged",
"browserslist": [ "browserslist": [
"last 2 versions", "last 2 versions",
"> 1%", "> 1%",
"IE 10" "IE 10"
], ],
"lint-staged": {
"*.{js,jsx}": [
"pretty-quick --staged",
"eslint --fix 'app/**/*.js' --max-warnings=0",
"git add"
]
},
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": "lint-staged"
} }
},
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix 'app/**/*.js' --max-warnings=0",
"prettier --write"
]
} }
} }