Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
name: 'Send email to Adrian',
description: 'Confirm if you have passed the subject\nHereby ...',
done: true,
recurrence: 'Daily',
rating: 3
};
const initState: JsonFormsState = {
jsonforms: {
cells: materialCells,
renderers: materialRenderers
}
};
const rootReducer: Reducer = combineReducers({
jsonforms: jsonformsReducer()
});
const store = createStore(rootReducer, initState, devToolsEnhancer({}));
store.dispatch(Actions.init(data, schema, uischema));
// Register custom renderer for the Redux tab
store.dispatch(Actions.registerRenderer(ratingControlTester, RatingControl));
ReactDOM.render(, document.getElementById('root'));
registerServiceWorker();
}
return acc;
},
{} as any
);
const additionalInitState = additionalStoreParams.reduce(
(acc: any, x: any) => {
acc[x.name] = x.state;
return acc;
},
{} as any
);
const reducer = combineReducers({
jsonforms: jsonformsReducer({ ...additionalReducers }),
examples: exampleReducer
});
const store = createStore(reducer, {
jsonforms: {
cells: cells,
renderers: renderers,
...additionalInitState
},
examples: {
data: exampleData
}
});
// Resolve example configuration
// Add schema to validation
const ajv = createAjv();
const uischema = {
'type': 'MasterDetailLayout',
'scope': '#'
};
const renderers = materialRenderers;
const cells = materialCells;
const jsonforms: JsonFormsState = {
jsonforms: {
renderers,
cells
}
};
const store: JsonFormsStore = createStore(
combineReducers({
jsonforms: jsonformsReducer(
)
}
),
{
...jsonforms
}
);
store.dispatch(Actions.init({}, coffeeSchema, uischema));
store.dispatch(Actions.registerUISchema((schema => schema['$id']==='#controlunit'?100:-1),controlUnitView));
store.dispatch(Actions.registerUISchema((schema => schema['$id']==='#machine'?100:-1),machineView));
return store;
};
export const createEditorStore = (
data = {},
schema,
uischema,
fields,
renderers,
imageMapping?,
labelMapping?,
modelMapping?,
uiSchemata = {},
containerProperties = {}): Store => {
const store = createStore(
combineReducers({ jsonforms: jsonformsReducer({ editor: editorReducer }) }),
{
jsonforms: {
renderers,
fields,
editor: {
imageMapping,
labelMapping,
modelMapping,
uiSchemata,
containerProperties
}
}
}
);
store.dispatch(Actions.init(data, schema, uischema));
return `User ${data.name || ''}`;
}
return 'Unknown';
};
const initState: any = {
jsonforms: {
renderers: materialRenderers,
cells: materialCells
}
};
const store: Store = createStore(
combineReducers({
jsonforms: jsonformsReducer()
}),
{ ...initState }
);
store.dispatch(Actions.init({}, taskSchema, uischema));
store.dispatch(
Actions.registerDefaultData('properties.users.items', { name: 'Test user' })
);
detailSchemata.forEach(({ tester, uischema: detailedUiSchema }) =>
store.dispatch(Actions.registerUISchema(tester, detailedUiSchema))
);
ReactDOM.render(
React.createElement(
App,
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { combineReducers, Reducer } from 'redux';
import { jsonformsReducer, JsonFormsState } from '@jsonforms/core';
import { angularMaterialRenderers } from '../../src/index';
import { ExampleDescription, getExamples } from '@jsonforms/examples';
export const rootReducer: Reducer = combineReducers({
jsonforms: jsonformsReducer(),
examples: (state: ExampleDescription[] = []) => state
});
export const initialState = {
jsonforms: {
renderers: angularMaterialRenderers
},
examples: {
data: getExamples()
}
};
private initStore() {
const initState: JsonFormsState = {
jsonforms: {
cells: materialCells,
renderers: materialRenderers
}
};
return createStore(
combineReducers({ jsonforms: jsonformsReducer() }),
initState
);
}