Object.keys(json).reduce((acc, x) => { const key = upperFirst(`${mapping[x] || x}Type`); const typeStr = Object.keys(types[key]); const typeValues = Object.values(types[key]); acc[x] = typeValues[typeStr.indexOf(json[x])]; return acc; }, {})
function createInstance(type, props) { let elementName = type !== `div` ? `Term${upperFirst(camelCase(type))}` : `TermElement`; let ElementClass = TermElements[elementName]; if (!ElementClass) throw new Error(`Invalid element type "${type}" (${elementName} is not amongst ${Object.keys(TermElements).join(`, `)})`); let instance = new ElementClass(props); Reflect.set(instance, EVENT_SYMBOL, new Map()); Reflect.set(instance, SHORTCUT_SYMBOL, new Map()); return instance; }
const getArgTypeName = type => Array.isArray(type.args) && type.args.length ? upperFirst(camelcase(`${type.name}_params`)) : ''
state .updateIn(['modifiedSchema', 'models', ...action.keys.split('.')], relation => { return relation .update('description', () => '') .update('label', () => upperFirst(relation.get('alias'))); }) .updateIn(['modifiedSchema', 'models'].concat(action.keys.split('.')), list => { return list.delete(action.index); })
Object.keys(this.admin.models || []).reduce((acc, key) => { if (!this.admin.models[key].identity) { this.admin.models[key].identity = upperFirst(key); } if (!this.admin.models[key].globalId) { this.admin.models[key].globalId = upperFirst(camelCase(`admin-${key}`)); } if (!this.admin.models[key].connection) { this.admin.models[key].connection = this.config.currentEnvironment.database.defaultConnection; } acc[key] = this.admin.models[key]; return acc; }, {})
function SettingsRow({ destination, name, onClick }) { return ( <div className={styles.settingsRow} id={name} onClick={() => onClick(destination)}> <div> <div className={styles.frame}> <div className={styles.icon}> <i className="fa fa-cube"></i> </div> {upperFirst(name)} </div> <IcoContainer icons={[{ icoType: 'cog', onClick: () => onClick(destination) }]} /> </div> </div> ); }
Object.keys(this.api || []).reduce((acc, key) => { for (let index in this.api[key].controllers) { if (!this.api[key].controllers[index].identity) { this.api[key].controllers[index].identity = upperFirst(index); } acc[index] = this.api[key].controllers[index]; } return acc; }, {})
Object.keys(attributes) .filter(attr => { return ( findIndex(this.getListDisplay(), ['name', attr]) === -1 && !attributes[attr].hasOwnProperty('collection') && !attributes[attr].hasOwnProperty('model') ); }) .map(attr => { const searchable = attributes[attr].type !== 'json' && attributes[attr].type !== 'array'; const obj = Object.assign(attributes[attr], { name: attr, label: upperFirst(attr), searchable, sortable: searchable, }); return obj; })
function TableEmpty({ colspan, contentType, filters, search }) { let id, values; const model = upperFirst(contentType); if (search !== '') { id = 'withSearch'; values = { contentType: model, search }; } else { id = filters.length > 0 ? 'withFilters' : 'withoutFilter'; values = { contentType: model || 'entry' }; } return ( <tr className={styles.tableEmpty}> <td colSpan={colspan + 1}> <FormattedMessage id={`content-manager.components.TableEmpty.${id}`} values={values} /> </td> </tr> ); }
render() { const { model } = this.props; const { value } = this.state; return ( <div className={styles.search}> <div> <FormattedMessage id="content-manager.components.Search.placeholder"> {(message) => ( <input onChange={this.handleChange} placeholder={message} type="text" value={value} /> )} </FormattedMessage> {value !== '' && <div className={styles.clearable} onClick={this.handleClick} />} </div> <div className={styles.searchLabel}> <img src={Logo} alt="filter_logo" /> {upperFirst(model)} </div> </div> ); }
Object.keys(get(props.schema, 'relations', {})).reduce((acc, current) => { if (get(props.schema, ['relations', current, 'plugin']) === 'upload') { acc[current] = { description: '', label: upperFirst(current), type: 'file', }; } return acc; }, {})
this.plugins[key].models[index].globalId = upperFirst(camelCase(`${key}-${index}`));
Object.keys(this.api || []).reduce((acc, key) => { for (let index in this.api[key].models) { if (!this.api[key].models[index].globalId) { this.api[key].models[index].globalId = upperFirst(camelCase(index)); } if (!this.api[key].models[index].connection) { this.api[key].models[index].connection = this.config.currentEnvironment.database.defaultConnection; } if (!this.api[key].models[index].collectionName) { this.api[key].models[index].collectionName = (`${index}`).toLowerCase(); } acc[index] = this.api[key].models[index]; } return acc; }, {})
Object.keys(type).reduce((acc, x) => { const key = upperFirst(`${mapping[x] || x}Type`); const typeStr = Object.keys(types[key]); const typeValues = Object.values(types[key]); acc[x] = typeStr[typeValues.indexOf(type[x])]; return acc; }, {})
const getArgTypeName = type => Array.isArray(type.args) && type.args.length ? upperFirst(camelcase(`${type.name}_params`)) : ''