Skip to content

Commit

Permalink
Merge pull request #9 from jobready/feature/NEP-11271
Browse files Browse the repository at this point in the history
[NEP-11271] Renaming the title and apply clickthrough on First and Second Approval Required for Wage Subsidy Widgets
  • Loading branch information
footnoise authored May 13, 2021
2 parents f31fa65 + 020fbdd commit 027c52c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
Expand Down
39 changes: 20 additions & 19 deletions dist/react-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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(){

Expand Down Expand Up @@ -2145,7 +2145,7 @@ window.JobReady = JobReady;
return;
}
}

this.animations.push({
chartInstance: chartInstance,
animationObject: animationObject
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -3338,7 +3338,7 @@ window.JobReady = JobReady;
helpers.each(this.segments,function(segment){
segment.save();
});

this.reflow();
this.render();
},
Expand Down Expand Up @@ -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
*/

Expand Down Expand Up @@ -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,
showAllUrl: widget.show_all_url,
widgetId: widget.id,
icon: widget.icon,
editMode: this.props.editMode,
Expand Down Expand Up @@ -36354,11 +36355,11 @@ var ListWidget = React.createClass({
}

var title = this.props.title;
if (this.state.data.show_all_url != null) {
if (this.props.showAllUrl != null) {
title = React.createElement(
"a",
{ href: this.state.data.show_all_url },
this.props.title
{ href: this.props.showAllUrl },
title
);
}

Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-dashboard",
"version": "0.0.0",
"version": "1.2.1",
"description": "",
"main": "dist/react-dashboard.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ var Dashboard = React.createClass({
React.createElement(AvailableWidgetsMap[widget.component_type], {
title: widget.title,
url: widget.url,
showAllUrl: widget.show_all_url,
widgetId: widget.id,
icon: widget.icon,
editMode: this.props.editMode,
Expand All @@ -54,4 +55,3 @@ var Dashboard = React.createClass({
});

module.exports = Dashboard;

8 changes: 4 additions & 4 deletions src/components/ListWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ var ListWidget = React.createClass({
saveButton = <WidgetSaveButton widgetId={this.props.widgetId} enabled={this.props.enabled}/>;
}

var title = this.props.title;
if (this.state.data.show_all_url != null) {
title = <a href={this.state.data.show_all_url}>{this.props.title}</a>
var { title } = this.props;
if (this.props.showAllUrl != null) {
title = <a href={this.props.showAllUrl}>{title}</a>
}

return (
Expand All @@ -67,7 +67,7 @@ var ListWidget = React.createClass({
<i className={classes}/>
{title}
{saveButton}
<span className="badge pull-right bg-primary">{this.state.data.count}</span>
<span className="badge pull-right bg-primary">{this.state.data.items.length}</span>
</div>
<div className="panel-body" style={this.scrollableStyles()}>
<div className="list-group">
Expand Down

0 comments on commit 027c52c

Please sign in to comment.