From 85381e34a8a5790e9b589ab94154b903d25f845d Mon Sep 17 00:00:00 2001 From: Sergei Aksiutin Date: Wed, 5 May 2021 13:11:26 +1000 Subject: [PATCH 1/3] [NEP-11271] Renaming the title and apply clickthrough on First and Second Approval Required for Wage Subsidy Widgets Fixed the following bugs: - Provides correct show_all_url property which makes widget title as a html link. - Fixes badge counter bug in widget header. --- dist/react-dashboard.js | 39 ++++++++++++++++++------------------ src/components/Dashboard.js | 2 +- src/components/ListWidget.js | 8 ++++---- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dist/react-dashboard.js b/dist/react-dashboard.js index 550fb14..3276473 100644 --- a/dist/react-dashboard.js +++ b/dist/react-dashboard.js @@ -955,25 +955,25 @@ window.JobReady = JobReady; if (reflow){ this.reflow(); } - + if (this.options.animation && !reflow){ var animation = new Chart.Animation(); animation.numSteps = this.options.animationSteps; animation.easing = this.options.animationEasing; - + // render function animation.render = function(chartInstance, animationObject) { var easingFunction = helpers.easingEffects[animationObject.easing]; var stepDecimal = animationObject.currentStep / animationObject.numSteps; var easeDecimal = easingFunction(stepDecimal); - + chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep); }; - + // user events animation.onAnimationProgress = this.options.onAnimationProgress; animation.onAnimationComplete = this.options.onAnimationComplete; - + Chart.animationService.addAnimation(this, animation); } else{ @@ -1396,11 +1396,11 @@ window.JobReady = JobReady; numSteps: 60, // default number of steps easing: "", // the easing to use for this animation render: null, // render function used by the animation service - - onAnimationProgress: null, // user specified callback to fire on each step of the animation + + onAnimationProgress: null, // user specified callback to fire on each step of the animation onAnimationComplete: null, // user specified callback to fire when the animation finishes }); - + Chart.Tooltip = Chart.Element.extend({ draw : function(){ @@ -2145,7 +2145,7 @@ window.JobReady = JobReady; return; } } - + this.animations.push({ chartInstance: chartInstance, animationObject: animationObject @@ -2161,7 +2161,7 @@ window.JobReady = JobReady; var index = helpers.findNextWhere(this.animations, function(animationWrapper) { return animationWrapper.chartInstance === chartInstance; }); - + if (index) { this.animations.splice(index, 1); @@ -2191,9 +2191,9 @@ window.JobReady = JobReady; if(this.animations[i].animationObject.currentStep > this.animations[i].animationObject.numSteps){ this.animations[i].animationObject.currentStep = this.animations[i].animationObject.numSteps; } - + this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject); - + // Check if executed the last frame. if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){ // Call onAnimationComplete @@ -2658,7 +2658,7 @@ window.JobReady = JobReady; var index = atIndex !== undefined ? atIndex : this.segments.length; if ( typeof(segment.color) === "undefined" ) { segment.color = Chart.defaults.global.segmentColorDefault[index % Chart.defaults.global.segmentColorDefault.length]; - segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length]; + segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length]; } this.segments.splice(index, 0, new this.SegmentArc({ value : segment.value, @@ -3338,7 +3338,7 @@ window.JobReady = JobReady; helpers.each(this.segments,function(segment){ segment.save(); }); - + this.reflow(); this.render(); }, @@ -4166,7 +4166,7 @@ module.exports.Dispatcher = require('./lib/Dispatcher'); * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Dispatcher - * + * * @preventMunge */ @@ -36273,6 +36273,7 @@ var Dashboard = React.createClass({ return React.createElement("div", { className: "col-md-6 col-sm-6 widget", key: widget.id }, React.createElement(AvailableWidgetsMap[widget.component_type], { title: widget.title, url: widget.url, + show_all_url: widget.show_all_url, widgetId: widget.id, icon: widget.icon, editMode: this.props.editMode, @@ -36354,11 +36355,11 @@ var ListWidget = React.createClass({ } var title = this.props.title; - if (this.state.data.show_all_url != null) { + if (this.props.show_all_url != null) { title = React.createElement( "a", - { href: this.state.data.show_all_url }, - this.props.title + { href: this.props.show_all_url }, + title ); } @@ -36374,7 +36375,7 @@ var ListWidget = React.createClass({ React.createElement( "span", { className: "badge pull-right bg-primary" }, - this.state.data.count + this.state.data.items.length ) ), React.createElement( diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index 2ed32cf..c7c132e 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -32,6 +32,7 @@ var Dashboard = React.createClass({ React.createElement(AvailableWidgetsMap[widget.component_type], { title: widget.title, url: widget.url, + show_all_url: widget.show_all_url, widgetId: widget.id, icon: widget.icon, editMode: this.props.editMode, @@ -54,4 +55,3 @@ var Dashboard = React.createClass({ }); module.exports = Dashboard; - diff --git a/src/components/ListWidget.js b/src/components/ListWidget.js index 79c0354..93a2d24 100644 --- a/src/components/ListWidget.js +++ b/src/components/ListWidget.js @@ -56,9 +56,9 @@ var ListWidget = React.createClass({ saveButton = ; } - var title = this.props.title; - if (this.state.data.show_all_url != null) { - title = {this.props.title} + var { title } = this.props; + if (this.props.show_all_url != null) { + title = {title} } return ( @@ -67,7 +67,7 @@ var ListWidget = React.createClass({ {title} {saveButton} - {this.state.data.count} + {this.state.data.items.length}
From adc0746181b7dc4810d136892a7408a533836d9c Mon Sep 17 00:00:00 2001 From: Sergei Aksiutin Date: Wed, 5 May 2021 17:21:19 +1000 Subject: [PATCH 2/3] Bump version to 1.2.1 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index cf9d49e..40f3207 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-dashboard", - "version": "0.0.1", + "version": "1.2.1", "homepage": "https://github.com/jobready/react-dashboard", "authors": [ "Andrew McNamara " diff --git a/package.json b/package.json index 5c90230..6158924 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-dashboard", - "version": "0.0.0", + "version": "1.2.1", "description": "", "main": "dist/react-dashboard.js", "dependencies": { From 020fbdd3e7acdf644a23229be78b6e8be0b4dcaa Mon Sep 17 00:00:00 2001 From: Sergei Aksiutin Date: Fri, 7 May 2021 09:37:40 +1000 Subject: [PATCH 3/3] Rename show_all_url to showAllUrl --- dist/react-dashboard.js | 6 +++--- src/components/Dashboard.js | 2 +- src/components/ListWidget.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/react-dashboard.js b/dist/react-dashboard.js index 3276473..b1bc98d 100644 --- a/dist/react-dashboard.js +++ b/dist/react-dashboard.js @@ -36273,7 +36273,7 @@ var Dashboard = React.createClass({ return React.createElement("div", { className: "col-md-6 col-sm-6 widget", key: widget.id }, React.createElement(AvailableWidgetsMap[widget.component_type], { title: widget.title, url: widget.url, - show_all_url: widget.show_all_url, + showAllUrl: widget.show_all_url, widgetId: widget.id, icon: widget.icon, editMode: this.props.editMode, @@ -36355,10 +36355,10 @@ var ListWidget = React.createClass({ } var title = this.props.title; - if (this.props.show_all_url != null) { + if (this.props.showAllUrl != null) { title = React.createElement( "a", - { href: this.props.show_all_url }, + { href: this.props.showAllUrl }, title ); } diff --git a/src/components/Dashboard.js b/src/components/Dashboard.js index c7c132e..35b9583 100644 --- a/src/components/Dashboard.js +++ b/src/components/Dashboard.js @@ -32,7 +32,7 @@ var Dashboard = React.createClass({ React.createElement(AvailableWidgetsMap[widget.component_type], { title: widget.title, url: widget.url, - show_all_url: widget.show_all_url, + showAllUrl: widget.show_all_url, widgetId: widget.id, icon: widget.icon, editMode: this.props.editMode, diff --git a/src/components/ListWidget.js b/src/components/ListWidget.js index 93a2d24..18302ac 100644 --- a/src/components/ListWidget.js +++ b/src/components/ListWidget.js @@ -57,8 +57,8 @@ var ListWidget = React.createClass({ } var { title } = this.props; - if (this.props.show_all_url != null) { - title = {title} + if (this.props.showAllUrl != null) { + title = {title} } return (