Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onScoreEdit(response: contentTypes.Response, score: string) {
const {
itemModel,
partModel,
onEdit,
} = this.props;
const updated = response.with({ score: Maybe.just(score) });
const newPartModel = partModel.with(
{ responses: partModel.responses.set(updated.guid, updated) });
onEdit(itemModel, newPartModel, updated);
}
onScoreEdit(response: contentTypes.Response, score: string) {
const { partModel, itemModel, onEdit } = this.props;
const updatedScore = response.with({
score: score === '' ? Maybe.nothing() : Maybe.just(score),
});
const updatedPartModel = partModel.with(
{ responses: partModel.responses.set(updatedScore.guid, updatedScore) },
);
onEdit(itemModel, updatedPartModel, updatedPartModel);
}
onScoreEdit(response: contentTypes.Response, score: string) {
const { model, onEdit } = this.props;
onEdit(model.with({
responses: model.responses.set(
response.guid,
model.responses.get(response.guid).with({
score: score === '' ? Maybe.nothing() : Maybe.just(score),
}),
),
}));
}
onScoreEdit(response: contentTypes.Response, score: string) {
const { partModel, itemModel, onEdit } = this.props;
const updatedScore = response.with({
score: score === '' ? Maybe.nothing() : Maybe.just(score),
});
const updatedPartModel = partModel.with(
{ responses: partModel.responses.set(updatedScore.guid, updatedScore) },
);
onEdit(itemModel, updatedPartModel, updatedPartModel);
}
onScoreEdit = (response: contentTypes.Response, score: string) => {
const { partModel } = this.props;
this.onPartEdit(
partModel.with({
responses: partModel.responses.set(
response.guid,
response.with({
score: score === '' ? Maybe.nothing() : Maybe.just(score),
}),
),
}),
null,
);
}
onPulloutTypeChange(pulloutType) {
const model = this.props.model.with({
pulloutType: pulloutType === ''
? Maybe.nothing()
: Maybe.just(pulloutType),
});
this.props.onEdit(model, model);
}
const defaults = (params: Partial = {}) => ({
contentType: 'Multipanel',
elementType: 'multipanel',
guid: params.guid || createGuid(),
id: params.id || toContentId(createGuid()),
purpose: params.purpose || Maybe.nothing(),
title: params.title || Maybe.nothing(),
imageHotspot: params.imageHotspot || new ImageHotspot(),
panels: params.panels || Immutable.List(),
introPanelRef: params.introPanelRef || Maybe.nothing(),
inline: params.inline || new WbInline(),
});
const defaults = (params: Partial = {}) => ({
contentType: 'Panel',
elementType: 'panel',
guid: params.guid || toContentId(createGuid()),
id: params.id || createGuid(),
title: params.title || Maybe.nothing(),
content: params.content || ContentElements.fromText(
'', createGuid(), [...INLINE_ELEMENTS, ...CONTROL_ELEMENTS]),
});
const defaults = (params: Partial = {}) => ({
contentType: 'ImageHotspot',
elementType: 'image_hotspot',
guid: params.guid || createGuid(),
id: params.id || toContentId(createGuid()),
src: params.src || 'NO_IMAGE_SELECTED',
alt: params.alt || '',
width: params.width || 600,
height: params.height || 400,
visibility: params.visibility || Maybe.nothing(),
hotspots: params.hotspots || Immutable.OrderedMap(),
});
const defaults = (params: Partial = {}) => ({
requestedDataSetId: params.requestedDataSetId || Maybe.nothing(),
dataSet: params.dataSet || Maybe.nothing(),
});