8000 feat: modify zclclusterview popup to page by tbrkollar · Pull Request #1383 · project-chip/zap · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: modify zclclusterview popup to page #1383

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

Merged
merged 11 commits into from
Aug 9, 2024
Merged
8 changes: 4 additions & 4 deletions cypress/e2e/attributes/check-required-attributes.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ describe('Testing disabling enabled attributes', () => {
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get(
'.table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
'.attribute_table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner '
).click()
cy.get(
'.table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
'.attribute_table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
).should('be.visible')
cy.get(
'.table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
'.attribute_table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
).click()
cy.contains(
'.table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
'.attribute_table_body:first > :nth-child(2) > .q-mt-xs > .q-toggle__inner'
).should('not.exist')
}
)
Expand Down
56 changes: 56 additions & 0 deletions cypress/e2e/ui/notification-panel.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/// <reference types="cypress" />

Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})

describe('Check notification panel functionality', () => {
it('Set Data', () => {
cy.fixture('baseurl').then((data) => {
cy.visit(data.baseurl)
})
cy.setZclProperties()
})
it(
'Open notification panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('not.have.class', ' q-layout--prevent-focus')
}
)
it('Check active status on navbar', () => {
cy.get('#Notifications').should('have.class', 'navmenu-item--active')
})
it(
'Close notification panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('have.class', 'q-layout--prevent-focus')
}
)
it(
'Open notification panel and open preview panel',
{ retries: { runMode: 2, openMode: 2 } },
() => {
cy.get('#Notifications').click()
cy.wait(500)
cy.get('#NotificationPanel')
.parent()
.should('not.have.class', 'q-layout--prevent-focus')
cy.get('#Preview').click()
cy.get('#NotificationPanel')
.parent()
.should('have.class', 'q-layout--prevent-focus')
}
)
})
77 changes: 49 additions & 28 deletions src/components/ZCLToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:class="{ 'window-button-padding-right': isElectron && isWin }"
>
<q-toolbar-title
:class="{ 'logo-margin': showPreviewTab }"
:class="{ 'logo-margin': showPreviewTab || showNotificationTab }"
style="width: 180px"
>
<Transition mode="out-in" name="slide-up">
Expand Down Expand Up @@ -114,31 +114,35 @@
</div>
</q-btn>
</router-link>
<router-link v-slot="{ isActive, navigate }" to="/notifications">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you just remove router-link here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and i added a click function to btn, similar to preview btn

<q-btn
class="navmenu-item"
:class="{ 'navmenu-item--active': isActive }"
flat
no-caps
id="Notifications"
@click="navigate"
>
<div class="text-center">
<q-icon name="o_assignment_late" />
<div>
Notifications
<q-badge
style="top: 5px; right: 5px"
color="red"
floating
v-if="this.$store.state.zap.notificationCount > 0"
>
{{ this.$store.state.zap.notificationCount }}
</q-badge>
</div>

<q-btn
class="navmenu-item"
:class="{ 'navmenu-item--active': showNotificationTab }"
flat
no-caps
id="Notifications"
@click="
() => {
toggleNotificationTab()
}
"
>
<div class="text-center">
<q-icon name="o_assignment_late" />
<div>
Notifications
<q-badge
style="top: 5px; right: 5px"
color="red"
floating
v-if="this.$store.state.zap.notificationCount > 0"
>
{{ this.$store.state.zap.notificationCount }}
</q-badge>
</div>
</q-btn>
</router-link>
</div>
</q-btn>

<q-btn
v-if="showDebugNavItems"
class="navmenu-item"
Expand Down Expand Up @@ -261,6 +265,14 @@ export default {
return this.$store.dispatch('zap/togglePreviewTab')
},
},
showNotificationTab: {
get() {
return this.$store.state.zap.showNotificationTab
},
set() {
return this.$store.dispatch('zap/toggleNotificationTab')
},
},
9E81 isMultiProtocolTutorialAvailable: {
get() {
return this.$store.state.zap.isMultiConfig
Expand Down Expand Up @@ -307,8 +319,17 @@ export default {
window[rendApi.GLOBAL_SYMBOL_EXECUTE](rendApi.id.save)
},
togglePreviewTab() {
if (this.showNotificationTab) {
this.$store.commit('zap/toggleNotificationTab')
}
this.$store.commit('zap/togglePreviewTab')
},
toggleNotificationTab() {
if (this.showPreviewTab) {
this.$store.commit('zap/togglePreviewTab')
}
this.$store.commit('zap/toggleNotificationTab')
},
generateIntoDirectory(currentPath) {
window[rendApi.GLOBAL_SYMBOL_NOTIFY](rendApi.notifyKey.fileBrowse, {
context: 'generateDir',
Expand Down Expand Up @@ -369,9 +390,6 @@ export default {
}
</script>
<style lang="scss" scoped>
.logo-margin {
margin-left: 75px;
}
.navmenu-item {
font-size: 10px;
padding: 15px 20px;
Expand Down Expand Up @@ -420,4 +438,7 @@ export default {
.image-space:not(:last-of-type) {
margin-right: 15px;
}
.logo-margin {
margin-left: 75px;
}
</style>
3 changes: 2 additions & 1 deletion src/components/ZclAttributeManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ limitations under the License.
:sort-method="customAttributeSort"
data-cy="Attributes"
separator="horizontal"
id="ZclAttributeManager"
>
<template v-slot:body="props">
<q-tr
:props="props"
class="table_body"
class="table_body attribute_table_body"
v-if="!globalLists.includes(props.row.label)"
>
<q-td
Expand Down
Loading
Loading
0