Skip to content
Open
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
node_modules/

# Packed shared utils package
*deliberation-lab-utils-*.tgz
*deliberation-lab-utils-*.tgz
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add extra blank lines here



36 changes: 21 additions & 15 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '../../pair-components/icon_button';
import '../../pair-components/tooltip';
import '../experimenter/experimenter_data_editor';
import '../stages/asset_allocation_editor';
import '../stages/bargain_editor';
import '../stages/base_stage_editor';
import '../stages/comprehension_editor';
import '../stages/group_chat_editor';
Expand Down Expand Up @@ -695,6 +696,13 @@ export class ExperimentBuilder extends MobxLitElement {
<transfer-editor .stage=${stage}></transfer-editor>
</base-stage-editor>
`;
case StageKind.BARGAIN:
return html`
<base-stage-editor .stage=${stage}>
<div slot="title">Bargain settings</div>
<bargain-editor .stage=${stage}></bargain-editor>
</base-stage-editor>
`;
default:
return html` Stage editor not found. `;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ import {
POLICY_METADATA,
getPolicyExperimentTemplate,
} from '../../shared/templates/policy';
import {
getBargainMetadata,
getBargainStageConfigs,
} from '../../shared/templates/bargain';

import {styles} from './stage_builder_dialog.scss';

Expand Down Expand Up @@ -173,7 +177,8 @@ export class StageBuilderDialog extends MobxLitElement {
<div class="card-gallery-wrapper">
${this.renderLASCard()} ${this.renderLASCard(true)}
${this.renderRealityTVCard()} ${this.renderChipNegotiationCard()}
${this.renderSalespersonGameCard()} ${this.renderFlipCardTemplateCard()}
${this.renderBargainCard()} ${this.renderSalespersonGameCard()}
${this.renderFlipCardTemplateCard()}
${this.renderFruitTestTemplateCard()} ${this.renderStockInfoGameCard()}
${this.renderAssetAllocationTemplateCard()}
${this.renderConditionalSurveyTemplateCard()}
Expand Down Expand Up @@ -292,6 +297,19 @@ export class StageBuilderDialog extends MobxLitElement {
`;
}

private renderBargainCard() {
const addGame = () => {
this.addGame(getBargainMetadata(), getBargainStageConfigs());
};

return html`
<div class="card" @click=${addGame}>
<div class="title">${getBargainMetadata().name}</div>
<div>${getBargainMetadata().description}</div>
</div>
`;
}

private renderSalespersonGameCard() {
const addGame = () => {
this.addGame(SALESPERSON_GAME_METADATA, getSalespersonStageConfigs());
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/participant_view/participant_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import '../progress/progress_stage_waiting';
import '../stages/group_chat_participant_view';
import '../stages/private_chat_participant_view';
import '../stages/chip_participant_view';
import '../stages/bargain_participant_view';
import '../stages/comprehension_participant_view';
import '../stages/flipcard_participant_view';
import '../stages/ranking_participant_view';
Expand Down Expand Up @@ -242,6 +243,11 @@ export class ParticipantView extends MobxLitElement {
<chip-participant-view .stage=${stage} .answer=${answer}>
</chip-participant-view>
`;
case StageKind.BARGAIN:
return html`
<bargain-participant-view .stage=${stage} .answer=${answer}>
</bargain-participant-view>
`;
case StageKind.COMPREHENSION:
return html`
<comprehension-participant-view .stage=${stage}>
Expand Down
Loading