1
0
Fork 0

🚧 Added noDocs option to DraftConfigurator for workbench

This commit is contained in:
Joost De Cock 2019-05-10 10:53:34 +02:00
parent 1d7fdaa7e2
commit 9e89e0d27c
15 changed files with 33 additions and 14 deletions

View file

@ -40,7 +40,7 @@ const DraftSettingLanguage = props => {
desc={props.desc}
title={props.title}
id={"po-list-" + props.name}
displayValue={languages[props.intl.locale][value]}
displayValue={languages[value]}
reset={reset}
toggleExpanded={toggleExpanded}
expanded={expanded}
@ -51,6 +51,7 @@ const DraftSettingLanguage = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -62,6 +62,7 @@ const DraftSettingMargin = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -81,6 +81,7 @@ const DraftSettingOnly = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -107,6 +107,7 @@ const DraftSettingSa = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -49,6 +49,7 @@ const DraftSettingUnits = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -49,7 +49,8 @@ const DraftSettings = props => {
units: props.units,
key: setting,
name: setting,
labels: labels[setting]
labels: labels[setting],
noDocs: props.noDocs
};
childProps.title = (
<FormattedMessage id={"settings." + setting + ".title"} />

View file

@ -25,7 +25,8 @@ const OptionGroup = props => {
desc: <FormattedMessage id={stringKey + "description"} />,
intl: props.intl,
pattern: props.config.name,
key: name
key: name,
noDocs: props.noDocs
};
let noyes = [
<FormattedMessage id="app.no" />,

View file

@ -72,6 +72,7 @@ const OptionPreamble = props => {
>
<ResetIcon />
</IconButton>
{props.noDocs ? null : (
<IconButton
title={docsLabel}
aria-label={docsLabel}
@ -81,6 +82,7 @@ const OptionPreamble = props => {
>
<HelpIcon />
</IconButton>
)}
</div>
</div>
{props.option}

View file

@ -49,6 +49,7 @@ const PatternOptionBool = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -70,6 +70,7 @@ const PatternOptionList = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -82,6 +82,7 @@ const PatternOptionMillimeter = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -71,6 +71,7 @@ const PatternOptionPctDegCount = props => {
})
}
option={option}
noDocs={props.noDocs}
/>
</li>
);

View file

@ -28,6 +28,7 @@ const PatternOptions = props => {
children = (
<ul className="nav l3">
<OptionGroup
noDocs={props.noDocs}
key={group + "-group"}
units={props.units}
config={props.config}

View file

@ -20,7 +20,7 @@ const DraftConfigurator = props => {
else shown.splice(index, 1);
setExpanded(shown);
};
console.log("dc props", props);
return (
<ul className="nav l1">
<li>
@ -28,6 +28,7 @@ const DraftConfigurator = props => {
<FormattedMessage id="app.patternOptions" />
</h2>
<PatternOptions
noDocs={props.noDocs}
config={props.config}
gist={props.gist}
updateValue={(name, value) =>
@ -42,6 +43,7 @@ const DraftConfigurator = props => {
<FormattedMessage id="app.draftSettings" />
</h2>
<DraftSettings
noDocs={props.noDocs}
config={props.config}
gist={props.gist}
updateValue={(name, value) =>
@ -59,6 +61,8 @@ DraftConfigurator.propTypes = {
units: PropTypes.oneOf(["metric", "imperial"]).isRequired
};
DraftConfigurator.defaultProps = {};
DraftConfigurator.defaultProps = {
noDocs: false
};
export default DraftConfigurator;

View file

@ -115,6 +115,7 @@ const DraftPattern = props => {
</p>
)}
<DraftConfigurator
noDocs
config={props.config}
gist={props.gist}
updateGist={props.updateGist}