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

UI Work #170

Open
wants to merge 3 commits into
base: sss_vue1.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 41 additions & 8 deletions src/components/sss/bfrs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,22 @@

<div class="small reveal" id="progressInfo" data-close-on-click="false">
<h3>Status</h3>
<div class="alert-container">
<div v-if="target_feature.get('status') === 'in_queue'" class="alert-container">
<p style="font-size: 13px; margin: 0;">
<i class="fa fa-info-circle"></i> This window can be closed – you will receive an email when the upload is ready to proceed
</p>
</div>
<table style=" width: 100%; font-size: 12px; margin-top: -5px; margin-bottom: 5px; border: none;">
<table v-if="target_feature.get('status') === 'in_queue'" style=" width: 100%; font-size: 12px; margin-top: -5px; margin-bottom: 5px; border: none;">
<tr>
<td style=" text-align: left; background-color: #EDEDED;"><b>Last Uploaded: </b>{{last_uploaded_date}} {{calculation_status}}</td>
<td style=" text-align: left; background-color: #EDEDED;"><b>Last Uploaded: </b>{{last_uploaded_date}}</td>
<td style=" text-align: left; background-color: #EDEDED;"><b>Submitted By: </b>{{submitter}}</td>
<td style="text-align: left; background-color: #EDEDED;">
<b>Status: </b>
<span v-if="calculation_status === 'waiting'" class="badge bg-primary">Waiting</span>
<span v-if="calculation_status === 'calculating'" class="badge bg-warning">Calculating</span>
<span v-if="calculation_status === 'calculation_error'" class="badge bg-danger">Failed</span>
<span v-if="calculation_status === 'calculation_completed'" class="badge bg-success">Completed</span>
</td>
</tr>
</table>
<div v-for="(index, task) in feature_tasks" :key="index">
Expand Down Expand Up @@ -306,6 +313,33 @@
border-color: #b8daff;
color: #004085;
}
.badge {
display: inline-block;
padding: 0.25em 0.4em;
font-size: 75%;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0.25rem;
}
.bg-primary {
background-color: #2199E8;
color: white;
}
.bg-warning {
background-color: #ffc107;
color: #212529;
}
.bg-danger {
background-color: #dc3545;
color: white;
}
.bg-success {
background-color: #28a745;
color: white;
}
</style>
<script>
import { ol, $, moment, hash, turf, utils } from 'src/vendor.js'
Expand Down Expand Up @@ -2530,7 +2564,6 @@
}
vm.taskDialog = new Foundation.Reveal($('#progressInfo'));
vm.taskDialog.open();
vm.calculation_status = '';
}
}

Expand Down Expand Up @@ -2582,15 +2615,15 @@
}

if (status === "Imported") {
vm.calculation_status = "(Waiting)";
vm.calculation_status = "waiting";
}
if (status === "Calculating") {
vm.calculation_status = "(Calculating)";
vm.calculation_status = "calculating";
}

openTaskDialog();
if (status === "Calculation Error") {
vm.calculation_status = '(Calculation Error)';
vm.calculation_status = 'calculation_error';
if (response["error"]) {
tenure_area_task.setStatus(utils.FAILED, response["error"]);
} else {
Expand All @@ -2606,7 +2639,7 @@
}

if (status === "Processing Finalised") {
vm.calculation_status = '';
vm.calculation_status = 'calculation_completed';
vm.target_feature.spatial_data = JSON.parse(spatial_data);
tenure_area_task.setStatus(utils.SUCCEED);

Expand Down