-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(editor): Workflow history [WIP]- Add restore and clone into new …
…workflow actions (no-changelog) (#7359)
- Loading branch information
Showing
11 changed files
with
321 additions
and
46 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
90 changes: 90 additions & 0 deletions
90
packages/editor-ui/src/components/WorkflowHistory/WorkflowHistoryVersionRestoreModal.vue
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,90 @@ | ||
<script lang="ts" setup> | ||
import { useI18n } from '@/composables'; | ||
import Modal from '@/components/Modal.vue'; | ||
import { useUIStore } from '@/stores'; | ||
const props = defineProps<{ | ||
modalName: string; | ||
data: { | ||
isWorkflowActivated: boolean; | ||
formattedCreatedAt: string; | ||
beforeClose: () => void; | ||
buttons: Array<{ | ||
text: string; | ||
type: string; | ||
action: () => void; | ||
}>; | ||
}; | ||
}>(); | ||
const i18n = useI18n(); | ||
const uiStore = useUIStore(); | ||
const closeModal = () => { | ||
uiStore.closeModal(props.modalName); | ||
}; | ||
</script> | ||
|
||
<template> | ||
<Modal width="500px" :name="props.modalName" :before-close="props.data.beforeClose"> | ||
<template #header> | ||
<n8n-heading tag="h2" size="xlarge"> | ||
{{ i18n.baseText('workflowHistory.action.restore.modal.title') }} | ||
</n8n-heading> | ||
</template> | ||
<template #content> | ||
<div> | ||
<n8n-text> | ||
<i18n-t keypath="workflowHistory.action.restore.modal.subtitle" tag="span"> | ||
<template #date> | ||
<strong>{{ props.data.formattedCreatedAt }}</strong> | ||
</template> | ||
</i18n-t> | ||
<br /> | ||
<br /> | ||
<i18n-t | ||
v-if="props.data.isWorkflowActivated" | ||
keypath="workflowHistory.action.restore.modal.text" | ||
tag="span" | ||
> | ||
<template #buttonText> | ||
“{{ | ||
i18n.baseText('workflowHistory.action.restore.modal.button.deactivateAndRestore') | ||
}}” | ||
</template> | ||
</i18n-t> | ||
</n8n-text> | ||
</div> | ||
</template> | ||
<template #footer> | ||
<div :class="$style.footer"> | ||
<n8n-button | ||
v-for="(button, index) in props.data.buttons" | ||
size="medium" | ||
:key="index" | ||
:type="button.type" | ||
@click=" | ||
() => { | ||
button.action(); | ||
closeModal(); | ||
} | ||
" | ||
> | ||
{{ button.text }} | ||
</n8n-button> | ||
</div> | ||
</template> | ||
</Modal> | ||
</template> | ||
|
||
<style module lang="scss"> | ||
.footer { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-end; | ||
button { | ||
margin-left: var(--spacing-2xs); | ||
} | ||
} | ||
</style> |
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
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
Oops, something went wrong.