Skip to content

Commit

Permalink
fix(analysisJobs): Adds placeholder messages for empty data templates
Browse files Browse the repository at this point in the history
Additionally ensured consistency in other spots as well.

Fixes #294.
  • Loading branch information
atruskie committed Feb 21, 2017
1 parent 9fc507c commit 5d1b28e
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 154 deletions.
10 changes: 7 additions & 3 deletions src/app/analysisResults/fileList/fileList.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ <h2>Files</h2>
<tbody>
<tr ng-if="!fileList.analysisResult.children || fileList.analysisResult.children.length === 0">
<td colspan="4">
<span class="text-muted">
No files in this folder
</span>
<p class="text-muted text-center">
<small>
<em>
No files in this folder.
</em>
</small>
</p>
</td>
</tr>
<tr ng-repeat="file in fileList.analysisResult.children">
Expand Down
2 changes: 1 addition & 1 deletion src/app/jobs/list/jobsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angular
let controller = this;


this.analysisJobs = [];
this.analysisJobs = null;

this.newAnalysisJobRoute = paths.site.ngRoutes.analysisJobs.new;

Expand Down
10 changes: 9 additions & 1 deletion src/app/jobs/list/jobsList.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ <h1>Audio Analysis</h1>

</p>


<div class="panel panel-default" ng-if="jobsList.analysisJobs && jobsList.analysisJobs.length === 0">
<p class="text-muted text-center">
<small>
<em>
No existing analysis jobs are available to you - try creating a new one.
</em>
</small>
</p>
</div>
<div class="panel panel-default" ng-repeat="analysisJob in jobsList.analysisJobs">
<div class="panel-heading">
<a href="{{ analysisJob.viewUrl }}" class="list-item-header-a">
Expand Down
2 changes: 1 addition & 1 deletion src/app/jobs/new/jobNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class JobNewController {
this.analysisJob = new AnalysisJobModel();

// the available scripts
this.scripts = [];
this.scripts = null;

// download available scripts
ScriptService
Expand Down
58 changes: 35 additions & 23 deletions src/app/jobs/new/jobNew.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,42 @@ <h2>2. Select analysis type</h2>
</tr>
</thead>
<tbody>
<tr ng-repeat="script in jobNew.scripts"
ng-class="{active: jobNew.analysisJob.scriptId === script.id }"
ng-click="jobNew.scriptSelect(script.id)">
<td>
<label>
<tr ng-if="jobNew.scripts && jobNew.scripts.length === 0">
<td colspan="5">
<p class="text-muted text-center">
<small>
<em>
No analysis scripts are available yet.
Please contact the site administrator and ask them to add some.
</em>
</small>
</p>
</td>
</tr>
<tr ng-repeat="script in jobNew.scripts"
ng-class="{active: jobNew.analysisJob.scriptId === script.id }"
ng-click="jobNew.scriptSelect(script.id)">
<td>
<label>

<input type="radio" name="analysisType"
ng-value="script.id"
ng-model="jobNew.analysisJob.scriptId">
</label>
</td>
<td>
{{ script.name }}
</td>
<td>
{{ script.version }}
</td>
<td>
{{ script.description }}
</td>
<td>
<user-tile mode="created" resource="script" skinny></user-tile>
</td>
</tr>
<input type="radio" name="analysisType"
ng-value="script.id"
ng-model="jobNew.analysisJob.scriptId">
</label>
</td>
<td>
{{ script.name }}
</td>
<td>
{{ script.version }}
</td>
<td>
{{ script.description }}
</td>
<td>
<user-tile mode="created" resource="script" skinny></user-tile>
</td>
</tr>
</tbody>
</table>
<div class="form-group">
Expand Down
8 changes: 7 additions & 1 deletion src/app/savedSearches/widgets/listSavedSearches.tpl.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<!-- TODO: add typeahead filter-->
<!-- TODO: add paging -->
<div ng-if="!$ctrl.savedSearchesExist">
<p class="text-muted">No data sets exist. Try creating a new one.</p>
<p class="text-muted text-center">
<small>
<em>
No data sets exist. Try creating a new one.
</em>
</small>
</p>
</div>
<table class="table table-hover" ng-if="$ctrl.savedSearchesExist">
<caption>
Expand Down
124 changes: 0 additions & 124 deletions src/components/services/analysisJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,130 +17,6 @@ angular
function ($resource, bawResource, $http, $q, paths, _, casingTransformers,
QueryBuilder, AnalysisJobModel, SavedSearchService, $url) {

/*// FAKED!
let fakedData = [
{
"id": 11111,
"name": "fake 11111 new fake",
"annotation_name": null,
"custom_settings": "#custom settings 267",
"script_id": 1,
"creator_id": 144,
"updater_id": 144,
"deleter_id": null,
"deleted_at": null,
"created_at": "2016-01-18 06:03:10.047508",
"updated_at": "2016-02-01 06:03:10.093619",
"description": null,
"saved_search_id": 1,
"started_at": "2016-02-18 06:03:10.028024",
"overall_status": "new",
"overall_status_modified_at": "2016-02-18 06:03:10.028276",
"overall_progress": {},
"overall_progress_modified_at": "2016-02-18 06:03:10.028776",
"overall_count": 66,
"overall_duration_seconds": 6600
},
{
"id": 22222,
"name": "fake 22222 fake fake 22222 fake fake 22222 fake ",
"annotation_name": null,
"custom_settings": "#custom settings 267",
"script_id": 1,
"creator_id": 9,
"updater_id": 144,
"deleter_id": null,
"deleted_at": null,
"created_at": "2016-01-18 06:03:10.047508",
"updated_at": "2016-02-01 06:03:10.093619",
"description": null,
"saved_search_id": 1,
"started_at": "2016-02-18 06:03:10.028024",
"overall_status": "preparing",
"overall_status_modified_at": "2016-02-18 06:03:10.028276",
"overall_progress": {},
"overall_progress_modified_at": "2016-02-18 06:03:10.028776",
"overall_count": 77,
"overall_duration_seconds": 77700
},
{
"id": 1,
"name": "\"simulate work analysis\" run on the \"All sites in SERF Acoustic Study\" data",
"annotation_name": null,
"custom_settings": "#custom settings 267",
"script_id": 1,
"creator_id": 9,
"updater_id": 9,
"deleter_id": null,
"deleted_at": null,
"created_at": "2016-02-18 06:03:10.047508",
"updated_at": "2016-02-18 06:03:10.093619",
"description": null,
"saved_search_id": 1,
"started_at": "2016-02-18 06:03:10.028024",
"overall_status": "processing",
"overall_status_modified_at": "2016-02-18 06:03:10.028276",
"overall_progress": {"queued": 10, "working": 1, "successful": 35, "failed": 4, "total": 0},
"overall_progress_modified_at": (new Date()).setMinutes(0, 0, 0),
"overall_count": 50,
"overall_duration_seconds": 88888,
"overall_size_bytes": 123456789
},
{
"id": 3600,
"name": "fake 3600 completed fake",
"annotation_name": null,
"custom_settings": "#custom settings 267",
"script_id": 1,
"creator_id": 9,
"updater_id": 144,
"deleter_id": null,
"deleted_at": null,
"created_at": "2016-01-18 06:03:10.047508",
"updated_at": "2016-02-01 06:03:10.093619",
"description": null,
"saved_search_id": 1,
"started_at": "2016-02-18 06:03:10.028024",
"overall_status": "completed",
"overall_status_modified_at": "2016-02-18 06:03:10.028276",
"overall_progress": {"queued": 0, "working": 0, "successful": 90, "failed": 10, "total": 100},
"overall_progress_modified_at": "2016-02-18 06:03:10.028776",
"overall_count": 100,
"overall_duration_seconds": 100 * 3600 * 2,
"overall_size_bytes": 123456789
},
{
"id": 99999,
"name": "fake 99999 suspended fake",
"annotation_name": null,
"custom_settings": "#custom settings 267",
"script_id": 1,
"creator_id": 9,
"updater_id": 144,
"deleter_id": null,
"deleted_at": null,
"created_at": "2016-01-18 06:03:10.047508",
"updated_at": "2016-02-01 06:03:10.093619",
"description": null,
"saved_search_id": 1,
"started_at": "2016-02-18 06:03:10.028024",
"overall_status": "suspended",
"overall_status_modified_at": "2016-02-18 06:03:10.028276",
"overall_progress": {"queued": 10, "working": 0, "successful": 80, "failed": 10, "total": 100},
"overall_progress_modified_at": "2016-02-18 06:03:10.028776",
"overall_count": 99,
"overall_duration_seconds": 99999
}
];
fakedData = casingTransformers.transformObject(fakedData, casingTransformers.camelize);
*/

function query() {
const url = paths.api.routes.analysisJobs.listAbsolute;
return $http
Expand Down

0 comments on commit 5d1b28e

Please sign in to comment.