Commit c8b94cb4 authored by dbulatovicx32's avatar dbulatovicx32
Browse files

KNOWAGE-7076, added max width to the column

parent 2769c4b4
......@@ -51,7 +51,7 @@
{{ $t('common.info.dataLoading') }}
</template>
<Column v-for="col of columns" :field="col.field" :header="$t(col.header)" :key="col.field" :sortable="true" :style="col.style" class="kn-truncated">
<Column v-for="col of columns" :field="col.field" :header="$t(col.header)" :key="col.field" :sortable="true" :style="[col.style, [col.field == 'valueCheck' ? 'max-width: 200px' : '']]" class="kn-truncated">
<template #filter="{ filterModel }">
<InputText type="text" v-model="filterModel.value" class="p-column-filter"></InputText>
</template>
......@@ -74,106 +74,106 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { iConfiguration } from './ConfigurationManagement'
import { FilterOperator } from 'primevue/api'
import { filterDefault } from '@/helpers/commons/filterHelper'
import configurationManagementDescriptor from './ConfigurationManagementDescriptor.json'
import { AxiosResponse } from 'axios'
import Column from 'primevue/column'
import DataTable from 'primevue/datatable'
import KnFabButton from '@/components/UI/KnFabButton.vue'
import ConfigurationManagementDialog from './ConfigurationManagementDialog.vue'
import { defineComponent } from 'vue'
import { iConfiguration } from './ConfigurationManagement'
import { FilterOperator } from 'primevue/api'
import { filterDefault } from '@/helpers/commons/filterHelper'
import configurationManagementDescriptor from './ConfigurationManagementDescriptor.json'
import { AxiosResponse } from 'axios'
import Column from 'primevue/column'
import DataTable from 'primevue/datatable'
import KnFabButton from '@/components/UI/KnFabButton.vue'
import ConfigurationManagementDialog from './ConfigurationManagementDialog.vue'
export default defineComponent({
name: 'configuration-management',
components: {
Column,
DataTable,
KnFabButton,
ConfigurationManagementDialog
},
data() {
return {
configurationManagementDescriptor: configurationManagementDescriptor,
configurations: [] as iConfiguration[],
selectedConfiguration: null as iConfiguration | null,
columns: configurationManagementDescriptor.columns,
formVisible: false,
loading: false,
export default defineComponent({
name: 'configuration-management',
components: {
Column,
DataTable,
KnFabButton,
ConfigurationManagementDialog
},
data() {
return {
configurationManagementDescriptor: configurationManagementDescriptor,
configurations: [] as iConfiguration[],
selectedConfiguration: null as iConfiguration | null,
columns: configurationManagementDescriptor.columns,
formVisible: false,
loading: false,
filters: {
global: [filterDefault],
label: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
name: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
category: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
valueCheck: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
active: {
operator: FilterOperator.AND,
constraints: [filterDefault]
}
} as Object
}
filters: {
global: [filterDefault],
label: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
name: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
category: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
valueCheck: {
operator: FilterOperator.AND,
constraints: [filterDefault]
},
active: {
operator: FilterOperator.AND,
constraints: [filterDefault]
}
} as Object
}
},
created() {
this.loadConfigurations()
},
methods: {
async loadConfigurations() {
this.loading = true
await this.$http
.get(process.env.VUE_APP_RESTFUL_SERVICES_PATH + '2.0/configs')
.then((response: AxiosResponse<any>) => {
this.configurations = response.data
})
.finally(() => (this.loading = false))
},
created() {
this.loadConfigurations()
showDeleteDialog(configurationId: number) {
this.$confirm.require({
message: this.$t('common.toast.deleteMessage'),
header: this.$t('common.toast.deleteConfirmTitle'),
icon: 'pi pi-exclamation-triangle',
accept: () => this.deleteConfiguration(configurationId)
})
},
methods: {
async loadConfigurations() {
this.loading = true
await this.$http
.get(process.env.VUE_APP_RESTFUL_SERVICES_PATH + '2.0/configs')
.then((response: AxiosResponse<any>) => {
this.configurations = response.data
})
.finally(() => (this.loading = false))
},
showDeleteDialog(configurationId: number) {
this.$confirm.require({
message: this.$t('common.toast.deleteMessage'),
header: this.$t('common.toast.deleteConfirmTitle'),
icon: 'pi pi-exclamation-triangle',
accept: () => this.deleteConfiguration(configurationId)
})
},
async deleteConfiguration(configurationId: number) {
await this.$http.delete(process.env.VUE_APP_RESTFUL_SERVICES_PATH + '2.0/configs/' + configurationId).then(() => {
this.$store.commit('setInfo', {
title: this.$t('common.toast.deleteTitle'),
msg: this.$t('common.toast.deleteSuccess')
})
this.loadConfigurations()
async deleteConfiguration(configurationId: number) {
await this.$http.delete(process.env.VUE_APP_RESTFUL_SERVICES_PATH + '2.0/configs/' + configurationId).then(() => {
this.$store.commit('setInfo', {
title: this.$t('common.toast.deleteTitle'),
msg: this.$t('common.toast.deleteSuccess')
})
},
showForm(event) {
if (event) {
this.selectedConfiguration = event.data
}
this.formVisible = true
},
closeForm() {
this.selectedConfiguration = null
this.formVisible = false
},
reload() {
this.formVisible = false
this.loadConfigurations()
})
},
showForm(event) {
if (event) {
this.selectedConfiguration = event.data
}
this.formVisible = true
},
closeForm() {
this.selectedConfiguration = null
this.formVisible = false
},
reload() {
this.formVisible = false
this.loadConfigurations()
}
})
}
})
</script>
<style lang="scss" scoped></style>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment