From 5bef1e2bbcb395f7af4408ffdaf3b26f71f816c6 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Thu, 8 Aug 2019 16:43:24 +0300 Subject: [PATCH] Fixed error alerts color --- app/views/console/account/index.phtml | 26 ++++++++++++++++-------- app/views/console/home/index.phtml | 9 +++++--- app/views/console/keys/index.phtml | 9 +++++--- app/views/console/settings/index.phtml | 16 ++++++++++----- app/views/console/tasks/index.phtml | 9 +++++--- app/views/console/users/index.phtml | 12 +++++++---- app/views/console/users/view.phtml | 14 +++++++++---- app/views/console/webhooks/index.phtml | 9 +++++--- app/views/home/auth/confirm.phtml | 3 ++- app/views/home/auth/join.phtml | 3 ++- app/views/home/auth/recovery.phtml | 3 ++- app/views/home/auth/recovery/reset.phtml | 3 ++- app/views/home/auth/signin.phtml | 3 ++- app/views/home/auth/signup.phtml | 3 ++- public/dist/scripts/app-all.js | 2 +- public/dist/scripts/app.js | 2 +- public/scripts/views/service.js | 4 ++-- 17 files changed, 87 insertions(+), 43 deletions(-) diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 6ec70fe6e8..ce0186321b 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -32,7 +32,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Your name was updated successfully" data-success-param-trigger-events="account.update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update your name"> + data-failure-param-alert-text="Failed to update your name" + data-failure-param-alert-classname="error"> @@ -60,7 +61,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Email address updated successfully" data-success-param-trigger-events="account-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed updating email address"> + data-failure-param-alert-text="Failed updating email address" + data-failure-param-alert-classname="error">
@@ -93,7 +95,8 @@ use Utopia\Locale\Locale; data-success-param-trigger-events="account-update,modal-close" data-success-param-alert-text="Password updated successfully" data-failure="alert" - data-failure-param-alert-text="Failed updating password"> + data-failure-param-alert-text="Failed updating password" + data-failure-param-alert-classname="error"> @@ -116,7 +119,9 @@ use Utopia\Locale\Locale; data-success="trigger" data-success-param-trigger-events="logout" data-failure="alert" - data-failure-param-alert-text="Logout failed"> + data-failure-param-alert-text="Logout failed" + data-failure-param-alert-classname="error"> +
@@ -156,7 +161,8 @@ use Utopia\Locale\Locale; data-success="trigger" data-success-param-trigger-events="deactivated" data-failure="alert" - data-failure-param-alert-text="Account deactivation failed"> + data-failure-param-alert-text="Account deactivation failed" + data-failure-param-alert-classname="error"> @@ -188,7 +194,9 @@ use Utopia\Locale\Locale; data-success="trigger" data-success-param-trigger-events="session-delete" data-failure="alert" - data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>" + data-failure-param-alert-classname="error"> + @@ -205,7 +213,8 @@ use Utopia\Locale\Locale; data-success-param-trigger-events="logout" data-success-param-redirect-url="/" data-failure="alert" - data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>" + data-failure-param-alert-classname="error"> @@ -235,7 +244,8 @@ use Utopia\Locale\Locale; data-success-param-trigger-events="session-delete" data-success-redirect-url="/" data-failure="alert" - data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout-all')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('console.account.section.security.devices.logout-all')); ?>" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index 31bf7d9460..598bb59458 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -102,7 +102,8 @@ $graph = $this->getParam('graph', false); data-success-param-alert-text="Deleted platform successfully" data-success-param-trigger-events="platform-delete" data-failure="alert" - data-failure-param-alert-text="Failed to delete platform"> + data-failure-param-alert-text="Failed to delete platform" + data-failure-param-alert-classname="error"> @@ -160,7 +161,8 @@ $graph = $this->getParam('graph', false); data-success-param-alert-text="Created new platform successfully" data-success-param-trigger-events="platform-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create platform"> + data-failure-param-alert-text="Failed to create platform" + data-failure-param-alert-classname="error"> @@ -210,7 +212,8 @@ $graph = $this->getParam('graph', false); data-success-param-alert-text="Updated platform successfully" data-success-param-trigger-events="platform-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update platform"> + data-failure-param-alert-text="Failed to update platform" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/keys/index.phtml b/app/views/console/keys/index.phtml index 7686023907..b2cc4c2262 100644 --- a/app/views/console/keys/index.phtml +++ b/app/views/console/keys/index.phtml @@ -62,7 +62,8 @@ $scopes = [ // TODO sync with project list data-success-param-alert-text="Updated API key successfully" data-success-triggers="key-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update API key"> + data-failure-param-alert-text="Failed to update API key" + data-failure-param-alert-classname="error"> @@ -99,7 +100,8 @@ $scopes = [ // TODO sync with project list data-success-param-alert-text="Deleted API key successfully" data-success-param-trigger-events="key-delete" data-failure="alert" - data-failure-param-alert-text="Failed to delete API key"> + data-failure-param-alert-text="Failed to delete API key" + data-failure-param-alert-classname="error"> @@ -141,7 +143,8 @@ $scopes = [ // TODO sync with project list data-success-param-alert-text="Created API key successfully" data-success-param-trigger-events="key-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create API key"> + data-failure-param-alert-text="Failed to create API key" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/settings/index.phtml b/app/views/console/settings/index.phtml index e053efb2cb..0e3b27c768 100644 --- a/app/views/console/settings/index.phtml +++ b/app/views/console/settings/index.phtml @@ -33,7 +33,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Saved project successfully" data-success-param-trigger-events="project-update" data-failure="alert" - data-failure-param-alert-text="Failed to update project"> + data-failure-param-alert-text="Failed to update project" + data-failure-param-alert-classname="error"> @@ -112,7 +113,9 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Saved project successfully" data-success-param-trigger-events="project-update" data-failure="alert" - data-failure-param-alert-text="Failed to update project"> + data-failure-param-alert-text="Failed to update project" + data-failure-param-alert-classname="error"> +

