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

The frog report #526

Merged
merged 17 commits into from
Jul 11, 2022
Prev Previous commit
Next Next commit
first cut of frog pond report
  • Loading branch information
epugh committed Jun 14, 2022
commit 05b8a57344b88d42ae5d329e5eec491dd818b12e
Binary file added app/assets/images/frog-pond.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions app/assets/javascripts/components/frog_report/_modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="modal-header">
<button type="button" class="close" aria-label="Close" ng-click="ctrl.cancel()"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title">The Frog Report: <span class="modal-case">{{ ctrl.theCase.caseName }}</span></h3>
</div>
<div class="modal-body frog-pond">
<div class="alert alert-warning" role="alert" ng-if="!ctrl.options.queries">
You have chosen not to import any queries. The new case will be empty.
</div>

<p>The accuracy of the scores calculated by Quepid is directly impacted by the number of <i class="fa fa-frog" aria-hidden="true"></i>'s you have. Chase the frogs
back into the pond (i.e rate your documents) so that you can have confidence in the changes you are making!</p>

<h4>Summary</h4>

{{ ctrl.theCase.queriesCount}} Queries<br/>

All Rated? {{ ctrl.theCase.lastScore.all_rated }} <br/>
{{ ctrl.numberOfRatings() }} Ratings <br/>
Hop to it, we need {{ ctrl.numberOfMissingRatings() }} more <br/>



<h4>Distribution of Queries Needing Ratings</h4>

<br>

</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ctrl.cancel()">Done</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<i class="fa fa-frog" aria-hidden="true"></i>
<a ng-click="ctrl.prompt()">
Report
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict';

/*jslint latedef:false*/

angular.module('QuepidApp')
.controller('FrogReportCtrl', [
'$uibModal',
'$rootScope',
'$log',
'flash',
'caseSvc',
'queriesSvc',
function (
$uibModal,
$rootScope,
$log,
flash,
caseSvc,
queriesSvc
) {
var ctrl = this;

// Functions
ctrl.prompt = prompt;


function prompt() {
var modalInstance = $uibModal.open({
templateUrl: 'frog_report/_modal.html',
controller: 'FrogReportModalInstanceCtrl',
controllerAs: 'ctrl',
size: 'lg',
resolve: {
theCase: function() {
return caseSvc.getSelectedCase();
},
queriesSvc: function() {
return queriesSvc;
}
}
});

modalInstance.result.then(
function (options) {
//ctrl.cloneCase(options);
},
function() {
$log.info('INFO: Modal dismissed');
}
);

}
}
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

angular.module('QuepidApp')
.directive('frogReport', [
function () {
return {
restrict: 'E',
controller: 'FrogReportCtrl',
controllerAs: 'ctrl',
templateUrl: 'frog_report/frog_report.html',
scope: {
theCase: '=',
queriesSvc: '=',
iconOnly: '=',
supportsDetailedExport: '='
}
};
}
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
'use strict';

angular.module('QuepidApp')
.controller('FrogReportModalInstanceCtrl', [
'$uibModalInstance',
'theCase', 'queriesSvc',
function ($uibModalInstance, theCase, queriesSvc) {
var ctrl = this;

ctrl.theCase = theCase;
ctrl.queriesSvc = queriesSvc
ctrl.options = {
history: false,
queries: true,
ratings: false,
caseName: ''
};

ctrl.numberOfMissingRatings = function() {
var countMissingRatings = 0;
angular.forEach(queriesSvc.queries, function(q) {
countMissingRatings = countMissingRatings + q.currentScore.countMissingRatings;
});

return countMissingRatings;
}

ctrl.numberOfRatings = function() {
var countRatings = 0;
angular.forEach(queriesSvc.queries, function(q) {
countRatings = countRatings + Object.keys(q.ratings).length;

});

return countRatings;
}

ctrl.cannotClone = function() {
return !ctrl.options.caseName || ctrl.options.caseName === '';
};

ctrl.ok = function () {
$uibModalInstance.close(ctrl.options);
};

ctrl.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
}
]);
1 change: 1 addition & 0 deletions app/assets/javascripts/controllers/queriesCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ angular.module('QuepidApp')
configurationSvc
) {
$scope.queriesSvc = queriesSvc;
$scope.caseSvc = caseSvc;
$scope.queryListSortable = configurationSvc.isQueryListSortable();

$rootScope.$on('scoring-complete', () => {
Expand Down
23 changes: 23 additions & 0 deletions app/assets/stylesheets/froggy.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,26 @@
min-width: 2em;
font: bold .3em sans-serif;
}

.frog-pond {
height: 550px;
width: 898px;
}

.frog-pond::before{
content: '';
background-image: image-url("frog-pond.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: absolute;
height: 550px;
width: 898px;
top: 0;
left: 0;
opacity: 0.5;
}

.frog-pond p {

}
6 changes: 6 additions & 0 deletions app/assets/templates/views/queries.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
<div class="pull-right p-r-10">
<input type="search" ng-model="queryFilter" placeholder="Filter Queries" aria-label="filter queries" class="form-control input-sm" id='queries-filter' />
</div>
<div class="pull-right p-r-10">
<frog-report
the-case="caseSvc.selectedCase()"

></frog-report>
</div>

<div class="clearfix"></div>

Expand Down