added local images

master
Malar Kannan 2017-06-27 14:47:37 +05:30
parent 50ef8b3585
commit 14d031fea8
1 changed files with 6 additions and 4 deletions

View File

@ -14,7 +14,8 @@ const { Flex, Box } = require('reflexbox');
interface LexEditorProps { interface LexEditorProps {
fileName: RequestInfo; fileName: RequestInfo;
} }
const imageRoot = 'https://s3-us-west-2.amazonaws.com/aac-buddy/static/img/png/'; // const imageRoot = 'https://s3-us-west-2.amazonaws.com/aac-buddy/static/img/png/';
const imageRoot = 'https://localhost:3000/png/';
const fieldMetaMap = { const fieldMetaMap = {
'label': { lens: 'label[0]', type: 'text' }, 'label': { lens: 'label[0]', type: 'text' },
'unl': { lens: 'unl[0]', type: 'text' }, 'unl': { lens: 'unl[0]', type: 'text' },
@ -93,6 +94,7 @@ export class LexEditor extends React.Component<LexEditorProps, any> {
let searchLens = fieldMetaMap[searchEvent.searchType].lens; let searchLens = fieldMetaMap[searchEvent.searchType].lens;
let matchedEntries = _.chain(this.allEntries) let matchedEntries = _.chain(this.allEntries)
.filter((q: any) => _.get<any>(q, searchLens, '') === searchText) .filter((q: any) => _.get<any>(q, searchLens, '') === searchText)
.take(10)
.value(); .value();
this.setState({ ...this.state, matchedEntries, searchText, searchLens }); this.setState({ ...this.state, matchedEntries, searchText, searchLens });
} }
@ -199,7 +201,7 @@ class LexEdit extends React.Component<any, any> {
placeholder={field} placeholder={field}
type="text" type="text"
dir="auto" dir="auto"
style={{ width: '150px' }} style={{ width: '10em' }}
/> />
</LexSingleInput> </LexSingleInput>
); );
@ -208,7 +210,7 @@ class LexEdit extends React.Component<any, any> {
<LexSingleInput key={field} labelText={_.capitalize(field)}> <LexSingleInput key={field} labelText={_.capitalize(field)}>
<select <select
onChange={sh} onChange={sh}
style={{ width: '150px' }} style={{ width: '10em' }}
defaultValue={defaultText} defaultValue={defaultText}
> >
{this.props.selectionMeta[field].map((k: any, i: any, c: any) => { {this.props.selectionMeta[field].map((k: any, i: any, c: any) => {
@ -233,7 +235,7 @@ class LexEdit extends React.Component<any, any> {
<Card raised={true}> <Card raised={true}>
<Card.Content> <Card.Content>
<Card.Header> <Card.Header>
GUID {_.get<any>(li, 'guid', '')} {_.get<any>(li, 'label', '')}
</Card.Header> </Card.Header>
<Card.Meta> <Card.Meta>
language: {_.get<any>(li, '$.id', '')} language: {_.get<any>(li, '$.id', '')}