-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from sdslabs/ui-fixes
UI fixes
- Loading branch information
Showing
87 changed files
with
4,215 additions
and
14,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[] generate download link from a utils function | ||
|
||
[x] make no activity page | ||
[x] changes in sidebar | ||
[x] fonts and spacing changes |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
SWITCH_SUB_MENU, | ||
SWITCH_MAIN_MENU, | ||
SWITCH_TAB, | ||
SET_TABLE_DATA, | ||
RESET_ADMIN_MENU, | ||
TOGGLE_ADMIN_LOADER, | ||
} from 'constants/action-types'; | ||
|
||
export const SwitchMainMenu = (data) => ({ | ||
type: SWITCH_MAIN_MENU, | ||
payload: data, | ||
}); | ||
|
||
export const SwitchSubMenu = (data) => ({ | ||
type: SWITCH_SUB_MENU, | ||
payload: data, | ||
}); | ||
|
||
export const SwitchTab = (data) => ({ | ||
type: SWITCH_TAB, | ||
payload: data, | ||
}); | ||
|
||
export const SetTableData = (data) => ({ | ||
type: SET_TABLE_DATA, | ||
payload: data, | ||
}); | ||
|
||
export const ResetAdminMenu = () => ({ | ||
type: RESET_ADMIN_MENU, | ||
}); | ||
|
||
export const ToggleAdminLoader = (data) => ({ | ||
type: TOGGLE_ADMIN_LOADER, | ||
payload: data, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { axiosInstance } from './axiosInstance'; | ||
import { CONFIG } from 'config/config'; | ||
import $ from 'jquery'; | ||
|
||
function getCourseRequests(token) { | ||
return axiosInstance | ||
.get('/admin/courserequests/', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function approveCourseRequest(id, token) { | ||
return axiosInstance | ||
.put( | ||
'/admin/courserequests', | ||
{ request: id, status: 2 }, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}, | ||
) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function addCourse(id, token) { | ||
const status = 3; | ||
return $.ajax({ | ||
method: 'PUT', | ||
url: `${CONFIG.nexusRoot}/admin/courserequests`, | ||
data: { request: id, status: status }, | ||
dataType: 'json', | ||
beforeSend(xhr) { | ||
xhr.setRequestHeader('Authorization', `Bearer ${token}`); | ||
}, | ||
}).done((res) => { | ||
return res; | ||
}); | ||
} | ||
|
||
function rejectCourseRequest(id, token) { | ||
return axiosInstance | ||
.delete('/admin/courserequests', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
data: { | ||
request: id, | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
export { getCourseRequests, approveCourseRequest, addCourse, rejectCourseRequest }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { axiosInstance } from './axiosInstance'; | ||
import { CONFIG } from 'config/config'; | ||
import $ from 'jquery'; | ||
|
||
function getFileRequests(token) { | ||
return axiosInstance | ||
.get('/admin/filerequests/', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function approveFileRequest(id, token) { | ||
return axiosInstance | ||
.put( | ||
'/admin/filerequests', | ||
{ request: id, status: 2 }, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}, | ||
) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function uploadFile(id, file, name, filetype, token) { | ||
const status = 3; | ||
var formData = new FormData(); | ||
formData.append('request', id); | ||
formData.append('file', file, name); | ||
formData.append('name', name); | ||
formData.append('filetype', filetype); | ||
formData.append('status', status); | ||
return $.ajax({ | ||
method: 'PUT', | ||
url: `${CONFIG.nexusRoot}/admin/filerequests`, | ||
data: formData, | ||
processData: false, | ||
contentType: false, | ||
beforeSend(xhr) { | ||
xhr.setRequestHeader('Authorization', `Bearer ${token}`); | ||
}, | ||
}).done((res) => { | ||
return res; | ||
}); | ||
} | ||
|
||
function rejectFileRequest(id, token) { | ||
return axiosInstance | ||
.delete('/admin/filerequests/', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
data: { | ||
request: id, | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
export { getFileRequests, approveFileRequest, uploadFile, rejectFileRequest }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { axiosInstance } from './axiosInstance'; | ||
|
||
function getUploads(token) { | ||
return axiosInstance | ||
.get('/admin/uploads/', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function approveUpload(id, token) { | ||
return axiosInstance | ||
.put( | ||
'/admin/uploads', | ||
{ file_id: id, status: 2 }, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}, | ||
) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function addUpload(id, token) { | ||
return axiosInstance | ||
.put( | ||
'/admin/uploads', | ||
{ upload: id, status: 3 }, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
}, | ||
) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
function deleteUpload(id, token) { | ||
return axiosInstance | ||
.delete('/admin/uploads', { | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
'Content-Type': 'application/json', | ||
Accept: 'application/json', | ||
}, | ||
data: { | ||
upload: id, | ||
}, | ||
}) | ||
.then((response) => { | ||
const res = JSON.parse(response.request.response); | ||
return res; | ||
}) | ||
.catch((error) => { | ||
return Promise.reject(error); | ||
}); | ||
} | ||
|
||
export { getUploads, approveUpload, addUpload, deleteUpload }; |
Oops, something went wrong.