Skip to content

Commit

Permalink
refactor: add disabled accordion tab when it ready
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloSF0 committed Jan 28, 2025
1 parent 270cc42 commit 7b6f039
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/templates/action-bar-block/action-bar-accordion.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup>
import { computed } from 'vue'
import PrimeButton from 'primevue/button'
defineOptions({ name: 'action-bar-block' })
const emit = defineEmits(['onSubmit', 'onCancel'])
Expand Down
1 change: 1 addition & 0 deletions src/templates/action-bar-block/action-bar-skit-config.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup>
import { computed } from 'vue'
import PrimeButton from 'primevue/button'
defineOptions({ name: 'action-bar-block' })
const emit = defineEmits(['onSubmit', 'onCancel'])
Expand Down
1 change: 1 addition & 0 deletions src/templates/action-bar-block/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup>
import { computed } from 'vue'
import PrimeButton from 'primevue/button'
defineOptions({ name: 'action-bar-block' })
const emit = defineEmits(['onSubmit', 'onCancel'])
Expand Down
13 changes: 13 additions & 0 deletions src/views/EdgeApplications/Config/ConfigView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}"
>
<AccordionTab
:disabled="hasCreateOrigin"
:pt="{
content: { class: 'p-0 pt-2' },
headerAction: { class: hideOriginBorder },
Expand All @@ -43,6 +44,7 @@
<OriginEdgeApplcation></OriginEdgeApplcation>
</AccordionTab>
<AccordionTab
:disabled="hasBindDomain"
:pt="{
content: { class: 'p-0 pt-2' },
header: { class: 'border-t surface-border rounded-md' },
Expand Down Expand Up @@ -70,6 +72,7 @@
/>
</AccordionTab>
<AccordionTab
:disabled="hasCreateCache"
:pt="{
content: { class: 'p-0 pt-2' },
header: { class: 'border-t surface-border rounded-md' },
Expand Down Expand Up @@ -97,6 +100,7 @@
<actionBarSkitConfig
:finishedConfiguration="finishedConfiguration"
:primaryActionLabel="primaryActionLabel"
@onSubmit="onSubmit"
/>
</div>
</template>
Expand All @@ -108,6 +112,7 @@
import CacheEdgeApplication from './CacheEdgeApplication.vue'
import actionBarSkitConfig from '@/templates/action-bar-block/action-bar-skit-config.vue'
import PrimeButton from 'primevue/button'
import { useRoute, useRouter } from 'vue-router'
import { ref, computed } from 'vue'
const props = defineProps({
Expand All @@ -118,6 +123,10 @@
const hasBindDomain = ref(true)
const hasCreateOrigin = ref(true)
const hasCreateCache = ref(true)
const route = useRoute()
const router = useRouter()
const edgeApplicationId = ref(route.params.id)
const STYLE_HEADER_ACCORDION = 'flex flex-row-reverse p-8 gap-2'
const STYLE_HEADER_HIDE_BORDER = `${STYLE_HEADER_ACCORDION} border-b-0`
Expand Down Expand Up @@ -183,4 +192,8 @@
const primaryActionLabel = computed(() =>
finishedConfiguration.value ? 'Finish Setup' : 'Skip Configuration'
)
const onSubmit = () => {
router.push({ name: 'edit-edge-application', params: { id: edgeApplicationId } })
}
</script>

0 comments on commit 7b6f039

Please sign in to comment.