Skip to content

Commit

Permalink
Merge pull request #123 from silk-framework/feature/HMVocabularyInfo
Browse files Browse the repository at this point in the history
merge vocabulary info branch
  • Loading branch information
haschek committed Jun 28, 2017
2 parents 8b488b8 + 5beef09 commit fe3dd9d
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 146 deletions.
3 changes: 2 additions & 1 deletion silk-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"devDependencies": {
"ecc-gulp-tasks": "^3.7.0",
"gulp": "^3.9.1"
"gulp": "^3.9.1",
"lorem-ipsum": "^1.0.4"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Spinner,
DismissiveButton,
} from 'ecc-gui-elements';
import {ThingName} from '../SharedComponents';
import {ThingName, ParentElement} from '../SharedComponents';
import hierarchicalMappingChannel from '../../../store';
import {wasTouched} from './helpers'
import _ from 'lodash';
Expand Down Expand Up @@ -78,7 +78,7 @@ const ObjectMappingRuleForm = React.createClass({
this.setState({
create: true,
loading: false,
type: 'direct',
type: 'object',
});
}
},
Expand Down Expand Up @@ -212,13 +212,11 @@ const ObjectMappingRuleForm = React.createClass({
>
<Radio
value="from"
label={<div>Connect from {<ThingName id={this.props.parentName}
prefixString="parent element "/>}</div>}
label={<div>Connect from <ParentElement parent={this.props.parent}/></div>}
/>
<Radio
value="to"
label={<div>Connect to {<ThingName id={this.props.parentName}
prefixString="parent element "/>}</div>}
label={<div>Connect to <ParentElement parent={this.props.parent}/></div>}
/>
</RadioGroup>
);
Expand Down Expand Up @@ -278,14 +276,14 @@ const ObjectMappingRuleForm = React.createClass({
onChange={this.handleChangeSelectBox.bind(null, 'targetEntityType')}
/>
{sourcePropertyInput}
{patternInput}
<TextField
multiline={true}
label="Description"
className="ecc-silk-mapping__ruleseditor__comment"
value={this.state.comment}
onChange={this.handleChangeTextfield.bind(null, 'comment')}
/>
{patternInput}
</div>
<div
className="ecc-silk-mapping__ruleseditor__actionrow mdl-card__actions mdl-card--border">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ const MappingRule = React.createClass({
</div>,
*/
<div key={'sl2'} className="ecc-silk-mapping__ruleitem-subline ecc-silk-mapping__ruleitem-info-sourcestructure">
<span className="hide-in-table">from</span>
<SourcePath
<span className="hide-in-table">from</span> <SourcePath
rule={
{
type,
Expand All @@ -204,8 +203,7 @@ const MappingRule = React.createClass({
/>
</div>,
<div key={'sl3'} className="ecc-silk-mapping__ruleitem-subline ecc-silk-mapping__ruleitem-info-editinfo">
<span className="hide-in-table">DataType:</span>
<RuleTypes
<span className="hide-in-table">DataType:</span> <RuleTypes
rule={
{
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import ObjectMappingRuleForm from './Forms/ObjectMappingRuleForm';
import {
SourcePath,
ThingName,
ThingDescription
ThingDescription,
ParentElement,
InfoBox
} from './SharedComponents';

const RuleObjectView = React.createClass({
Expand All @@ -42,8 +44,6 @@ const RuleObjectView = React.createClass({
edit: !!this.props.edit,
};
},


// open view in edit mode
handleEdit() {
this.setState({
Expand All @@ -64,7 +64,7 @@ const RuleObjectView = React.createClass({
if (edit) {
return <ObjectMappingRuleForm
id={this.props.id}
parentName={this.props.parentName}
parent={this.props.parent}
parentId={this.props.parentId}
/>
}
Expand All @@ -83,16 +83,18 @@ const RuleObjectView = React.createClass({
<dt className="ecc-silk-mapping__rulesviewer__attribute-label">
Target property
</dt>
<dd className="ecc-silk-mapping__rulesviewer__attribute-title">
<ThingName id={_.get(this.props, 'mappingTarget.uri', undefined)}/>
</dd>
<dd className="ecc-silk-mapping__rulesviewer__attribute-info">
<code>{_.get(this.props, 'mappingTarget.uri', undefined)}</code>
</dd>
<dd className="ecc-silk-mapping__rulesviewer__attribute-info">
<Info border>
<ThingDescription id={_.get(this.props, 'mappingTarget.uri', undefined)}/>
</Info>
<dd>
<InfoBox>
<div className="ecc-silk-mapping__rulesviewer__attribute-title ecc-silk-mapping__rulesviewer__infobox-main">
<ThingName id={_.get(this.props, 'mappingTarget.uri', undefined)}/>
</div>
<div className="ecc-silk-mapping__rulesviewer__attribute-info ecc-silk-mapping__rulesviewer__infobox-main">
<code>{_.get(this.props, 'mappingTarget.uri', undefined)}</code>
</div>
<div className="ecc-silk-mapping__rulesviewer__attribute-info ecc-silk-mapping__rulesviewer__infobox-sub">
<ThingDescription id={_.get(this.props, 'mappingTarget.uri', undefined)}/>
</div>
</InfoBox>
</dd>
</dl>
</div>
Expand All @@ -107,13 +109,11 @@ const RuleObjectView = React.createClass({
>
<Radio
value="from"
label={<div>Connect from {<ThingName id={this.props.parentName}
prefixString="parent element "/>}</div>}
label={<div>Connect from <ParentElement parent={this.props.parent}/></div>}
/>
<Radio
value="to"
label={<div>Connect to {<ThingName id={this.props.parentName}
prefixString="parent element "/>}</div>}
label={<div>Connect to <ParentElement parent={this.props.parent}/></div>}
/>
</RadioGroup>
);
Expand Down Expand Up @@ -150,7 +150,6 @@ const RuleObjectView = React.createClass({
{targetProperty}
{entityRelation}
{
// TODO: show multiple (array)
_.get(this.props, 'rules.typeRules[0].typeUri', false) ? (
<div
className="ecc-silk-mapping__rulesviewer__targetEntityType"
Expand All @@ -163,20 +162,22 @@ const RuleObjectView = React.createClass({
</dt>
{
this.props.rules.typeRules.map(
function(typeRule) {
return [
<dd className="ecc-silk-mapping__rulesviewer__attribute-title">
<ThingName id={typeRule.typeUri}/>
</dd>,
<dd className="ecc-silk-mapping__rulesviewer__attribute-info">
<code>{typeRule.typeUri}</code>
</dd>,
<dd className="ecc-silk-mapping__rulesviewer__attribute-info">
<Info border>
<ThingDescription id={typeRule.typeUri}/>
</Info>
function(typeRule, idx) {
return (
<dd key={"TargetEntityType_" + idx}>
<InfoBox>
<div className="ecc-silk-mapping__rulesviewer__attribute-title ecc-silk-mapping__rulesviewer__infobox-main">
<ThingName id={typeRule.typeUri}/>
</div>
<div className="ecc-silk-mapping__rulesviewer__attribute-info ecc-silk-mapping__rulesviewer__infobox-main">
<code>{typeRule.typeUri}</code>
</div>
<div className="ecc-silk-mapping__rulesviewer__attribute-info ecc-silk-mapping__rulesviewer__infobox-sub">
<ThingDescription id={typeRule.typeUri}/>
</div>
</InfoBox>
</dd>
];
);
}
)
}
Expand Down

0 comments on commit fe3dd9d

Please sign in to comment.