Skip to content

Commit

Permalink
fix: added conditional rendering for row reorder icon and disabled st…
Browse files Browse the repository at this point in the history
…ate for input
  • Loading branch information
lucasmendes21 committed Dec 19, 2024
1 parent 0aa7bae commit e2d006f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/templates/list-table-block/v2/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<i
class="pi pi-bars cursor-move mr-4 hidden md:inline disabled-click-row"
data-pc-section="rowreordericon"
v-if="rowData.phase.content !== 'Default'"
/>
<InputNumber
v-model="rowData.position.value"
Expand All @@ -98,6 +99,7 @@
:min="rowData.position.min"
:max="rowData.position.max"
:pt="{ input: { class: 'w-11 text-center' } }"
:disabled="rowData.phase.content === 'Default'"
>
<template #incrementbuttonicon>
<span class="pi pi-chevron-down" />
Expand Down
15 changes: 14 additions & 1 deletion src/views/EdgeApplicationsRulesEngine/ListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
import { useToast } from 'primevue/usetoast'
import PrimeButton from 'primevue/button'
import { computed, ref, inject } from 'vue'
import { storeToRefs } from 'pinia'
import { useAccountStore } from '@/stores/account'
import orderDialog from '@/views/EdgeApplicationsRulesEngine/Dialog/order-dialog.vue'
/**@type {import('@/plugins/analytics/AnalyticsTrackerAdapter').AnalyticsTrackerAdapter} */
const tracker = inject('tracker')
const { currentTheme } = storeToRefs(useAccountStore())
defineOptions({ name: 'list-edge-applications-device-groups-tab' })
const props = defineProps({
Expand Down Expand Up @@ -249,6 +253,14 @@
}
})
}
const badgeClass = computed(() => {
if (currentTheme.value !== 'dark') {
return 'p-badge-lg !text-black bg-white !border-surface h-5 min-w-[20px] !text-xl'
} else {
return 'p-badge-lg !text-white bg-black !border-surface h-5 min-w-[20px] !text-xl'
}
})
</script>
<template>
Expand Down Expand Up @@ -322,7 +334,8 @@
<PrimeButton
label="Review Changes"
badgeClass="p-badge-lg !text-black !bg-white !border-surface h-5 min-w-[20px] !text-xl"
class="bg-surface"
:badgeClass="badgeClass"
:loading="isLoadingButtonOrder"
:disabled="isLoadingButtonOrder"
data-testid="rules-engine-save-order-button"
Expand Down

0 comments on commit e2d006f

Please sign in to comment.