Privacy & Legal

@@ -171,7 +174,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="" data-success-param-trigger-events="membership-delete" data-failure="alert" - data-failure-param-alert-text=""> + data-failure-param-alert-text="" + data-failure-param-alert-classname="error"> @@ -188,7 +192,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="" data-success-param-trigger-events="membership-resend" data-failure="alert" - data-failure-param-alert-text=""> + data-failure-param-alert-text="" + data-failure-param-alert-classname="error"> @@ -220,7 +225,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="" data-success-param-trigger-events="membership-create,modal-close" data-failure="alert" - data-failure-param-alert-text=""> + data-failure-param-alert-text="" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/tasks/index.phtml b/app/views/console/tasks/index.phtml index cc893dae0f..4e609cb240 100644 --- a/app/views/console/tasks/index.phtml +++ b/app/views/console/tasks/index.phtml @@ -87,7 +87,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Updated task successfully" data-success-param-trigger-events="task-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update task"> + data-failure-param-alert-text="Failed to update task" + data-failure-param-alert-classname="error"> @@ -192,7 +193,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Deleted task successfully" data-success-param-trigger-events="task-delete,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to delete task"> + data-failure-param-alert-text="Failed to delete task" + data-failure-param-alert-classname="error"> @@ -220,7 +222,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Created task successfully" data-success-param-trigger-events="task-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create task"> + data-failure-param-alert-text="Failed to create task" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml index 5fabf9fbc7..40388ec20a 100644 --- a/app/views/console/users/index.phtml +++ b/app/views/console/users/index.phtml @@ -30,7 +30,8 @@ $providers = $this->getParam('providers', []); data-success-param-alert-text="Created user successfully" data-success-param-trigger-events="user-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create user"> + data-failure-param-alert-text="Failed to create user" + data-failure-param-alert-classname="error"> @@ -157,7 +158,8 @@ $providers = $this->getParam('providers', []); data-success-param-alert-text="Created team successfully" data-success-param-trigger-events="filter-teams-changed,team-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create team"> + data-failure-param-alert-text="Failed to create team" + data-failure-param-alert-classname="error"> @@ -220,7 +222,8 @@ $providers = $this->getParam('providers', []); data-success-param-alert-text="Updated team successfully" data-success-param-trigger-events="team-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update team"> + data-failure-param-alert-text="Failed to update team" + data-failure-param-alert-classname="error">
@@ -283,7 +286,8 @@ $providers = $this->getParam('providers', []); data-success-param-alert-text="Updated project OAuth settings successfully" data-success-param-trigger-events="project-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update project OAuth settings"> + data-failure-param-alert-text="Failed to update project OAuth settings" + data-failure-param-alert-classname="error"> diff --git a/app/views/console/users/view.phtml b/app/views/console/users/view.phtml index fbb504da2b..7881bd3ecc 100644 --- a/app/views/console/users/view.phtml +++ b/app/views/console/users/view.phtml @@ -99,7 +99,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Blocked User Successfully" data-success-param-trigger-events="user-update" data-failure="alert" - data-failure-param-alert-text="Failed to Block User"> + data-failure-param-alert-text="Failed to Block User" + data-failure-param-alert-classname="error"> @@ -114,7 +115,8 @@ use Utopia\Locale\Locale; data-success-param-alert-text="Blocked Activated Successfully" data-success-param-trigger-events="user-update" data-failure="alert" - data-failure-param-alert-text="Failed to Activate User"> + data-failure-param-alert-text="Failed to Activate User" + data-failure-param-alert-classname="error"> @@ -146,7 +148,9 @@ use Utopia\Locale\Locale; data-success="trigger" data-success-param-trigger-events="user-update" data-failure="alert" - data-failure-param-alert-text="Failed to logout session"> + data-failure-param-alert-text="Failed to logout session" + data-failure-param-alert-classname="error"> + @@ -171,7 +175,9 @@ use Utopia\Locale\Locale; data-success="trigger" data-success-param-trigger-events="user-update" data-failure="alert" - data-failure-param-alert-text="Failed to logout all sessions"> + data-failure-param-alert-text="Failed to logout all sessions" + data-failure-param-alert-classname="error"> +
diff --git a/app/views/console/webhooks/index.phtml b/app/views/console/webhooks/index.phtml index ac5363ba06..fff3f4a672 100644 --- a/app/views/console/webhooks/index.phtml +++ b/app/views/console/webhooks/index.phtml @@ -54,7 +54,8 @@ $events = [ data-success-param-alert-text="Updated webhook successfully" data-success-param-trigger-events="webhook-update,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to update webhook"> + data-failure-param-alert-text="Failed to update webhook" + data-failure-param-alert-classname="error"> @@ -121,7 +122,8 @@ $events = [ data-success-param-alert-text="Deleted webhook successfully" data-success-param-trigger-events="webhook-delete" data-failure="alert" - data-failure-param-alert-text="Failed to delete webhook"> + data-failure-param-alert-text="Failed to delete webhook" + data-failure-param-alert-classname="error"> @@ -152,7 +154,8 @@ $events = [ data-success-param-alert-text="Created webhook successfully" data-success-param-trigger-events="webhook-create,modal-close" data-failure="alert" - data-failure-param-alert-text="Failed to create webhook"> + data-failure-param-alert-text="Failed to create webhook" + data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/confirm.phtml b/app/views/home/auth/confirm.phtml index dccdee9031..95de81a3fe 100644 --- a/app/views/home/auth/confirm.phtml +++ b/app/views/home/auth/confirm.phtml @@ -13,7 +13,8 @@ use Utopia\Locale\Locale; data-success-alert="escape(Locale::getText('home.auth.confirm.success')); ?>" data-success-triggers="account.update" data-failure="alert" - data-failure-alert="escape(Locale::getText('home.auth.confirm.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.confirm.failure')); ?>" + data-failure-param-alert-classname="error">

escape(Locale::getText('home.auth.confirm.title')); ?>

escape(Locale::getText('home.auth.confirm.subtitle')); ?>

diff --git a/app/views/home/auth/join.phtml b/app/views/home/auth/join.phtml index 2d63e562d0..6a8eb4c08b 100644 --- a/app/views/home/auth/join.phtml +++ b/app/views/home/auth/join.phtml @@ -14,7 +14,8 @@ use Utopia\Locale\Locale; data-success-alert="escape(Locale::getText('home.auth.join.success')); ?>" data-success-triggers="account.update" data-failure="alert" - data-failure-alert="escape(Locale::getText('home.auth.join.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.join.failure')); ?>" + data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/recovery.phtml b/app/views/home/auth/recovery.phtml index a32565ea17..6025b6820b 100644 --- a/app/views/home/auth/recovery.phtml +++ b/app/views/home/auth/recovery.phtml @@ -15,7 +15,8 @@ use Utopia\Locale\Locale; data-success="alert" data-success-alert="escape(Locale::getText('home.auth.recovery.success')); ?>" data-failure="alert" - data-failure-alert="escape(Locale::getText('home.auth.recovery.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.recovery.failure')); ?>" + data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/recovery/reset.phtml b/app/views/home/auth/recovery/reset.phtml index ea96568fdb..14d42e0e2b 100644 --- a/app/views/home/auth/recovery/reset.phtml +++ b/app/views/home/auth/recovery/reset.phtml @@ -19,7 +19,8 @@ use Utopia\Locale\Locale; data-success-alert="escape(Locale::getText('home.auth.reset.success')); ?>" data-success-redirect-url="/auth/signin" data-failure="alert" - data-failure-alert="escape(Locale::getText('home.auth.reset.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.reset.failure')); ?>" + data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/signin.phtml b/app/views/home/auth/signin.phtml index 2c0974acc6..6241869f24 100644 --- a/app/views/home/auth/signin.phtml +++ b/app/views/home/auth/signin.phtml @@ -31,7 +31,8 @@ use Utopia\Locale\Locale; data-success-param-trigger-events="login" data-success-param-redirect-url="/console" data-failure="alert" - data-failure-param-alert-text="escape(Locale::getText('home.auth.signin.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.signin.failure')); ?>" + data-failure-param-alert-classname="error"> diff --git a/app/views/home/auth/signup.phtml b/app/views/home/auth/signup.phtml index b2045be159..85d69915c1 100644 --- a/app/views/home/auth/signup.phtml +++ b/app/views/home/auth/signup.phtml @@ -21,7 +21,8 @@ use Utopia\Locale\Locale; data-success-param-trigger-events="auth-register" data-success-redirect-url="/console/setup" data-failure="alert" - data-failure-param-alert-text="escape(Locale::getText('home.auth.signup.failure')); ?>"> + data-failure-param-alert-text="escape(Locale::getText('home.auth.signup.failure')); ?>" + data-failure-param-alert-classname="error"> diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js index ecef502d24..f319eccb78 100644 --- a/public/dist/scripts/app-all.js +++ b/public/dist/scripts/app-all.js @@ -2370,7 +2370,7 @@ document.body.classList.add(prefix+'-'+value);cookie.set('language-'+prefix,valu let config={type:'line',data:{labels:[],datasets:[{label:'Requests',backgroundColor:'rgba(230, 248, 253, 0.3)',borderColor:'#29b5d9',borderWidth:2,data:[0,0,0,0,0,0,0],fill:true}]},options:{responsive:true,title:{display:false,text:'Stats'},legend:{display:false},tooltips:{mode:'index',intersect:false,caretPadding:0},hover:{mode:'nearest',intersect:true},scales:{xAxes:[{display:false}],yAxes:[{display:false,}]}}};for(let i=0;i)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;let functionAsString=func.toString();let params=[];let match;functionAsString=functionAsString.replace(REGEX_COMMENTS,'');functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==='('){functionAsString=functionAsString.slice(1,-1);} while(match=REGEX_PARAMETERS_VALUES.exec(functionAsString)){params.push(match[1]);} return params;} diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js index 752cc5c229..724fd2ae5f 100644 --- a/public/dist/scripts/app.js +++ b/public/dist/scripts/app.js @@ -277,7 +277,7 @@ document.body.classList.add(prefix+'-'+value);cookie.set('language-'+prefix,valu let config={type:'line',data:{labels:[],datasets:[{label:'Requests',backgroundColor:'rgba(230, 248, 253, 0.3)',borderColor:'#29b5d9',borderWidth:2,data:[0,0,0,0,0,0,0],fill:true}]},options:{responsive:true,title:{display:false,text:'Stats'},legend:{display:false},tooltips:{mode:'index',intersect:false,caretPadding:0},hover:{mode:'nearest',intersect:true},scales:{xAxes:[{display:false}],yAxes:[{display:false,}]}}};for(let i=0;i)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;let functionAsString=func.toString();let params=[];let match;functionAsString=functionAsString.replace(REGEX_COMMENTS,'');functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==='('){functionAsString=functionAsString.slice(1,-1);} while(match=REGEX_PARAMETERS_VALUES.exec(functionAsString)){params.push(match[1]);} return params;} diff --git a/public/scripts/views/service.js b/public/scripts/views/service.js index 94bbdbdbf9..6c679c1307 100644 --- a/public/scripts/views/service.js +++ b/public/scripts/views/service.js @@ -33,9 +33,9 @@ } }, - 'alert': function (text) { + 'alert': function (text, classname) { return function (alerts) { - alerts.add({ text: text, class: 'success' }, 3000); + alerts.add({ text: text, class: (classname || 'success') }, 3000); } },