Skip to content

Commit

Permalink
fix: fix bugs when developing a custom setting type
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Oct 12, 2024
1 parent 434885e commit 7f6fe61
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/frontend/editor/misc/dynamic-inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const registerInput = function(name, component, transformProps = null) {
export const getInput = function(name) {
const input = dynamicInputs[name]

if (!input) console.log(`⚠️ Unable to find the ${name} type input. Are you sure you registered it correctly?`)
if (!input) console.log(`🚨 [Maglev ERROR] Unable to find the ${name} type input. Are you sure you registered it correctly?`)

return dynamicInputs[name]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import { registerInput } from '@/misc/dynamic-inputs'

export default function() {
console.log('Hello from the <%= human_name %> plugin 👋 v4.5')
console.log('Hello from the <%= human_name %> plugin 👋 v0.0.1')

// registerInput('text', MyOwnTextInputComponent)
}
4 changes: 4 additions & 0 deletions lib/maglev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@ def plugins
def register_plugin(id:, root_path:, name: nil, version: nil)
plugins.register(id:, name:, root_path:, version:)
end

def register_setting_type(id:, klass: nil)
::Maglev::SettingTypeRegistry.register(id:, klass:)
end
end
end
2 changes: 1 addition & 1 deletion lib/maglev/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def write_frontend_setup_file
File.open(frontend_plugin_path, 'w+') do |f|
f.write(
<<-JAVASCRIPT
import setup from 'dummy_plugin'
import setup from "#{id}.js"
setup()
JAVASCRIPT
)
Expand Down

0 comments on commit 7f6fe61

Please sign in to comment.