-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TT#134305 Create generic Proxy mechanism for extracting detail page s…
…ections from v1 Ex: extract sections of Reseller Details' accordion from v1 Additional changes: * "GoTo old Admin Panel" button extracted to a separate component * refactored page titles (Meta section). Proxying titles from V1 can be disabled * removed unnecessary double vertical scrollbar on proxied pages Change-Id: I6f2112aa5866248a93ae416255f074f04934e93a
- Loading branch information
1 parent
a276b9f
commit 3b6b0c6
Showing
10 changed files
with
260 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<q-btn | ||
color="primary" | ||
unelevated | ||
flat | ||
icon-right="logout" | ||
:label="$t('Go to old admin panel')" | ||
@click="goToOldAdminPanel" | ||
> | ||
<q-menu | ||
no-parent-event | ||
persistent | ||
:value="goToOldAdminPanelInfo" | ||
transition-show="flip-up" | ||
transition-hide="flip-down" | ||
> | ||
<q-banner | ||
class="bg-info text-white" | ||
dense | ||
inline-actions | ||
> | ||
{{ $t('You can switch to the old admin panel at anytime') }} | ||
<template v-slot:action> | ||
<q-btn | ||
flat | ||
color="white" | ||
:label="$t('Close')" | ||
@click="closeGoToOldAdminPanelInfo" | ||
/> | ||
</template> | ||
<template v-slot:avatar> | ||
<q-icon | ||
name="info" | ||
color="white" | ||
/> | ||
</template> | ||
</q-banner> | ||
</q-menu> | ||
</q-btn> | ||
</template> | ||
|
||
<script> | ||
import { | ||
mapState, | ||
mapActions | ||
} from 'vuex' | ||
export default { | ||
name: 'AuiGoToOldAdminPanel', | ||
computed: { | ||
...mapState('user', [ | ||
'goToOldAdminPanelInfo' | ||
]) | ||
}, | ||
mounted () { | ||
this.loadGoToOldAdminPanelInfo() | ||
}, | ||
methods: { | ||
...mapActions('user', [ | ||
'goToOldAdminPanel', | ||
'closeGoToOldAdminPanelInfo', | ||
'loadGoToOldAdminPanelInfo' | ||
]) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<proxy | ||
:proxy-page-title="false" | ||
@loaded="pageLoaded" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import Proxy from 'pages/Proxy' | ||
export default { | ||
name: 'AuiDetailsPageProxy', | ||
components: { Proxy }, | ||
methods: { | ||
pageLoaded ({ iframeWindow, route, url }) { | ||
const navigationInsideIFrame = route.path.indexOf(url) === -1 | ||
// skip manipulation with DetailsPage section if there was navigation inside IFrame and we are on another page | ||
if (!navigationInsideIFrame) { | ||
const accordionSectionId = route?.meta?.proxyDetailsSectionId | ||
const $ = iframeWindow?.$ | ||
if (typeof $ === 'function') { | ||
// hide (remove) "expand groups" button | ||
$('#toggle-accordions').remove() | ||
$('#content .ngcp-separator:first').remove() | ||
// hide (remove) all sections except required one | ||
$('.accordion-group').filter(function () { | ||
return $(`.accordion-body[id="${accordionSectionId}"]`, this).length !== 1 | ||
}).remove() | ||
// auto-expand accordion section | ||
iframeWindow.localStorage.setItem('lastTab', accordionSectionId) | ||
$(`#${accordionSectionId}`).addClass('in') | ||
.parent().addClass('open') | ||
.find('.accordion-heading').remove().end() | ||
.find('.accordion-toggle').removeClass('collapsed').end() | ||
.find('.accordion-inner').css('border', 'none') | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="sass" rel="stylesheet/sass" scoped> | ||
.proxy-iframe-wrapper::v-deep | ||
height: calc(100vh - 150px) | ||
.proxy-iframe | ||
height: calc(100vh - 150px) | ||
</style> |
Oops, something went wrong.