Skip to content

Commit

Permalink
831 update my data table (#834)
Browse files Browse the repository at this point in the history
* fix Go To My Data link

* fix DepositorWizard init stepper

* rename Add AnalysisPlan action

* Add Remaining Budget to My Datatable

* Add Epsilon symbol to tables

* Increase max total epsilon to 3 (Issue #830)
  • Loading branch information
ekraffmiller authored Aug 17, 2023
1 parent 7c63600 commit 5030db6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</v-card-actions>
<v-card-actions v-if="isPlanCreated && selectedDataset !== null" class="success-message">
Plan created successfully!
<router-link to="/my-data">Go to My Data</router-link>
<a v-on:click="closeDialog" >Go to My Data</a>
<router-link to="/my-plans">Go to My Analysis Plans</router-link>
</v-card-actions>
</v-card>
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/MyAnalysisPlans/MyPlansTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
</template>
<template v-slot:[`item.num`]="{ index }">
<span class="index-td hidden-xs-only grey--text">{{ index + 1 }}</span>
</template>
<template v-slot:[`item.epsilon`]="{ item }">
{{item.epsilon}}&epsilon;
</template>
<template v-slot:[`item.status`]="{ item }">
<StatusTag data-test="table status tag" :status="getWorkflowStatus(item)"/>
Expand Down Expand Up @@ -267,7 +270,7 @@ export default {
],
selectedFilter: '', // Initialize selected filter
filterOptions: ['My Plans', 'Plans Created From My Datasets'], // Define filter options
filterOptions: ['My Plans', 'Plans Created From My Datasets', 'Released Plans'], // Define filter options
statusInformation,
actionsInformation,
stepInformation,
Expand Down
24 changes: 20 additions & 4 deletions client/src/components/MyData/MyDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
<template v-slot:[`item.status`]="{ item }">
<StatusTag data-test="table status tag" :status="getWorkflowStatus(item)"/>
</template>

<template v-slot:[`item.budget`]="{ item }">
{{epsilonBudget.getDatasetMaxBudget(item)}}&epsilon;
</template>
<template v-slot:[`item.options`]="{ item }">

</template>
Expand Down Expand Up @@ -70,8 +72,7 @@

<v-tooltip

v-for="(action, index) in statusInformation[stepInformation[item.status].workflowStatus]
.availableActions"
v-for="(action, index) in getAvailableActions(item)"
bottom max-width="220px">
<template v-slot:activator="{ on, attrs }">
<v-icon
Expand Down Expand Up @@ -201,6 +202,7 @@ import NETWORK_CONSTANTS from "../../router/NETWORK_CONSTANTS";
import DeleteDatasetDialog from "@/components/MyData/DeleteDatasetDialog";
import CreateAnalysisPlanDialog from "@/components/MyAnalysisPlans/CreateAnalysisPlanDialog.vue";
import UsersAPI from "@/api/users";
import epsilonBudget from "../../shared/epsilonBudget";
const {
VIEW_DETAILS,
Expand All @@ -210,6 +212,11 @@ const {
export default {
name: "MyDataTable",
computed: {
epsilonBudget() {
return epsilonBudget
}
},
components: {CreateAnalysisPlanDialog, StatusTag, Button, DeleteDatasetDialog},
props: {
datasets: {
Expand Down Expand Up @@ -244,6 +251,7 @@ export default {
headers: [
{value: "num"},
{text: "Data File", value: "name"},
{text: "Remaining Budget", value: "budget"},
{text: "Status", value: "status"},
{text: "Options", value: "actions", align: "end"}
],
Expand All @@ -261,10 +269,18 @@ export default {
} )
},
methods: {
getAvailableActions(item) {
let actions = statusInformation[stepInformation[item.status].workflowStatus].availableActions
// Don't show Add Plan option if there is no more remaining budget
if (epsilonBudget.getDatasetMaxBudget(item) == 0) {
actions= actions.filter(item => item !== "addPlan");
}
return actions
},
handleButtonClick(action, item) {
this[action](item)
},
viewPlans(item) {
addPlan(item) {
this.selectedItem = Object.assign({}, item);
this.dialogCreateAnalysis = true
},
Expand Down
4 changes: 2 additions & 2 deletions client/src/data/actionsInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
viewDetails: "View Details",
continueWorkflow: "Continue",
cancelExecution: "Cancel Execution",
viewPlans: "Add Analysis Plan",
addPlan: "Add Analysis Plan",
delete: "Delete",
actions: {
VIEW_DETAILS: "viewDetails",
Expand All @@ -12,7 +12,7 @@ export default {
},
icons: {
viewDetails: "mdi-eye",
viewPlans: "mdi-notebook-plus",
addPlan: "mdi-notebook-plus",
continueWorkflow: "mdi-arrow-right",
cancelExecution: "mdi-cancel",
delete: "mdi-delete"
Expand Down
2 changes: 1 addition & 1 deletion client/src/data/statusInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
label: "Setup Complete",
color: "light-green lighten-3",
icon: "",
availableActions: ["viewDetails", "viewPlans", "delete"]
availableActions: ["viewDetails", "addPlan", "delete"]
},
completed: {
label: "Release Completed",
Expand Down
2 changes: 1 addition & 1 deletion client/src/shared/createStatsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import release from "@/api/release";
export const deltaStats = ['Histogram']
export const CL_99 = "99"
export const CL_95 = "95"
export const MAX_TOTAL_EPSILON = 1
export const MAX_TOTAL_EPSILON = 3
export const MIN_EPSILON = .001

export const confLevelOptions = [
Expand Down
6 changes: 2 additions & 4 deletions client/src/views/DepositorWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@ export default {
methods: {
updateStepStatus: function (stepNumber, completedStatus) {
console.log("updateStepStatus: stepNumber: " + stepNumber + " completedStatus: " + completedStatus)
this.steps[stepNumber].completed = completedStatus;
},
// Set the current Wizard stepper position based on the
// depositorSetup userStep
initStepperPosition: function () {
console.log('INIT stepper position')
if (this.datasetInfo && this.getDepositorSetupInfo) {
this.stepperPosition = stepInformation[this.userStep].wizardStepper
this.stepperPosition = stepInformation[this.getDepositorSetupInfo.userStep].wizardStepper
for (let index = 0; index < this.stepperPosition; index++) {
this.steps[index].completed = true
}
Expand Down Expand Up @@ -128,7 +126,7 @@ export default {
},
computed: {
...mapState('dataset', ['datasetInfo', 'analysisPlan']),
...mapGetters('dataset', ['getDepositorSetupInfo', 'userStep']),
...mapGetters('dataset', ['getDepositorSetupInfo']),
...mapState('auth', ['user']),
},
watch: {
Expand Down

0 comments on commit 5030db6

Please sign in to comment.