mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-11-03 04:08:08 +00:00
Compare commits
25 Commits
v1.1.0-rc3
...
release/v1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a952a40eb5 | ||
|
|
6c0e5f959d | ||
|
|
4450a01397 | ||
|
|
5d3192e314 | ||
|
|
7ccebb107a | ||
|
|
42eaa86893 | ||
|
|
48f6a64790 | ||
|
|
879c97f44d | ||
|
|
01599ca670 | ||
|
|
1be788925e | ||
|
|
3697d0b4a9 | ||
|
|
a9655e25aa | ||
|
|
6bd8beb436 | ||
|
|
e023ef0569 | ||
|
|
8d93cf4f73 | ||
|
|
87b056967f | ||
|
|
d6d207c058 | ||
|
|
0017541d82 | ||
|
|
eab3476dbe | ||
|
|
ff5b6dc1fc | ||
|
|
40033efb61 | ||
|
|
516fb50817 | ||
|
|
4449465edc | ||
|
|
57f91633c2 | ||
|
|
aa559971d8 |
4
.github/workflows/dockerpublish.yml
vendored
4
.github/workflows/dockerpublish.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
|||||||
[[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
|
[[ "${{ 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=1.2.0-SNAPSHOT
|
||||||
|
|
||||||
TIMESTAMP=$(date +'%Y-%m-%d')
|
TIMESTAMP=$(date +'%Y-%m-%d')
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ jobs:
|
|||||||
[[ "${{ github.ref }}" == "refs/heads/release/"* ]] && VERSION=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\/release\/[v]//' | awk '{print $1"-SNAPSHOT"}')
|
[[ "${{ 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=1.2.0-SNAPSHOT
|
||||||
|
|
||||||
echo IMAGE_ID=$IMAGE_ID
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
echo VERSION=$VERSION
|
echo VERSION=$VERSION
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ export const COMPANY = 'Telecom Infra Project';
|
|||||||
|
|
||||||
export const USER_FRIENDLY_RADIOS = {
|
export const USER_FRIENDLY_RADIOS = {
|
||||||
is2dot4GHz: '2.4GHz',
|
is2dot4GHz: '2.4GHz',
|
||||||
|
is5GHz: '5GHz',
|
||||||
is5GHzL: '5GHz (L)',
|
is5GHzL: '5GHz (L)',
|
||||||
is5GHzU: '5GHz (U)',
|
is5GHzU: '5GHz (U)',
|
||||||
is5GHz: '5GHz',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ROUTES = {
|
export const ROUTES = {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ const Accounts = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreateUser = (email, password, roles) => {
|
const handleCreateUser = ({ email, password, roles }) => {
|
||||||
createUser({
|
createUser({
|
||||||
variables: {
|
variables: {
|
||||||
username: email,
|
username: email,
|
||||||
@@ -119,7 +119,7 @@ const Accounts = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditUser = (id, email, password, roles, lastModifiedTimestamp) => {
|
const handleEditUser = ({ id, email, password, roles, lastModifiedTimestamp }) => {
|
||||||
updateUser({
|
updateUser({
|
||||||
variables: {
|
variables: {
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ 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 { ROUTES, AUTH_TOKEN } from 'constants/index';
|
||||||
import UserContext from 'contexts/UserContext';
|
import UserContext from 'contexts/UserContext';
|
||||||
import { GET_ALL_PROFILES } from 'graphql/queries';
|
import { GET_ALL_PROFILES, GET_API_URL } from 'graphql/queries';
|
||||||
import { fetchMoreProfiles } from 'graphql/functions';
|
import { fetchMoreProfiles } from 'graphql/functions';
|
||||||
|
import { getItem } from 'utils/localStorage';
|
||||||
|
|
||||||
const CREATE_PROFILE = gql`
|
const CREATE_PROFILE = gql`
|
||||||
mutation CreateProfile(
|
mutation CreateProfile(
|
||||||
@@ -35,6 +36,9 @@ const CREATE_PROFILE = gql`
|
|||||||
|
|
||||||
const AddProfile = () => {
|
const AddProfile = () => {
|
||||||
const { customerId } = useContext(UserContext);
|
const { customerId } = useContext(UserContext);
|
||||||
|
|
||||||
|
const { data: apiUrl } = useQuery(GET_API_URL);
|
||||||
|
|
||||||
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',
|
fetchPolicy: 'network-only',
|
||||||
@@ -116,6 +120,46 @@ const AddProfile = () => {
|
|||||||
else fetchMoreProfiles(e, ssidProfiles, fetchMore);
|
else fetchMoreProfiles(e, ssidProfiles, fetchMore);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleFileUpload = async (fileName, file) => {
|
||||||
|
const token = getItem(AUTH_TOKEN);
|
||||||
|
|
||||||
|
if (apiUrl?.getApiUrl) {
|
||||||
|
fetch(`${apiUrl?.getApiUrl}filestore/${fileName}`, {
|
||||||
|
method: 'POST',
|
||||||
|
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({
|
||||||
|
message: 'Error',
|
||||||
|
description: 'File could not be uploaded.',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AddProfilePage
|
<AddProfilePage
|
||||||
onCreateProfile={handleAddProfile}
|
onCreateProfile={handleAddProfile}
|
||||||
@@ -127,6 +171,7 @@ const AddProfile = () => {
|
|||||||
idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
|
idProviderProfiles={idProviderProfiles?.getAllProfiles?.items}
|
||||||
rfProfiles={rfProfiles?.getAllProfiles?.items}
|
rfProfiles={rfProfiles?.getAllProfiles?.items}
|
||||||
onFetchMoreProfiles={handleFetchMoreProfiles}
|
onFetchMoreProfiles={handleFetchMoreProfiles}
|
||||||
|
fileUpload={handleFileUpload}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ const App = () => {
|
|||||||
<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={ROUTES.login} component={Login} />
|
<UnauthenticatedRoute exact path={ROUTES.login} component={Login} />
|
||||||
<ProtectedRouteWithLayout exact path={ROUTES.root} component={RedirectToDashboard} />
|
<ProtectedRouteWithLayout exact path={ROUTES.root} component={RedirectToDashboard} />
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { RolesProvider } from '@tip-wlan/wlan-cloud-ui-library';
|
||||||
|
|
||||||
import UserContext from 'contexts/UserContext';
|
import UserContext from 'contexts/UserContext';
|
||||||
|
|
||||||
const UserProvider = ({ children, id, email, roles, customerId, updateUser, updateToken }) => (
|
const UserProvider = ({ children, id, email, roles, customerId, updateUser, updateToken }) => (
|
||||||
<UserContext.Provider value={{ id, email, roles, customerId, updateUser, updateToken }}>
|
<UserContext.Provider value={{ id, email, roles, customerId, updateUser, updateToken }}>
|
||||||
{children}
|
<RolesProvider role={roles}>{children}</RolesProvider>
|
||||||
</UserContext.Provider>
|
</UserContext.Provider>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { AUTH_TOKEN } from 'constants/index';
|
|||||||
import { REFRESH_TOKEN } from 'graphql/mutations';
|
import { REFRESH_TOKEN } from 'graphql/mutations';
|
||||||
import { getItem, setItem, removeItem } from 'utils/localStorage';
|
import { getItem, setItem, removeItem } from 'utils/localStorage';
|
||||||
import history from 'utils/history';
|
import history from 'utils/history';
|
||||||
|
import { ScrollToTop } from '@tip-wlan/wlan-cloud-ui-library';
|
||||||
|
|
||||||
const API_URI = process.env.NODE_ENV === 'production' ? window.REACT_APP_API : process.env.API;
|
const API_URI = process.env.NODE_ENV === 'production' ? window.REACT_APP_API : process.env.API;
|
||||||
const MOUNT_NODE = document.getElementById('root');
|
const MOUNT_NODE = document.getElementById('root');
|
||||||
@@ -102,6 +103,7 @@ const render = () => {
|
|||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Router history={history}>
|
<Router history={history}>
|
||||||
<ApolloProvider client={client}>
|
<ApolloProvider client={client}>
|
||||||
|
<ScrollToTop />
|
||||||
<App />
|
<App />
|
||||||
</ApolloProvider>
|
</ApolloProvider>
|
||||||
</Router>,
|
</Router>,
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
body {
|
body {
|
||||||
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input:-webkit-autofill,
|
||||||
|
input:-webkit-autofill:hover,
|
||||||
|
input:-webkit-autofill:focus,
|
||||||
|
input:-webkit-autofill:active,
|
||||||
|
input:-webkit-autofill::first-line {
|
||||||
|
-webkit-transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||||
|
transition: color 9999s ease-out, background-color 9999s ease-out;
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
|
||||||
|
}
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-ui",
|
"name": "wlan-cloud-ui",
|
||||||
"version": "1.1.8",
|
"version": "1.1.18",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2223,9 +2223,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@tip-wlan/wlan-cloud-ui-library": {
|
"@tip-wlan/wlan-cloud-ui-library": {
|
||||||
"version": "1.1.14",
|
"version": "1.1.27",
|
||||||
"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-1.1.14.tgz",
|
"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-1.1.27.tgz",
|
||||||
"integrity": "sha1-BRTU+IQ03oDQWJM5xGo+D+S49Kc="
|
"integrity": "sha1-riV+vGdlxZNNeMWunxrQ60NSAWw="
|
||||||
},
|
},
|
||||||
"@types/anymatch": {
|
"@types/anymatch": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wlan-cloud-ui",
|
"name": "wlan-cloud-ui",
|
||||||
"version": "1.1.8",
|
"version": "1.1.18",
|
||||||
"author": "ConnectUs",
|
"author": "ConnectUs",
|
||||||
"description": "React Portal",
|
"description": "React Portal",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -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": "^1.1.14",
|
"@tip-wlan/wlan-cloud-ui-library": "^1.1.27",
|
||||||
"antd": "^4.5.2",
|
"antd": "^4.5.2",
|
||||||
"apollo-upload-client": "^13.0.0",
|
"apollo-upload-client": "^13.0.0",
|
||||||
"graphql": "^15.5.0",
|
"graphql": "^15.5.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user