2021-09-22 00:23:37 -07:00
|
|
|
<template>
|
|
|
|
<el-drawer
|
|
|
|
:direction="direction"
|
2022-11-04 06:04:31 -07:00
|
|
|
:visible="uiStore.isModalOpen(this.$props.name)"
|
2021-09-22 00:23:37 -07:00
|
|
|
:size="width"
|
2021-12-19 03:50:02 -08:00
|
|
|
:before-close="close"
|
:zap: Add Value Survey (#2499)
* N8N-2619 Value Survey Front-end
* N8N-2619 Added Contact Prompt Modal and logic
* N8N-2619 Added Link to Toast Message on Successful submitting ValueSurvey
* N8N-2619 Updated TypeForm URL in ValueSurvey Success Toast
* N8N-2619 Fixed Typo placeholder for ValueSurvey and ContactPrompt Modal
* N8N-2619 Fixed Toast not close automatically in ValueSurvey, Make part of the title bold, Changed Font-sizes on Value Survey
* N8N-2619 Fixed Close Button on ValueSurvey, Vertical Allignment for Questions in ValueSurvey Drawer
* N8N-2619 Make Value Survey with static height
* N8N-2619 Fixed Telemetry Events on closing ValueSurvey
* N8N-2619 Updated N8NPrompt Interface, Added Dynamic Title and Description on ContactPrompt Modal
* N8N-2619 Reversed Answers in ValueSurveyModal
* N8N-2619 Added Telemetry Event on user close ValueSurvey on second Question
* N8N-2619 Re-work, Optimized, Simplify the code after technical review
* N8N-2619 Fixed If else statement in openUserPromptsIfPossible
* N8N-2619 Change Text under Email Box - ValueSurvey, ContactPrompt, Added new Telemetary Event on ValueSurvey Open, Fixed Toast to close aftet 15s
* N8N-2619 Change ContactPrompt Modal to use Atoms like N8N-Heading and N8N-Text
* N8N-2619 Change Design & Logic on ValueSurvey - When to open
* N8N-2619 Updated Value Survey with new Telemetry Events (Refactor), Simplified functions, Added Atoms in ValueSurvey + ContactPrompt
* N8N-2619 Refactor in Interfaces, Updated/Refactor Getters and Vuex store props
* N8N-2619 Defined IN8nValueSurveyData interface
* N8N-2619 Disabled Keyboard shortcuts to be activated on typing in ValueSurvey Input field, Fire an event on Saving WF from Menu and with shorcut, Make Drawer keep-alive
* N8N-2619 Added Atoms in Value Survey Modal (buttons), Rework css
* N8N-2619 Added Responses on ValueSurvey Submit
* N8N-2619 Added Response for SubmittingContactInfo
* N8N-2619 Added loading state for buttons / ValueSurvey
* N8N-2619 Changed ValueSurvey and ContactPrompt to support enter key on submit, Simplifed closeDialog Function, Changed css for button in ValueSurvey, Prevent showing the Modals if Saving WF fails, Add Debouncing on showing prompt
* N8N-2619 Added IsTelemetryEnabled Getter in Vuex.store
* N8N-2619 Created/Added N8N-SquareButton to Design-system
* N8N-2619 Change Promise in MainSideBar with Async/Await function, Nitpick simpliefied
* N8N-2619 Update the text under the input fields
* N8N-2619 Update the text in ContactPrompt Modal
* N8N-2619 Allign Send button on ValueSurvey Modal
* N8N-2619 Fixed Input in ValueSurvey Modal
* N8N-2619 Check if the workflow is saving
* N8N-2619 Check if WF is saving to allowed performs fetchPromptsData
* N8N-2619 Hotfix
* N8N-2619 Fixed ValueSurvey, Updated onSaveButtonClick function, Created onSaveKeyboardShortcut function in NodeView
* N8N-2619 Rework css module classes for ValueSurvey, Simplified
* N8N-2619 Simplified N8N-SquareButton Component, removed dead code
* N8N-2619 Added Breakpoints for Mobile/Tablet View
* N8N-2619 Formatting fix
* N8N-2619 Update css for mobile/tablet, change promises to asyn/await functions in ContactPrompt and ValueSurvey, Added isActive prop to ValueSurvey
* N8N-2619 Update TEMPLATE_BASE_URL to production
2021-12-11 08:38:16 -08:00
|
|
|
:modal="modal"
|
|
|
|
:wrapperClosable="wrapperClosable"
|
2021-09-22 00:23:37 -07:00
|
|
|
>
|
|
|
|
<template v-slot:title>
|
|
|
|
<slot name="header" />
|
|
|
|
</template>
|
|
|
|
<template>
|
2021-12-19 03:27:48 -08:00
|
|
|
<span @keydown.stop>
|
|
|
|
<slot name="content"/>
|
|
|
|
</span>
|
2021-09-22 00:23:37 -07:00
|
|
|
</template>
|
|
|
|
</el-drawer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-11-04 06:04:31 -07:00
|
|
|
import { useUIStore } from "@/stores/ui";
|
|
|
|
import { mapStores } from "pinia";
|
2021-09-22 00:23:37 -07:00
|
|
|
import Vue from "vue";
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
name: "ModalDrawer",
|
|
|
|
props: {
|
|
|
|
name: {
|
|
|
|
type: String,
|
|
|
|
},
|
:zap: Add Value Survey (#2499)
* N8N-2619 Value Survey Front-end
* N8N-2619 Added Contact Prompt Modal and logic
* N8N-2619 Added Link to Toast Message on Successful submitting ValueSurvey
* N8N-2619 Updated TypeForm URL in ValueSurvey Success Toast
* N8N-2619 Fixed Typo placeholder for ValueSurvey and ContactPrompt Modal
* N8N-2619 Fixed Toast not close automatically in ValueSurvey, Make part of the title bold, Changed Font-sizes on Value Survey
* N8N-2619 Fixed Close Button on ValueSurvey, Vertical Allignment for Questions in ValueSurvey Drawer
* N8N-2619 Make Value Survey with static height
* N8N-2619 Fixed Telemetry Events on closing ValueSurvey
* N8N-2619 Updated N8NPrompt Interface, Added Dynamic Title and Description on ContactPrompt Modal
* N8N-2619 Reversed Answers in ValueSurveyModal
* N8N-2619 Added Telemetry Event on user close ValueSurvey on second Question
* N8N-2619 Re-work, Optimized, Simplify the code after technical review
* N8N-2619 Fixed If else statement in openUserPromptsIfPossible
* N8N-2619 Change Text under Email Box - ValueSurvey, ContactPrompt, Added new Telemetary Event on ValueSurvey Open, Fixed Toast to close aftet 15s
* N8N-2619 Change ContactPrompt Modal to use Atoms like N8N-Heading and N8N-Text
* N8N-2619 Change Design & Logic on ValueSurvey - When to open
* N8N-2619 Updated Value Survey with new Telemetry Events (Refactor), Simplified functions, Added Atoms in ValueSurvey + ContactPrompt
* N8N-2619 Refactor in Interfaces, Updated/Refactor Getters and Vuex store props
* N8N-2619 Defined IN8nValueSurveyData interface
* N8N-2619 Disabled Keyboard shortcuts to be activated on typing in ValueSurvey Input field, Fire an event on Saving WF from Menu and with shorcut, Make Drawer keep-alive
* N8N-2619 Added Atoms in Value Survey Modal (buttons), Rework css
* N8N-2619 Added Responses on ValueSurvey Submit
* N8N-2619 Added Response for SubmittingContactInfo
* N8N-2619 Added loading state for buttons / ValueSurvey
* N8N-2619 Changed ValueSurvey and ContactPrompt to support enter key on submit, Simplifed closeDialog Function, Changed css for button in ValueSurvey, Prevent showing the Modals if Saving WF fails, Add Debouncing on showing prompt
* N8N-2619 Added IsTelemetryEnabled Getter in Vuex.store
* N8N-2619 Created/Added N8N-SquareButton to Design-system
* N8N-2619 Change Promise in MainSideBar with Async/Await function, Nitpick simpliefied
* N8N-2619 Update the text under the input fields
* N8N-2619 Update the text in ContactPrompt Modal
* N8N-2619 Allign Send button on ValueSurvey Modal
* N8N-2619 Fixed Input in ValueSurvey Modal
* N8N-2619 Check if the workflow is saving
* N8N-2619 Check if WF is saving to allowed performs fetchPromptsData
* N8N-2619 Hotfix
* N8N-2619 Fixed ValueSurvey, Updated onSaveButtonClick function, Created onSaveKeyboardShortcut function in NodeView
* N8N-2619 Rework css module classes for ValueSurvey, Simplified
* N8N-2619 Simplified N8N-SquareButton Component, removed dead code
* N8N-2619 Added Breakpoints for Mobile/Tablet View
* N8N-2619 Formatting fix
* N8N-2619 Update css for mobile/tablet, change promises to asyn/await functions in ContactPrompt and ValueSurvey, Added isActive prop to ValueSurvey
* N8N-2619 Update TEMPLATE_BASE_URL to production
2021-12-11 08:38:16 -08:00
|
|
|
beforeClose: {
|
|
|
|
type: Function,
|
|
|
|
},
|
2021-09-22 00:23:37 -07:00
|
|
|
eventBus: {
|
|
|
|
type: Vue,
|
|
|
|
},
|
|
|
|
direction: {
|
|
|
|
type: String,
|
|
|
|
},
|
:zap: Add Value Survey (#2499)
* N8N-2619 Value Survey Front-end
* N8N-2619 Added Contact Prompt Modal and logic
* N8N-2619 Added Link to Toast Message on Successful submitting ValueSurvey
* N8N-2619 Updated TypeForm URL in ValueSurvey Success Toast
* N8N-2619 Fixed Typo placeholder for ValueSurvey and ContactPrompt Modal
* N8N-2619 Fixed Toast not close automatically in ValueSurvey, Make part of the title bold, Changed Font-sizes on Value Survey
* N8N-2619 Fixed Close Button on ValueSurvey, Vertical Allignment for Questions in ValueSurvey Drawer
* N8N-2619 Make Value Survey with static height
* N8N-2619 Fixed Telemetry Events on closing ValueSurvey
* N8N-2619 Updated N8NPrompt Interface, Added Dynamic Title and Description on ContactPrompt Modal
* N8N-2619 Reversed Answers in ValueSurveyModal
* N8N-2619 Added Telemetry Event on user close ValueSurvey on second Question
* N8N-2619 Re-work, Optimized, Simplify the code after technical review
* N8N-2619 Fixed If else statement in openUserPromptsIfPossible
* N8N-2619 Change Text under Email Box - ValueSurvey, ContactPrompt, Added new Telemetary Event on ValueSurvey Open, Fixed Toast to close aftet 15s
* N8N-2619 Change ContactPrompt Modal to use Atoms like N8N-Heading and N8N-Text
* N8N-2619 Change Design & Logic on ValueSurvey - When to open
* N8N-2619 Updated Value Survey with new Telemetry Events (Refactor), Simplified functions, Added Atoms in ValueSurvey + ContactPrompt
* N8N-2619 Refactor in Interfaces, Updated/Refactor Getters and Vuex store props
* N8N-2619 Defined IN8nValueSurveyData interface
* N8N-2619 Disabled Keyboard shortcuts to be activated on typing in ValueSurvey Input field, Fire an event on Saving WF from Menu and with shorcut, Make Drawer keep-alive
* N8N-2619 Added Atoms in Value Survey Modal (buttons), Rework css
* N8N-2619 Added Responses on ValueSurvey Submit
* N8N-2619 Added Response for SubmittingContactInfo
* N8N-2619 Added loading state for buttons / ValueSurvey
* N8N-2619 Changed ValueSurvey and ContactPrompt to support enter key on submit, Simplifed closeDialog Function, Changed css for button in ValueSurvey, Prevent showing the Modals if Saving WF fails, Add Debouncing on showing prompt
* N8N-2619 Added IsTelemetryEnabled Getter in Vuex.store
* N8N-2619 Created/Added N8N-SquareButton to Design-system
* N8N-2619 Change Promise in MainSideBar with Async/Await function, Nitpick simpliefied
* N8N-2619 Update the text under the input fields
* N8N-2619 Update the text in ContactPrompt Modal
* N8N-2619 Allign Send button on ValueSurvey Modal
* N8N-2619 Fixed Input in ValueSurvey Modal
* N8N-2619 Check if the workflow is saving
* N8N-2619 Check if WF is saving to allowed performs fetchPromptsData
* N8N-2619 Hotfix
* N8N-2619 Fixed ValueSurvey, Updated onSaveButtonClick function, Created onSaveKeyboardShortcut function in NodeView
* N8N-2619 Rework css module classes for ValueSurvey, Simplified
* N8N-2619 Simplified N8N-SquareButton Component, removed dead code
* N8N-2619 Added Breakpoints for Mobile/Tablet View
* N8N-2619 Formatting fix
* N8N-2619 Update css for mobile/tablet, change promises to asyn/await functions in ContactPrompt and ValueSurvey, Added isActive prop to ValueSurvey
* N8N-2619 Update TEMPLATE_BASE_URL to production
2021-12-11 08:38:16 -08:00
|
|
|
modal: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-09-22 00:23:37 -07:00
|
|
|
width: {
|
|
|
|
type: String,
|
|
|
|
},
|
:zap: Add Value Survey (#2499)
* N8N-2619 Value Survey Front-end
* N8N-2619 Added Contact Prompt Modal and logic
* N8N-2619 Added Link to Toast Message on Successful submitting ValueSurvey
* N8N-2619 Updated TypeForm URL in ValueSurvey Success Toast
* N8N-2619 Fixed Typo placeholder for ValueSurvey and ContactPrompt Modal
* N8N-2619 Fixed Toast not close automatically in ValueSurvey, Make part of the title bold, Changed Font-sizes on Value Survey
* N8N-2619 Fixed Close Button on ValueSurvey, Vertical Allignment for Questions in ValueSurvey Drawer
* N8N-2619 Make Value Survey with static height
* N8N-2619 Fixed Telemetry Events on closing ValueSurvey
* N8N-2619 Updated N8NPrompt Interface, Added Dynamic Title and Description on ContactPrompt Modal
* N8N-2619 Reversed Answers in ValueSurveyModal
* N8N-2619 Added Telemetry Event on user close ValueSurvey on second Question
* N8N-2619 Re-work, Optimized, Simplify the code after technical review
* N8N-2619 Fixed If else statement in openUserPromptsIfPossible
* N8N-2619 Change Text under Email Box - ValueSurvey, ContactPrompt, Added new Telemetary Event on ValueSurvey Open, Fixed Toast to close aftet 15s
* N8N-2619 Change ContactPrompt Modal to use Atoms like N8N-Heading and N8N-Text
* N8N-2619 Change Design & Logic on ValueSurvey - When to open
* N8N-2619 Updated Value Survey with new Telemetry Events (Refactor), Simplified functions, Added Atoms in ValueSurvey + ContactPrompt
* N8N-2619 Refactor in Interfaces, Updated/Refactor Getters and Vuex store props
* N8N-2619 Defined IN8nValueSurveyData interface
* N8N-2619 Disabled Keyboard shortcuts to be activated on typing in ValueSurvey Input field, Fire an event on Saving WF from Menu and with shorcut, Make Drawer keep-alive
* N8N-2619 Added Atoms in Value Survey Modal (buttons), Rework css
* N8N-2619 Added Responses on ValueSurvey Submit
* N8N-2619 Added Response for SubmittingContactInfo
* N8N-2619 Added loading state for buttons / ValueSurvey
* N8N-2619 Changed ValueSurvey and ContactPrompt to support enter key on submit, Simplifed closeDialog Function, Changed css for button in ValueSurvey, Prevent showing the Modals if Saving WF fails, Add Debouncing on showing prompt
* N8N-2619 Added IsTelemetryEnabled Getter in Vuex.store
* N8N-2619 Created/Added N8N-SquareButton to Design-system
* N8N-2619 Change Promise in MainSideBar with Async/Await function, Nitpick simpliefied
* N8N-2619 Update the text under the input fields
* N8N-2619 Update the text in ContactPrompt Modal
* N8N-2619 Allign Send button on ValueSurvey Modal
* N8N-2619 Fixed Input in ValueSurvey Modal
* N8N-2619 Check if the workflow is saving
* N8N-2619 Check if WF is saving to allowed performs fetchPromptsData
* N8N-2619 Hotfix
* N8N-2619 Fixed ValueSurvey, Updated onSaveButtonClick function, Created onSaveKeyboardShortcut function in NodeView
* N8N-2619 Rework css module classes for ValueSurvey, Simplified
* N8N-2619 Simplified N8N-SquareButton Component, removed dead code
* N8N-2619 Added Breakpoints for Mobile/Tablet View
* N8N-2619 Formatting fix
* N8N-2619 Update css for mobile/tablet, change promises to asyn/await functions in ContactPrompt and ValueSurvey, Added isActive prop to ValueSurvey
* N8N-2619 Update TEMPLATE_BASE_URL to production
2021-12-11 08:38:16 -08:00
|
|
|
wrapperClosable: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2021-09-22 00:23:37 -07:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
window.addEventListener('keydown', this.onWindowKeydown);
|
|
|
|
|
|
|
|
if (this.$props.eventBus) {
|
|
|
|
this.$props.eventBus.$on('close', () => {
|
|
|
|
this.close();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const activeElement = document.activeElement as HTMLElement;
|
|
|
|
if (activeElement) {
|
|
|
|
activeElement.blur();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
window.removeEventListener('keydown', this.onWindowKeydown);
|
|
|
|
},
|
2022-11-04 06:04:31 -07:00
|
|
|
computed: {
|
|
|
|
...mapStores(useUIStore),
|
|
|
|
},
|
2021-09-22 00:23:37 -07:00
|
|
|
methods: {
|
|
|
|
onWindowKeydown(event: KeyboardEvent) {
|
2022-11-04 06:04:31 -07:00
|
|
|
if (!this.uiStore.isModalActive(this.$props.name)) {
|
2021-09-22 00:23:37 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event && event.keyCode === 13) {
|
|
|
|
this.handleEnter();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
handleEnter() {
|
2022-11-04 06:04:31 -07:00
|
|
|
if (this.uiStore.isModalActive(this.$props.name)) {
|
2021-09-22 00:23:37 -07:00
|
|
|
this.$emit('enter');
|
|
|
|
}
|
|
|
|
},
|
2022-01-21 09:00:00 -08:00
|
|
|
async close() {
|
2021-12-19 03:50:02 -08:00
|
|
|
if (this.beforeClose) {
|
2022-01-21 09:00:00 -08:00
|
|
|
const shouldClose = await this.beforeClose();
|
|
|
|
if (shouldClose === false) { // must be strictly false to stop modal from closing
|
|
|
|
return;
|
|
|
|
}
|
2021-12-19 03:50:02 -08:00
|
|
|
}
|
2022-11-04 06:04:31 -07:00
|
|
|
this.uiStore.closeModal(this.$props.name);
|
2021-09-22 00:23:37 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.el-drawer__header {
|
|
|
|
margin: 0;
|
|
|
|
padding: 30px 30px 0 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-drawer__body {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
</style>
|