Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fe only #3

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c78c6cd
Refactored refresh from server, fixed bug stacking interval callbacks
Jordan-M-Schultz Jan 11, 2024
0972870
Added predis package, created test page
Jordan-M-Schultz Feb 1, 2024
1f7a30c
add notification cache factory.
ihabzee Feb 1, 2024
aefd53d
add notification cache factory.
ihabzee Feb 2, 2024
ff80442
change logic
ihabzee Feb 2, 2024
8398f48
Added predis to CacheInterface, test page
Jordan-M-Schultz Feb 2, 2024
8245700
add generate key method.
ihabzee Feb 2, 2024
29fdf7c
Merge branch 'redis_config' of github.com:susom/redcap_notifications …
ihabzee Feb 2, 2024
7b8fbb8
Cleaned up factory, removed unnecessary variables
Jordan-M-Schultz Feb 2, 2024
cf68743
Added setKeys and getKeys functions
Jordan-M-Schultz Feb 2, 2024
44ab197
Added setKeys and getKeys functions
Jordan-M-Schultz Feb 2, 2024
d5dc488
Added delete and list keys
Jordan-M-Schultz Feb 2, 2024
5abda92
Added function calls for key operations
Jordan-M-Schultz Feb 2, 2024
3a22800
Merge branch 'redis_config' of https://github.com/susom/redcap_notifi…
Jordan-M-Schultz Feb 2, 2024
b1bca38
add few methods for cache keys.
ihabzee Feb 3, 2024
6327227
Removed extraneous pages from config
Jordan-M-Schultz Feb 5, 2024
bf65e6b
add new method to pull notifications.
ihabzee Feb 7, 2024
ce4ddec
commit config.json
ihabzee Feb 7, 2024
3c84e59
implement getNotifications method.
ihabzee Feb 8, 2024
e4f7137
fix datatype error.
ihabzee Feb 9, 2024
1fb17dc
add notification dismissal
ihabzee Feb 9, 2024
a3a1a3f
merge from redis_config
irvins Feb 13, 2024
de32c98
merging ui and api changes
Jordan-M-Schultz Feb 13, 2024
c1dc013
removing uneccesary files
irvins Feb 13, 2024
8d700bf
woops forgot to remove the include line
irvins Feb 13, 2024
ccb6cf9
remove cache from config.json
ihabzee Feb 13, 2024
2e39461
clean config.json
ihabzee Feb 13, 2024
507041a
Retooling javascript to work with new backend
Jordan-M-Schultz Feb 13, 2024
d440e99
Retooling javascript to work with new backend x2
Jordan-M-Schultz Feb 13, 2024
774ed95
adjusting the dimsiss_notif and cleaning up some client side functio…
irvins Feb 13, 2024
6d98540
fix minor bug in dismiss endpoint.
ihabzee Feb 13, 2024
e57ee96
removing unecceary dismiss checks and carrying over snooze_expire
irvins Feb 16, 2024
a7fc427
rmeoiveng a debug line and using the callAjax2 method
irvins Feb 16, 2024
07d6b00
added a default value for snooze_expire
irvins Feb 16, 2024
24f354d
add mysql lock to prevent duplicate user dismiss key.
ihabzee Feb 16, 2024
5bd44ff
dismiss all ajax was firing too quick , so added small delay...now it…
irvins Feb 17, 2024
d49485d
t Merge branch 'fe_only' of github.com:susom/redcap_notifications int…
irvins Feb 17, 2024
6c39824
hide dismiss_all button if no notifs are dismisssable after an actio…
irvins Feb 21, 2024
2115dec
adding css so that the modal will grow only up to a fixed height, an…
irvins Feb 21, 2024
ac8b896
fixing CSS for home / survey page display , and adding height limit …
irvins Feb 21, 2024
a62e4bb
fix html component.
ihabzee Feb 26, 2024
f0eefd0
Merge branch 'fe_only' of github.com:susom/redcap_notifications into …
ihabzee Feb 26, 2024
7c970f0
putting all of them into the same container so the maximum expansion…
irvins Feb 26, 2024
7c1f461
Merge branch 'fe_only' of github.com:susom/redcap_notifications into …
irvins Feb 26, 2024
98e665c
when notification is loaded log that it has been viewed.
ihabzee Mar 21, 2024
ab4657e
updating the skull and crossboanes default danger icon
irvins Apr 30, 2024
b0b1d46
Merge branch 'fe_only' of github.com:susom/redcap_notifications into …
ihabzee May 1, 2024
baca386
change get project id to return array of pids instead of one.
ihabzee May 1, 2024
b8e3028
add unit tests
ihabzee May 6, 2024
6d22e8a
do not create notification viewed log if no notification exists.
ihabzee May 7, 2024
71022b5
fix minor php errors.
ihabzee Aug 1, 2024
35960ae
fix for notifications project status.
ihabzee Sep 4, 2024
ddf14ef
new update project status EM to automatically update project status …
ihabzee Sep 4, 2024
69ab909
update log message.
ihabzee Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

