diff --git a/package.json b/package.json
index 034f855..2efb726 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ucentral-client",
- "version": "2.0.5",
+ "version": "2.0.6",
"dependencies": {
"@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1",
@@ -23,7 +23,7 @@
"react-tooltip": "^4.2.21",
"react-widgets": "^5.1.1",
"sass": "^1.35.1",
- "ucentral-libs": "^0.8.45",
+ "ucentral-libs": "^0.8.46",
"uuid": "^8.3.2"
},
"main": "index.js",
diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json
index e47b27d..d49e621 100644
--- a/public/locales/de/translation.json
+++ b/public/locales/de/translation.json
@@ -353,6 +353,7 @@
"validated": "Bestätigt"
},
"wifi_analysis": {
+ "association": "Verband",
"associations": "Verbände",
"mode": "Modus",
"radios": "Radios",
diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json
index b41b004..7fa0bdd 100644
--- a/public/locales/en/translation.json
+++ b/public/locales/en/translation.json
@@ -353,6 +353,7 @@
"validated": "Validated"
},
"wifi_analysis": {
+ "association": "Association",
"associations": "Associations",
"mode": "Mode",
"radios": "Radios",
diff --git a/public/locales/es/translation.json b/public/locales/es/translation.json
index 688542a..25c7a29 100644
--- a/public/locales/es/translation.json
+++ b/public/locales/es/translation.json
@@ -353,6 +353,7 @@
"validated": "Validado"
},
"wifi_analysis": {
+ "association": "Asociación",
"associations": "Asociaciones",
"mode": "Modo",
"radios": "Radios",
diff --git a/public/locales/fr/translation.json b/public/locales/fr/translation.json
index 5a43577..e9d46cd 100644
--- a/public/locales/fr/translation.json
+++ b/public/locales/fr/translation.json
@@ -353,6 +353,7 @@
"validated": "Validé"
},
"wifi_analysis": {
+ "association": "Association",
"associations": "Les associations",
"mode": "Mode",
"radios": "Radios",
diff --git a/public/locales/pt/translation.json b/public/locales/pt/translation.json
index 43a38c5..ea47a91 100644
--- a/public/locales/pt/translation.json
+++ b/public/locales/pt/translation.json
@@ -353,6 +353,7 @@
"validated": "Validado"
},
"wifi_analysis": {
+ "association": "Associação",
"associations": "Associações",
"mode": "Modo",
"radios": "Rádios",
diff --git a/src/components/DeviceConfiguration/index.js b/src/components/DeviceConfiguration/index.js
index b9942a9..3645859 100644
--- a/src/components/DeviceConfiguration/index.js
+++ b/src/components/DeviceConfiguration/index.js
@@ -18,8 +18,7 @@ import { prettyDate } from 'utils/helper';
import axiosInstance from 'utils/axiosInstance';
import { useAuth } from 'contexts/AuthProvider';
import { useDevice } from 'contexts/DeviceProvider';
-import CopyToClipboardButton from 'components/CopyToClipboardButton';
-import { NotesTable } from 'ucentral-libs';
+import { CopyToClipboardButton, NotesTable } from 'ucentral-libs';
import DeviceConfigurationModal from './DeviceConfigurationModal';
import styles from './index.module.scss';
@@ -127,7 +126,7 @@ const DeviceConfiguration = () => {
{device.serialNumber}
-
+
@@ -169,6 +168,7 @@ const DeviceConfiguration = () => {
{device.devicePassword === '' ? 'openwifi' : device.devicePassword}
diff --git a/src/layout/index.js b/src/layout/index.js
index 62b42c2..1799708 100644
--- a/src/layout/index.js
+++ b/src/layout/index.js
@@ -89,7 +89,7 @@ const TheLayout = () => {
-
+
);
diff --git a/src/pages/ProfilePage/index.js b/src/pages/ProfilePage/index.js
index bde9df0..727ee43 100644
--- a/src/pages/ProfilePage/index.js
+++ b/src/pages/ProfilePage/index.js
@@ -51,6 +51,7 @@ const ProfilePage = () => {
const [userForm, updateWithId, updateWithKey, setUser] = useUser(initialState);
const [newAvatar, setNewAvatar] = useState('');
const [newAvatarFile, setNewAvatarFile] = useState(null);
+ const [fileInputKey, setFileInputKey] = useState(0);
const [toast, setToast] = useState({
show: false,
success: true,
@@ -100,7 +101,37 @@ const ProfilePage = () => {
.catch(() => {});
};
+ const uploadAvatar = () => {
+ const options = {
+ headers: {
+ Accept: 'application/json',
+ Authorization: `Bearer ${currentToken}`,
+ },
+ };
+
+ const data = new FormData();
+ data.append('file', newAvatarFile);
+
+ axiosInstance
+ .post(`${endpoints.ucentralsec}/api/v1/avatar/${user.Id}`, data, options)
+ .then(() => {
+ setToast({
+ success: true,
+ show: true,
+ });
+ getAvatar();
+ setNewAvatar('');
+ setNewAvatarFile(null);
+ setFileInputKey(fileInputKey + 1);
+ })
+ .catch(() => {});
+ };
+
const updateUser = () => {
+ setToast({
+ success: true,
+ show: false,
+ });
setLoading(true);
const parameters = {
@@ -126,6 +157,10 @@ const ProfilePage = () => {
}
}
+ if (newAvatarFile !== null) {
+ uploadAvatar();
+ }
+
if (newData) {
const options = {
headers: {
@@ -184,38 +219,6 @@ const ProfilePage = () => {
});
};
- const uploadAvatar = () => {
- setLoading(true);
- const options = {
- headers: {
- Accept: 'application/json',
- Authorization: `Bearer ${currentToken}`,
- },
- };
-
- const data = new FormData();
- data.append('file', newAvatarFile);
-
- axiosInstance
- .post(`${endpoints.ucentralsec}/api/v1/avatar/${user.Id}`, data, options)
- .then(() => {
- setToast({
- success: true,
- show: true,
- });
- getAvatar();
- })
- .catch(() => {
- setToast({
- success: false,
- show: true,
- });
- })
- .finally(() => {
- setLoading(false);
- });
- };
-
const showPreview = (e) => {
const imageFile = e.target.files[0];
setNewAvatar(URL.createObjectURL(imageFile));
@@ -263,11 +266,11 @@ const ProfilePage = () => {
loading={loading}
policies={policies}
addNote={addNote}
- uploadAvatar={uploadAvatar}
avatar={avatar}
newAvatar={newAvatar}
showPreview={showPreview}
deleteAvatar={deleteAvatar}
+ fileInputKey={fileInputKey}
/>
diff --git a/src/scss/_custom.scss b/src/scss/_custom.scss
index 358ba7d..7621b8c 100644
--- a/src/scss/_custom.scss
+++ b/src/scss/_custom.scss
@@ -25,5 +25,8 @@ pre.ignore {
overflow: unset !important;
}
-.tooltip { &::after { left: 25% !important; } }
-.tooltip { &::before { left: 25% !important; } }
+.tooltipLeft { &::after { left: 25% !important; } }
+.tooltipLeft { &::before { left: 25% !important; } }
+
+.tooltipRight { &::after { left: 75% !important; } }
+.tooltipRight { &::before { left: 75% !important; } }