License updated to GPLv3

🧲 New features
Custom user role permissions
Employee edit form updated
Employee daily task list
Attendance and employee distribution charts on dashboard
Improvements to company structure and company assets module
Improved tables for displaying data in several modules
Faster data loading (specially for employee module)
Initials based profile pictures
Re-designed login page
Re-designed user profile page
Improvements to filtering
New REST endpoints for employee qualifications

🐛 Bug fixes
Fixed, issue with managers being able to create performance reviews for employees who are not their direct reports
Fixed, issues related to using full profile image instead of using smaller version of profile image
Changing third gender to other
Improvements and fixes for internal frontend data caching
This commit is contained in:
Thilina Pituwala
2020-10-31 19:02:37 +01:00
parent 86b8345505
commit b1df0037db
29343 changed files with 867614 additions and 2191082 deletions

View File

@@ -7,7 +7,39 @@
* RequestCache
*/
class MemoryStorage {
constructor() {
this.data = {};
}
getItem(key) {
return this.data[key];
}
setItem(key, data) {
this.data[key] = data;
}
removeAllByPrefix(prefix) {
const keys = Object.keys(this.data);
for (let i = 0; i < keys.length; i++) {
if (keys[i].indexOf(prefix) > 0) {
delete this.data[keys[i]];
}
}
}
}
class RequestCache {
constructor(storage) {
if (!storage) {
this.storage = new MemoryStorage();
} else {
this.storage = storage;
}
}
getKey(url, params) {
let key = `${url}|`;
for (const index in params) {
@@ -16,53 +48,39 @@ class RequestCache {
return key;
}
/*
invalidateTable(table) {
let key;
for (let i = 0; i < localStorage.length; i++) {
key = localStorage.key(i);
for (let i = 0; i < this.storage.length; i++) {
key = this.storage.key(i);
if (key.indexOf(`t=${table}`) > 0) {
localStorage.removeItem(key);
this.storage.removeItem(key);
}
}
}
*/
invalidateTable(table) {
this.storage.removeAllByPrefix(`t=${table}`);
}
getData(key) {
let data;
if (typeof (Storage) === 'undefined') {
const data = this.storage.getItem(key);
if (!data) {
return null;
}
const strData = localStorage.getItem(key);
if (strData !== undefined && strData != null && strData !== '') {
data = JSON.parse(strData);
if (data === undefined || data == null) {
return null;
}
if (data.status !== undefined && data.status != null && data.status !== 'SUCCESS') {
return null;
}
return data;
}
return null;
return data;
}
setData(key, data) {
if (typeof (Storage) === 'undefined') {
return null;
}
if (data.status !== undefined && data.status != null && data.status !== 'SUCCESS') {
return null;
}
const strData = JSON.stringify(data);
localStorage.setItem(key, strData);
return strData;
this.storage.setItem(key, data);
return data;
}
}