Skip to content

Commit

Permalink
Merge pull request #4585 from FlowFuse/snapshto-deployment-terminology
Browse files Browse the repository at this point in the history
Update snapshot nomenclature
  • Loading branch information
joepavitt authored Sep 27, 2024
2 parents 9c86060 + b9aeca5 commit 03a42dc
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/migration/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Instance > Settings > Environment tabs.

## Starting the snapshot

Under the snapshots tab, click 'Deploy Snapshot' in the kebab menu. The migrated flows
Under the snapshots tab, click 'Restore Snapshot' in the kebab menu. The migrated flows
will now be started with the modules installed.

## Limitations
Expand Down
2 changes: 1 addition & 1 deletion docs/migration/node-red-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ You can then create a new snapshot using the flows you have running locally.
4. Click 'Create Snapshot'

At this point, a new snapshot will be created in FlowFuse. You can then switch
to the FlowFuse platform and from the Snapshots menu either select the 'Deploy Snapshot'
to the FlowFuse platform and from the Snapshots menu either select the 'Restore Snapshot'
option to deploy that snapshot, or set it as the Device Target to deploy it to your
devices.

Expand Down
4 changes: 2 additions & 2 deletions docs/user/snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ next time it checks in.
To set the **Device Target** of an application owned device:

1. Go to the devices's page and select the **Snapshots** tab.
2. In the list of snapshots available, a "Deploy Snapshot" button will be displayed
2. In the list of snapshots available, a "Restore Snapshot" button will be displayed
for each snapshot as you hover over it.
3. You will be asked to confirm - click the **Confirm** button to set it as the target snapshot.

Expand Down Expand Up @@ -140,4 +140,4 @@ and selecting "View Snapshot".
_Screenshot to show the available "Actions" for a given Snapshot_

![Screenshot to an example flow preview for a Snapshot in FlowFuse](./images/snapshots-preview.png)
_Screenshot to an example flow preview for a Snapshot in FlowFuse_
_Screenshot to an example flow preview for a Snapshot in FlowFuse_
2 changes: 1 addition & 1 deletion docs/user/team/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ table summaries what actions are available to the different roles.
| • Modify Flows ||| - | - |
| **Snapshots** | | | | |
| • Create Snapshot ||| - | - |
|Deploy Snapshot ||| - | - |
|Restore Snapshot ||| - | - |
| • Set as Device Target ||| - | - |
| • View Snapshots |||| - |
| • Download Snapshot ||| - | - |
Expand Down
2 changes: 1 addition & 1 deletion forge/services/snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function setSnapShotAsTarget (app, snapshot, instance, user) {
}

