Skip to content

Default Prime Directive and Anonymous to false. #1115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 3, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Board Metadata Form', () => {
const checkbox = component.findWhere(c => c.prop('id') === 'display-prime-directive').find(Checkbox);

expect(checkbox).toBeDefined();
expect(checkbox.prop('defaultChecked')).toEqual(true);
expect(checkbox.prop('defaultChecked')).toEqual(false);
expect(checkbox.prop('disabled')).toEqual(false);
});

Expand All @@ -89,7 +89,7 @@ describe('Board Metadata Form', () => {
const checkbox = component.findWhere(c => c.prop('id') === 'feedback-display-names-checkbox').find(Checkbox);

expect(checkbox).toBeDefined();
expect(checkbox.prop('defaultChecked')).toEqual(true);
expect(checkbox.prop('defaultChecked')).toEqual(false);
expect(checkbox.prop('disabled')).toEqual(false);
});

Expand Down
41 changes: 20 additions & 21 deletions src/frontend/components/feedbackBoardMetadataForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
let defaultTitle: string = '';
let defaultColumns: IFeedbackColumnCard[] = getColumnsByTemplateId("").map(column => { return { column, markedForDeletion: false } });
let defaultMaxVotes: number = 5;
let defaultIsAnonymous: boolean = true;
let defaultIncludeTeamEffectivenessMeasurement: boolean = true;
let defaultDisplayPrimeDirective: boolean = true;
let defaultDisplayPrimeDirective: boolean = false;
let defaultShowFeedbackAfterCollect: boolean = false;
let defaultIsAnonymous: boolean = false;
let defaultPermissions: IFeedbackBoardDocumentPermissions = { Teams: [], Members: []};

if (props.isDuplicatingBoard) {
defaultTitle = `${this.props.currentBoard.title} - copy`;
defaultColumns = this.props.currentBoard.columns.map(column => { return { column, markedForDeletion: false } });
defaultMaxVotes = this.props.currentBoard.maxVotesPerUser;
defaultIsAnonymous = this.props.currentBoard.isAnonymous;
defaultIncludeTeamEffectivenessMeasurement = this.props.currentBoard.isIncludeTeamEffectivenessMeasurement;
defaultDisplayPrimeDirective = this.props.currentBoard.displayPrimeDirective;
defaultShowFeedbackAfterCollect = this.props.currentBoard.shouldShowFeedbackAfterCollect;
defaultIsAnonymous = this.props.currentBoard.isAnonymous;
defaultPermissions = this.props.currentBoard.permissions;
}

Expand All @@ -92,6 +92,8 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
? defaultColumns
: this.props.currentBoard.columns.map(column => { return { column, markedForDeletion: false } }),
isIncludeTeamEffectivenessMeasurement: this.props.isNewBoardCreation ? defaultIncludeTeamEffectivenessMeasurement : this.props.currentBoard.isIncludeTeamEffectivenessMeasurement,
displayPrimeDirective: this.props.isNewBoardCreation ? defaultDisplayPrimeDirective : this.props.currentBoard.displayPrimeDirective,
shouldShowFeedbackAfterCollect: this.props.isNewBoardCreation ? defaultShowFeedbackAfterCollect : this.props.currentBoard.shouldShowFeedbackAfterCollect,
isBoardAnonymous: this.props.isNewBoardCreation ? defaultIsAnonymous : this.props.currentBoard.isAnonymous,
maxVotesPerUser: this.props.isNewBoardCreation ? defaultMaxVotes : this.props.currentBoard.maxVotesPerUser,
isBoardNameTaken: false,
Expand All @@ -101,8 +103,6 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
placeholderText: this.props.placeholderText,
selectedAccentColorKey: undefined,
selectedIconKey: undefined,
displayPrimeDirective: this.props.isNewBoardCreation ? defaultDisplayPrimeDirective : this.props.currentBoard.displayPrimeDirective,
shouldShowFeedbackAfterCollect: this.props.isNewBoardCreation ? defaultShowFeedbackAfterCollect : this.props.currentBoard.shouldShowFeedbackAfterCollect,
initialTitle: this.props.isNewBoardCreation ? defaultTitle : this.props.currentBoard.title,
title: this.props.isNewBoardCreation ? defaultTitle : this.props.currentBoard.title,
permissions: this.props.isNewBoardCreation ? defaultPermissions : this.props.currentBoard.permissions
Expand Down Expand Up @@ -156,9 +156,9 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
});
}

private handleIsAnonymousCheckboxChange = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
private handleDisplayPrimeDirectiveChange = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
this.setState({
isBoardAnonymous: checked,
displayPrimeDirective: checked,
});
}

Expand All @@ -168,9 +168,9 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
});
}

private handleDisplayPrimeDirectiveChange = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
private handleIsAnonymousCheckboxChange = (ev?: React.FormEvent<HTMLElement | HTMLInputElement>, checked?: boolean) => {
this.setState({
displayPrimeDirective: checked,
isBoardAnonymous: checked,
});
}

Expand Down Expand Up @@ -380,25 +380,25 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo

<div className="board-metadata-form-section-subheader">
<Checkbox
id="obscure-feedback-checkbox"
label="Obscure the feedback of others until after Collect phase"
ariaLabel="Only show feedback after Collect phase. This selection cannot be modified after board creation."
id="display-prime-directive"
label="Display 'Retrospective Prime Directive'"
ariaLabel="Display 'Retrospective Prime Directive.' This selection cannot be modified after board creation."
boxSide="start"
defaultChecked={this.state.shouldShowFeedbackAfterCollect}
defaultChecked={this.state.displayPrimeDirective}
disabled={!this.props.isNewBoardCreation}
onChange={this.handleShouldShowFeedbackAfterCollectChange}
onChange={this.handleDisplayPrimeDirectiveChange}
/>
</div>

<div className="board-metadata-form-section-subheader">
<Checkbox
id="display-prime-directive"
label="Display 'Retrospective Prime Directive'"
ariaLabel="Display 'Retrospective Prime Directive.' This selection cannot be modified after board creation."
id="obscure-feedback-checkbox"
label="Obscure the feedback of others until after Collect phase"
ariaLabel="Only show feedback after Collect phase. This selection cannot be modified after board creation."
boxSide="start"
defaultChecked={this.state.displayPrimeDirective}
defaultChecked={this.state.shouldShowFeedbackAfterCollect}
disabled={!this.props.isNewBoardCreation}
onChange={this.handleDisplayPrimeDirectiveChange}
onChange={this.handleShouldShowFeedbackAfterCollectChange}
/>
</div>

Expand All @@ -421,8 +421,7 @@ class FeedbackBoardMetadataForm extends React.Component<IFeedbackBoardMetadataFo
</div>
{!this.props.isNewBoardCreation &&
<div className="board-metadata-form-section-information warning-information">
<i className="fas fa-exclamation-triangle"></i>&nbsp;Warning:
<br />Existing feedback items may not be available after changing the board template!
<i className="fas fa-exclamation-triangle"></i>&nbsp;Warning: Existing feedback items may not be<br />available after changing the board template!
</div>
}
<div className="board-metadata-form-section-subheader">
Expand Down
Loading