Skip to content

Commit

Permalink
Merge pull request #73 from baobabsoluciones/release/v1.1.0
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
ggsdc authored Sep 30, 2024
2 parents bdf81b2 + 284b409 commit 30a6841
Show file tree
Hide file tree
Showing 14 changed files with 2,535 additions and 332 deletions.
2,522 changes: 2,308 additions & 214 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cornflow-ui",
"private": true,
"version": "0.0.0",
"version": "1.1.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -24,7 +24,8 @@
"vue-i18n": "^9.9.0",
"vue-router": "^4.3.0",
"vuetify": "^3.5.17",
"webfontloader": "^1.6.28"
"webfontloader": "^1.6.28",
"rollup": ">=4.22.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
Expand All @@ -33,9 +34,10 @@
"jsdom": "^24.1.0",
"vitest": "^2.0.5",
"@types/node": "^20.11.24",
"rollup": "^4.22.4",
"sass": "^1.71.1",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vue-tsc": "^1.8.25"
"vue-tsc": "^2.1.6"
}
}
6 changes: 3 additions & 3 deletions src/components/core/DateRangePicker.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-row class="mt-4 justify-space-around">
<v-col class="v-col-s-12 v-col-4">
<v-row class="mt-1 justify-space-around">
<v-col class="v-col-s-12 v-col-6">
<h5 class="mb-2">{{ startDateTitle }}</h5>
<v-date-picker
hide-header
Expand All @@ -10,7 +10,7 @@
:max="endDate || today"
></v-date-picker>
</v-col>
<v-col class="v-col-s-12 v-col-4">
<v-col class="v-col-s-12 v-col-6">
<h5 class="mb-2">{{ endDateTitle }}</h5>
<v-date-picker
hide-header
Expand Down
5 changes: 3 additions & 2 deletions src/components/core/HelpMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
<div class="text-caption">{{ appVersion }}</div>
</template>
</v-list-item>
<v-list-item min-height="24">
<!-- TODO: Integrate backend version with backend url when have it-->
<!-- <v-list-item min-height="24">
<template v-slot:subtitle>
<div class="text-caption">{{ backendVersion }}</div>
</template>
</v-list-item>
</v-list-item> -->
</v-list>
</v-menu>
</v-btn>
Expand Down
50 changes: 43 additions & 7 deletions src/components/project-execution/ProjectExecutionsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<template v-slot:solver="{ item }">
{{ item.config.solver }}
</template>
<template v-slot:timeLimit="{ item }">
{{ item.config.timeLimit }} sec
</template>
<template v-slot:state="{ item }">
<v-chip size="x-small" :color="stateInfo[item.state].color" value="chip">
{{ stateInfo[item.state].code }}
Expand Down Expand Up @@ -46,10 +49,26 @@
</template>
<template v-slot:actions="{ item }">
<span>
<v-icon size="small" class="mr-2" @click="loadExecution(item)"
>mdi-tray-arrow-up</v-icon
>
<v-icon size="small" @click="deleteExecution(item)">mdi-delete</v-icon>
<span>
<v-icon size="small" class="mr-2" @click="loadExecution(item)">
mdi-tray-arrow-up
</v-icon>
<v-tooltip activator="parent" location="bottom">
<span>
{{ $t('executionTable.loadExecution') }}
</span>
</v-tooltip>
</span>
<span>
<v-icon size="small" @click="deleteExecution(item)">
mdi-delete
</v-icon>
<v-tooltip activator="parent" location="bottom">
<span>
{{ $t('executionTable.deleteExecution') }}
</span>
</v-tooltip>
</span>
</span>
</template>
</MDataTable>
Expand Down Expand Up @@ -122,33 +141,49 @@ export default {
{
title: this.$t('executionTable.date'),
value: 'createdAt',
width: '15%',
width: '12%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.name'),
value: 'name',
width: '18%',
sortable: !this.formatDateByTime,
},
{ title: this.$t('executionTable.name'), value: 'name', width: '20%' },
{
title: this.$t('executionTable.description'),
value: 'description',
width: '20%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.excel'),
value: 'excel',
width: '8%',
width: '9%',
},
{
title: this.$t('executionTable.state'),
value: 'state',
width: '12%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.solver'),
value: 'solver',
width: '13%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.timeLimit'),
value: 'timeLimit',
width: '12%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.solution'),
value: 'solution',
width: '10%',
sortable: !this.formatDateByTime,
},
{
title: this.$t('executionTable.actions'),
Expand Down Expand Up @@ -225,6 +260,7 @@ export default {
},
async confirmDelete() {
this.$emit('deleteExecution', this.deletedItem)
this.openConfirmationDeleteModal = false
},
async cancelDelete() {
this.openConfirmationDeleteModal = false
Expand Down
11 changes: 7 additions & 4 deletions src/models/Experiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export class ExperimentCore {
saveInstance = true,
saveSolution = true,
) {
// Sanitize the filename by replacing points with hyphens
const sanitizedFilename = filename.replace(/\./g, '-')

// we create the object for the file
var workbook

Expand All @@ -30,29 +33,29 @@ export class ExperimentCore {
// then we write the instance tables
if (saveInstance && this.instance != null && this.instance.data != null) {
workbook = new ExcelJS.Workbook()
schemaDataToTable(workbook, this.instance.data)
schemaDataToTable(workbook, this.instance.data, this.instance.schema)
// we generate the excel file
const excelBuffer = await workbook.xlsx.writeBuffer()
const blob = new Blob([excelBuffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
})
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `instance_${filename}`
link.download = `instance_${sanitizedFilename}`
link.click()
console.log('Excel file generated correctly:', 'instance')
}
if (saveSolution && this.solution != null && this.solution.data != null) {
workbook = new ExcelJS.Workbook()
schemaDataToTable(workbook, this.solution.data)
schemaDataToTable(workbook, this.solution.data, this.solution.schema)
// we generate the excel file
const excelBuffer = await workbook.xlsx.writeBuffer()
const blob = new Blob([excelBuffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
})
const link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = `solution_${filename}`
link.download = `solution_${sanitizedFilename}`
link.click()
console.log('Excel file generated correctly: solution')
}
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
},
},
executionTable: {
date: 'Date',
date: 'Time',
name: 'Name',
description: 'Description',
state: 'State',
Expand Down Expand Up @@ -172,6 +172,8 @@ export default {
success: 'Success',
error: 'Error',
loading: 'Loading',
loadExecution: 'Load execution',
deleteExecution: 'Delete execution',
},
logIn: {
subtitle: 'Log in to get started!',
Expand Down Expand Up @@ -217,7 +219,7 @@ export default {
versionHistory: {
title: 'Version history',
description:
'Here you can find a summary of all the versions you have made for the different projects executed',
'In this section, you will find a summary of all the versions you have completed for the different executed projects. You can load as many executions as you want from the actions column. Each execution will open in a new tab at the bottom of the screen, and the most recently loaded execution will be selected by default.',
yesterday: 'Yesterday',
today: 'Today',
last7days: 'Last 7 days',
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default {
},
},
executionTable: {
date: 'Fecha',
date: 'Hora',
name: 'Nombre',
description: 'Descripción',
state: 'Estado',
Expand Down Expand Up @@ -179,6 +179,8 @@ export default {
success: 'Éxito',
error: 'Error',
loading: 'Cargando',
loadExecution: 'Cargar ejecución',
deleteExecution: 'Eliminar ejecución',
},
logIn: {
subtitle: '¡Inicia sesión para empezar!',
Expand Down Expand Up @@ -225,7 +227,7 @@ export default {
versionHistory: {
title: 'Historial de versiones',
description:
'Aquí puedes encontrar un resumen de todas las versiones que has realizado para los diferentes proyectos ejecutados',
'En esta sección, encontrarás un resumen de todas las versiones que has realizado para los distintos proyectos ejecutados. Puedes cargar tantas ejecuciones como desees desde la columna de acciones. Cada ejecución se abrirá en una nueva pestaña en la parte inferior de la pantalla, y la última ejecución cargada será seleccionada de manera predeterminada.',
yesterday: 'Ayer',
today: 'Hoy',
last7days: 'Últimos 7 días',
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default {
},
},
executionTable: {
date: 'Date',
date: 'Temps',
name: 'Nom',
description: 'Description',
state: 'Statut',
Expand Down Expand Up @@ -164,6 +164,8 @@ export default {
success: 'Succès',
error: 'Erreur',
loading: 'Chargement',
loadExecution: 'Load execution',
deleteExecution: 'Delete execution',
},
logIn: {
subtitle: 'Connectez-vous pour commencer !',
Expand Down Expand Up @@ -212,7 +214,7 @@ export default {
versionHistory: {
title: 'Historique des versions',
description:
'Vous pouvez ici trouver un résumé de toutes les versions que vous avez réalisées pour les différents projets exécutés',
'Dans cette section, vous trouverez un résumé de toutes les versions que vous avez réalisées pour les différents projets exécutés. Vous pouvez charger autant d´exécutions que vous le souhaitez à partir de la colonne des actions. Chaque exécution s´ouvrira dans un nouvel onglet en bas de l´écran, et la dernière exécution chargée sera sélectionnée par défaut.',
yesterday: 'Hier',
today: "Aujourd'hui",
last7days: '7 derniers jours',
Expand Down
5 changes: 5 additions & 0 deletions src/stores/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const useGeneralStore = defineStore('general', {
selectedExecution: null,
autoLoadInterval: null,
uploadComponentKey: 0,
tabBarKey: 0,
}),
actions: {
async initializeData() {
Expand Down Expand Up @@ -285,6 +286,10 @@ export const useGeneralStore = defineStore('general', {
this.uploadComponentKey++
},

incrementTabBarKey() {
return this.tabBarKey++
},

getTableDataKeys(collection: string, data: object): any[] {
const schemaChecks = this.schemaConfig[collection]
const schemaKeys = [...schemaChecks.required]
Expand Down
Loading

0 comments on commit 30a6841

Please sign in to comment.