rm whitespace and store canactivate

pull/1585/head
bunsenstraat 3 years ago
parent d3f849a88b
commit 046faea795
  1. 5
      libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx
  2. 1
      libs/remix-ui/plugin-manager/src/types.d.ts

@ -51,6 +51,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
setMethods(storagePlugin.methods) setMethods(storagePlugin.methods)
setType(storagePlugin.type) setType(storagePlugin.type)
setDisplayName(storagePlugin.displayName) setDisplayName(storagePlugin.displayName)
setCanactivate(storagePlugin.canActivate)
}, []) }, [])
const handleModalOkClick = async () => { const handleModalOkClick = async () => {
@ -61,7 +62,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
} }
if (!location) throw new Error('Plugin should have a location') if (!location) throw new Error('Plugin should have a location')
if (!url) throw new Error('Plugin should have an URL') if (!url) throw new Error('Plugin should have an URL')
const newMethods = typeof methods === 'string' ? methods.split(',').filter(val => val) : [] const newMethods = typeof methods === 'string' ? methods.split(',').filter(val => val).map(val => { return val.trim() }) : []
const targetPlugin = { const targetPlugin = {
name: name, name: name,
displayName: displayName, displayName: displayName,
@ -75,7 +76,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
type: type, type: type,
location: location, location: location,
icon: 'assets/img/localPlugin.webp', icon: 'assets/img/localPlugin.webp',
canActivate: typeof canactivate === 'string' ? canactivate.split(',').filter(val => val) : [] canActivate: typeof canactivate === 'string' ? canactivate.split(',').filter(val => val).map(val => { return val.trim() }) : []
} }
const localPlugin = type === 'iframe' ? new IframePlugin(initialState) : new WebsocketPlugin(initialState) const localPlugin = type === 'iframe' ? new IframePlugin(initialState) : new WebsocketPlugin(initialState)
localPlugin.profile.hash = `local-${name}` localPlugin.profile.hash = `local-${name}`

@ -180,6 +180,7 @@ export interface FormStateProps {
hash: string hash: string
methods: any methods: any
location: string location: string
canActivate?: any
} }
export type PluginManagerProfile = Profile & { export type PluginManagerProfile = Profile & {

Loading…
Cancel
Save