Skip to content

Commit

Permalink
Merge pull request #1193 from flowforge/1.0.3-prep
Browse files Browse the repository at this point in the history
1.0.3 Release
  • Loading branch information
hardillb authored Nov 4, 2022
2 parents 64d8bc9 + 539da55 commit cb08854
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#### 1.0.2: Release

- Fix project rollback to handle modules object (#1192) @knolleary
- Docs: How to cancel your subscription (#1190) @robmarcer
- Make sure to use the Stack Label if available (#1170) @hardillb

#### 1.0.1: Release

- Fix flow import (#1157) @knolleary
Expand Down
6 changes: 6 additions & 0 deletions docs/cloud/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ There is also a link to the Stripe Customer Portal where you can change the paym

If your payment fails for any reason you will receive a notification to the billing email address, you may need to login and update the card on file.
Stripe will retry the payment several times over a number of days. If the card repeatedly fails we may have to suspend your account.

## Cancelling your subscription

If you want to cancel your subscription with FlowForge Cloud you will need to remove all projects and then delete all teams from your account. If you have outstanding credit you can request a refund via a [support ticket](https://flowforge.com/contact-us/).


11 changes: 11 additions & 0 deletions forge/db/controllers/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ module.exports = {
})
} catch (err) {}
}

return projectExport
},

Expand Down Expand Up @@ -161,6 +162,16 @@ module.exports = {
})
})
}
if (snapshotSettings.palette?.modules) {
const moduleList = []
for (const [name, version] of Object.entries(snapshotSettings.palette.modules)) {
moduleList.push({ name, version, local: true })
}
snapshotSettings.palette.modules = moduleList
} else {
snapshotSettings.palette = snapshotSettings.palette || {}
snapshotSettings.palette.modules = []
}
const newSettings = app.db.controllers.ProjectTemplate.validateSettings(snapshotSettings, project.ProjectTemplate)
const currentProjectSettings = await project.getSetting('settings') || {} // necessary?
const updatedSettings = app.db.controllers.ProjectTemplate.mergeSettings(currentProjectSettings, newSettings) // necessary?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default {
.map(stack => {
return {
value: stack.id,
label: stack.name + (stack.id === this.project.stack?.id ? ' (current)' : '')
label: (stack.label || stack.name) + (stack.id === this.project.stack?.id ? ' (current)' : '')
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flowforge/flowforge",
"version": "1.0.1",
"version": "1.0.2",
"description": "An open source low-code development platform",
"scripts": {
"start": "node forge/app.js",
Expand Down
78 changes: 78 additions & 0 deletions test/unit/forge/routes/api/projectSnapshots_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,84 @@ describe('Project Snapshots API', function () {
})
})

describe('Rollback a snapshot', function () {
it('Rolls back to a different snapshot', async function () {
// Setup an initial configuration
await addFlowsToProject(TestObjects.project1.id,
TestObjects.tokens.project,
[{ id: 'node1' }],
{ testCreds: 'abc' },
'key1',
{
httpAdminRoot: '/test-red',
dashboardUI: '/test-dash',
palette: {
modules: [
{ name: 'module1', version: 'v1' }
]
},
env: [
{ name: 'one', value: 'a' },
{ name: 'two', value: 'b' }
]
}
)
// Generate a snapshot
const response = await createSnapshot(TestObjects.project1.id, 'test-project-snapshot-01', TestObjects.tokens.alice)
response.statusCode.should.equal(200)
const snapshot1 = response.json()

// Change lots of things
await addFlowsToProject(TestObjects.project1.id,
TestObjects.tokens.project,
[{ id: 'node2' }],
{ testCreds: 'def' },
'key1',
{
httpAdminRoot: '/test-red-2',
dashboardUI: '/test-dash-2',
palette: {
modules: [
{ name: 'module2', version: 'v2' }
]
},
env: [
{ name: 'one', value: 'a2' },
{ name: 'two', value: 'b2' }
]
}
)

// Rollback to the original snapshot
const rollbackResponse = await app.inject({
method: 'POST',
url: `/api/v1/projects/${app.project.id}/actions/rollback`,
payload: {
snapshot: snapshot1.id
},
cookies: { sid: TestObjects.tokens.alice }
})
rollbackResponse.statusCode.should.equal(200)

// Get the new settings after rollback
const settingsURL = `/api/v1/projects/${app.project.id}/settings`
const rolledBackSettingsResponse = await app.inject({
method: 'GET',
url: settingsURL,
headers: {
authorization: `Bearer ${TestObjects.tokens.project}`
}
})
const rolledBackSettings = rolledBackSettingsResponse.json()

// Validate the new settings are correct
rolledBackSettings.settings.palette.modules.should.have.property('module1', 'v1')
rolledBackSettings.settings.palette.modules.should.not.have.property('module2', 'v2')
rolledBackSettings.settings.httpAdminRoot.should.equal('/test-red')
rolledBackSettings.env.should.have.property('one', 'a')
})
})

describe('Get snapshot information', function () {
it('Non-member cannot get project snapshot', async function () {
// Chris (non-member) cannot create in ATeam
Expand Down

0 comments on commit cb08854

Please sign in to comment.