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

[gui] Fix database status in product name column #3185

Merged
merged 1 commit into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
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
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