/**
* Generate a name for a deploy snapshot
* Generate a name for a restore snapshot
* Optionally using the name of the source snapshot, stripping out the deploy timing info
* @param {*} sourceSnapshot
* @returns string
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/device/Snapshots/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ff-button kind="primary" data-action="create-snapshot" :disabled="!developerMode || busy" @click="showCreateSnapshotDialog"><template #icon-left><PlusSmIcon /></template>Create Snapshot</ff-button>
</template>
<template #context-menu="{row}">
<ff-list-item :disabled="!canDeploy(row)" label="Deploy Snapshot" @click="showDeploySnapshotDialog(row)" />
<ff-list-item :disabled="!canDeploy(row)" label="Restore Snapshot" @click="showDeploySnapshotDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:edit')" label="Edit Snapshot" @click="showEditSnapshotDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:full')" label="View Snapshot" @click="showViewSnapshotDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:full')" label="Compare Snapshot..." @click="showCompareSnapshotDialog(row)" />
Expand Down Expand Up @@ -316,13 +316,13 @@ export default {
Alerts.emit('This snapshot is already deployed to this device.', 'info', 7500)
return
}
let body = `Are you sure you want to deploy snapshot '${snapshot.name}' to this device?`
let body = `Are you sure you want to restore snapshot '${snapshot.name}' to this device?`
if (snapshot.device?.id !== this.device.id) {
body = `Snapshot '${snapshot.name}' was not generated by this device. Are you sure you want to deploy it to this device?`
}
Dialog.show({
header: `Deploy Snapshot to device '${this.device.name}'`,
header: `Restore Snapshot to device '${this.device.name}'`,
kind: 'danger',
text: body,
confirmLabel: 'Confirm'
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/instance/Snapshots/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ff-button kind="primary" data-action="create-snapshot" :disabled="busy" @click="showCreateSnapshotDialog"><template #icon-left><PlusSmIcon /></template>Create Snapshot</ff-button>
</template>
<template #context-menu="{row}">
<ff-list-item :disabled="!hasPermission('project:snapshot:rollback')" label="Deploy Snapshot" @click="showRollbackDialog(row)" />
<ff-list-item :disabled="!hasPermission('project:snapshot:rollback')" label="Restore Snapshot" @click="showRollbackDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:edit')" label="Edit Snapshot" @click="showEditSnapshotDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:full')" label="View Snapshot" @click="showViewSnapshotDialog(row)" />
<ff-list-item :disabled="!hasPermission('snapshot:full')" label="Compare Snapshot..." @click="showCompareSnapshotDialog(row)" />
Expand Down Expand Up @@ -229,7 +229,7 @@ export default {
// snapshot actions - rollback
showRollbackDialog (snapshot) {
Dialog.show({
header: 'Deploy Snapshot',
header: 'Restore Snapshot',
kind: 'danger',
text: `This will overwrite the current instance.
All changes to the flows, settings and environment variables made since the last snapshot will be lost.
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/frontend/cypress/tests-ee/devices/snapshots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('FlowForge - Devices - With Billing', () => {
cy.get('[data-el="snapshots"] tbody').find('.ff-kebab-menu').eq(0).click()
// check the options are present
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').should('have.length', MENU_ITEM_COUNT)
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Deploy Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Restore Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_EDIT_SNAPSHOT).contains('Edit Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_VIEW_SNAPSHOT).contains('View Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_COMPARE_SNAPSHOT).contains('Compare Snapshot...')
Expand All @@ -140,7 +140,7 @@ describe('FlowForge - Devices - With Billing', () => {
cy.get('[data-el="snapshots"] tbody').find('.ff-kebab-menu').eq(1).click()
// click kebab menu in row 2 - an instance snapshot
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').should('have.length', MENU_ITEM_COUNT)
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Deploy Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Restore Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_EDIT_SNAPSHOT).contains('Edit Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_VIEW_SNAPSHOT).contains('View Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_COMPARE_SNAPSHOT).contains('Compare Snapshot...')
Expand Down Expand Up @@ -356,7 +356,7 @@ describe('FlowForge - Devices - With Billing', () => {
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).click()

cy.get('[data-el="platform-dialog"]').should('be.visible')
cy.get('[data-el="platform-dialog"] .ff-dialog-header').contains('Deploy Snapshot to device')
cy.get('[data-el="platform-dialog"] .ff-dialog-header').contains('Restore Snapshot to device')

// find .ff-btn--danger with text "Confirm" and click it
cy.get('[data-el="platform-dialog"] .ff-btn--danger').contains('Confirm').click()
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/frontend/cypress/tests/instances/snapshots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('FlowForge - Instance Snapshots', () => {

// check the options are present
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').should('have.length', MENU_ITEM_COUNT)
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Deploy Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).contains('Restore Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_EDIT_SNAPSHOT).contains('Edit Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_VIEW_SNAPSHOT).contains('View Snapshot')
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_COMPARE_SNAPSHOT).contains('Compare Snapshot...')
Expand Down Expand Up @@ -393,7 +393,7 @@ describe('FlowForge - Instance Snapshots', () => {
cy.get('[data-el="snapshots"] tbody .ff-kebab-menu .ff-kebab-options').find('.ff-list-item').eq(IDX_DEPLOY_SNAPSHOT).click()

cy.get('[data-el="platform-dialog"]').should('be.visible')
cy.get('[data-el="platform-dialog"] .ff-dialog-header').contains('Deploy Snapshot')
cy.get('[data-el="platform-dialog"] .ff-dialog-header').contains('Restore Snapshot')

// find .ff-btn--danger with text "Confirm" and click it
cy.get('[data-el="platform-dialog"] .ff-btn--danger').contains('Confirm').click()
Expand Down

0 comments on commit 03a42dc

Please sign in to comment.