Skip to content

Commit

Permalink
Merge pull request #3185 from csordasmarton/fix_product_name_column
Browse files Browse the repository at this point in the history
[gui] Fix database status in product name column
  • Loading branch information
bruntib authored Feb 15, 2021
2 parents 92dd7f1 + 8698791 commit 1e06ffa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 49 deletions.
23 changes: 23 additions & 0 deletions web/server/vue-cli/src/components/Product/ProductNameColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,29 @@ export default {
icon: "mdi-chart-line", query: defaultReportFilterValues },
]
};
},
methods: {
dbStatusFromCodeToString(dbStatus) {
switch (parseInt(dbStatus)) {
case DBStatus.OK:
return "Database is up to date.";
case DBStatus.MISSING:
return "Database is missing.";
case DBStatus.FAILED_TO_CONNECT:
return "Failed to connect to the database.";
case DBStatus.SCHEMA_MISMATCH_OK:
return "Schema mismatch: migration is possible.";
case DBStatus.SCHEMA_MISMATCH_NO:
return "Schema mismatch: migration not available.";
case DBStatus.SCHEMA_MISSING:
return "Schema is missing.";
case DBStatus.SCHEMA_INIT_ERROR:
return "Schema initialization error.";
default:
console.warn("Non existing database status code: ", dbStatus);
return "N/A";
}
},
}
};
</script>
49 changes: 0 additions & 49 deletions web/server/vue-cli/src/views/Products.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,6 @@
<product-name-column :product="item" />
</template>

<template #item.description="{ item }">
<div
v-if="!item.accessible"
color="grey--text"
>
<v-icon>mdi-alert-outline</v-icon>
You do not have access to this product!
</div>

<div
v-else-if="item.databaseStatus !== DBStatus.OK"
class="error--text"
>
<v-icon>mdi-alert-outline</v-icon>
{{ dbStatusFromCodeToString(item.databaseStatus) }}
<span
v-if="item.databaseStatus === DBStatus.SCHEMA_MISMATCH_OK ||
item.databaseStatus === DBStatus.SCHEMA_MISSING"
>
Use <kbd>CodeChecker server</kbd> command for schema
upgrade/initialization.
</span>
</div>

{{ item.description }}
</template>

<template #item.admins="{ item }">
<span
v-for="admin in item.admins"
Expand Down Expand Up @@ -389,28 +362,6 @@ export default {
this.products = this.products.filter(p => p.id !== product.id);
},
dbStatusFromCodeToString(dbStatus) {
switch (parseInt(dbStatus)) {
case DBStatus.OK:
return "Database is up to date.";
case DBStatus.MISSING:
return "Database is missing.";
case DBStatus.FAILED_TO_CONNECT:
return "Failed to connect to the database.";
case DBStatus.SCHEMA_MISMATCH_OK:
return "Schema mismatch: migration is possible.";
case DBStatus.SCHEMA_MISMATCH_NO:
return "Schema mismatch: migration not available.";
case DBStatus.SCHEMA_MISSING:
return "Schema is missing.";
case DBStatus.SCHEMA_INIT_ERROR:
return "Schema initialization error.";
default:
console.warn("Non existing database status code: ", dbStatus);
return "N/A";
}
},
getRunCountColor(runCount) {
if (runCount > 500) {
return "red";
Expand Down

0 comments on commit 1e06ffa

Please sign in to comment.