Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deviceEditor feature flag in place of license check #2118

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions forge/ee/lib/deviceEditor/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { DeviceTunnelManager } = require('./DeviceTunnelManager')

module.exports.init = function (app) {
app.config.features.register('deviceEditor', true, true)

// Add the tunnelManager to app.comms.devices
app.comms.devices.tunnelManager = new DeviceTunnelManager(app)
}
8 changes: 4 additions & 4 deletions frontend/src/pages/device/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>
</div>
</template>
<template v-if="isLicensed" #tools>
<template v-if="isDevModeAvailable" #tools>
<div class="space-x-2 flex align-center">
<a v-if="editorAvailable && !isVisitingAdmin" class="ff-btn ff-btn--secondary" :href="deviceEditorURL" :target="`device-editor-${device.id}`" data-action="device-editor">
Device Editor
Expand Down Expand Up @@ -124,14 +124,14 @@ export default {
// return true
return this.teamMembership.role === Roles.Admin
},
isLicensed: function () {
return !!this.settings['platform:licensed']
isDevModeAvailable: function () {
return !!this.features.deviceEditor
},
developerMode: function () {
return this.device && this.agentSupportsDeviceAccess && this.device.mode === 'developer'
},
editorAvailable: function () {
return this.isLicensed && this.device && this.agentSupportsDeviceAccess && this.developerMode && this.device.status === 'running' && this.deviceEditorURL
return this.isDevModeAvailable && this.device && this.agentSupportsDeviceAccess && this.developerMode && this.device.status === 'running' && this.deviceEditorURL
},
deviceEditorURL: function () {
return this.device.editor?.url || ''
Expand Down