# Emacs backup files
*~

/vendor/
468 changes: 193 additions & 275 deletions RedcapNotifications.php

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions assets/scripts/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Notification {
default_icon = {
"info": `<i class="fas fa-info-circle"></i>`,
"warning": `<i class="fas fa-exclamation-triangle"></i>`,
"danger": `<i class="fas fa-skull-crossbones"></i>`
"danger": `<i class="fas fa-ban"></i>`
}

constructor(notif, parent){
Expand All @@ -57,7 +57,7 @@ class Notification {
notif_jq.find(".notif_bdy .headline").text(this.getSubject());

if(this.getMessage()){
notif_jq.find(".notif_bdy .lead").text(this.getMessage());
notif_jq.find(".notif_bdy .lead").html(this.getMessage());
}else{
notif_jq.find(".notif_bdy .lead").remove();
}
Expand Down Expand Up @@ -92,18 +92,15 @@ class Notification {
}

dismissNotif(){
this.setDismissed();

let data = {
"record_id": this.notif.record_id,
"note_name": this.notif.note_name,
"note_username": this.parent.user
};

this.parent.dismissNotif(data);
let _this = this;

//UPDATE UI
this.setDismissed();
this.domjq.fadeOut("fast", function(){
$(this).remove();

//CALL PARENT FUNCTION TO SEND TO SERVER
_this.parent.dismissNotif(_this.notif.key);
});
}

Expand Down Expand Up @@ -140,13 +137,15 @@ class Notification {
//NEED TO CHECK CURRENT PAGE CONTEXT TO DETERMINE IF NOTIFS SHOULD DISPLAY (PROJECT, SURVEY, or SYSTEM)
if( page_project_id && this.isProjectNotif() && !this.isExcluded() && this.isCorrectProjectStatus() ){
//project notif, page is in project context
if(page_project_id == this.getProjId() || this.getProjId() == ""){


if(this.getProjIds().includes(page_project_id) || this.getProjIds().length == 0){
//project notif, specified project id = current projoect context
return true;
}
}else if( this.isSurveyNotif() && this.parent.getCurPage() == "surveys/index.php" ){
const global_var_pid = pid; //UGH
if(this.getProjId() == global_var_pid){
if(this.getProjIds().includes(global_var_pid)){
return true;
}
}else if( this.isSystemNotif() && !page_project_id){
Expand Down Expand Up @@ -176,8 +175,8 @@ class Notification {
getEndDate(){
return this.notif.note_end_dt;
}
getProjId(){
return this.notif.note_project_id;
getProjIds(){
return this.notif.note_project_id.split(",");
}
getName(){
return this.notif.note_name;
Expand Down Expand Up @@ -232,7 +231,8 @@ class Notification {
let dev_prod_status = this.parent.getDevProdStatus();
let notif_dev_prod = this.notif["project_status"] == "" ? null : parseInt(this.notif["project_status"]);

if( dev_prod_status ){
if(notif_dev_prod != null){
if( dev_prod_status == "1"){
//PROD, ONLY
if(!notif_dev_prod){
return false;
Expand All @@ -244,6 +244,8 @@ class Notification {
return false;
}
}
}


//let it pass!
return true;
Expand Down
Loading