Skip to content

Commit 2f6ca9b

Browse files
xdavidsonadahms
andauthored
CCS-4563-display-message-update (#624)
* Minor edits to the text in labels for bulk operations. * update xref error message * re-work bulk publish/unpublish title logic * re-work bulk publish/unpublish title logic Co-authored-by: Andrew Dahms <[email protected]>
1 parent 0e86c4f commit 2f6ca9b

File tree

8 files changed

+35
-27
lines changed

8 files changed

+35
-27
lines changed

pantheon-bundle/frontend/src/app/BulkOperationPublish.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const props = {
1313
isBulkPublish: true,
1414
isBulkUnpublish: false,
1515
bulkOperationCompleted: true,
16+
bulkOperationTitle: "Bulk Publish",
1617
updateIsBulkPublish: (isBulkPublish) => anymatch,
1718
updateIsBulkUnpublish: (isBulkUnpublish) => anymatch,
1819
updateBulkOperationCompleted: (bulkOperationCompleted) => anymatch

pantheon-bundle/frontend/src/app/BulkOperationPublish.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface IBulkOperationPublishProps {
1111
isBulkPublish: boolean
1212
isBulkUnpublish: boolean
1313
bulkOperationCompleted: boolean
14+
bulkOperationTitle: string
1415
updateIsBulkPublish: (isBulkPublish) => any
1516
updateIsBulkUnpublish: (isBulkUnpublish) => any
1617
updateBulkOperationCompleted: (bulkOperationConfirmation) => any
@@ -126,7 +127,7 @@ class BulkOperationPublish extends React.Component<IBulkOperationPublishProps, a
126127
{this.state.showBulkConfirmation &&
127128
<BulkPublishConfirmation
128129
key={new Date().getTime()}
129-
header={this.props.isBulkPublish ? "Bulk Publish" : "Bulk Unpublish"}
130+
header={this.props.bulkOperationTitle}
130131
subheading="Documents updated in the bulk operation"
131132
updateSucceeded={this.state.confirmationSucceeded}
132133
updateIgnored={this.state.confirmationIgnored}
@@ -138,6 +139,7 @@ class BulkOperationPublish extends React.Component<IBulkOperationPublishProps, a
138139
onShowBulkOperationConfirmation={this.updateShowBulkPublishConfirmation}
139140
isBulkUnpublish={this.props.isBulkUnpublish}
140141
bulkOperationCompleted={this.props.bulkOperationCompleted}
142+
bulkOperationTitle={this.props.bulkOperationTitle}
141143
updateBulkOperationCompleted={this.props.updateBulkOperationCompleted}
142144
/>}
143145

pantheon-bundle/frontend/src/app/BulkPublishConfirmation.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface IBulkPublishProps {
1515
onShowBulkOperationConfirmation: (showBulkConfirmation) => any
1616
isBulkUnpublish: boolean
1717
bulkOperationCompleted: boolean
18+
bulkOperationTitle: string
1819
updateBulkOperationCompleted: (bulkOperationCompleted) => any
1920
}
2021

@@ -50,17 +51,17 @@ class BulkPublishConfirmation extends React.Component<IBulkPublishProps, any>{
5051
<div className="p2-search__pf-c-alert">
5152
<Alert
5253
variant="info"
53-
title={this.props.isBulkUnpublish ? "Bulk Unpublish" : "Bulk Publish"}
54+
title={this.props.bulkOperationTitle}
5455
actionClose={<AlertActionCloseButton data-testid="hide-alert-button" onClose={this.hideAlert} />}
5556
actionLinks={
5657
<React.Fragment>
5758
<AlertActionLink data-testid="view-details-link" onClick={this.handleModalToggle}>View details</AlertActionLink>
5859
</React.Fragment>
5960
}
6061
>
61-
<div><Progress value={this.props.progressSuccessValue} title={this.props.isBulkUnpublish ? "Unpublish Successful" : "Publish Successful"} variant={ProgressVariant.success} size={ProgressSize.sm} /></div>
62-
<div><Progress value={this.props.progressFailureValue} title={this.props.isBulkUnpublish ? "Unpublish Failed" : "Publish Failed (metadata missing)"} variant={ProgressVariant.danger} size={ProgressSize.sm} /></div>
63-
{!this.props.isBulkUnpublish && <div><Progress value={this.props.progressWarningValue} title="Publish Failed (no draft version found)" variant={ProgressVariant.warning} size={ProgressSize.sm} /></div>}
62+
<div><Progress value={this.props.progressSuccessValue} title="Succeeded" variant={ProgressVariant.success} size={ProgressSize.sm} /></div>
63+
<div><Progress value={this.props.progressFailureValue} title="Failed" variant={ProgressVariant.danger} size={ProgressSize.sm} /></div>
64+
{!this.props.isBulkUnpublish && <div><Progress value={this.props.progressWarningValue} title="No drafts found - no action taken" variant={ProgressVariant.warning} size={ProgressSize.sm} /></div>}
6465
</Alert>
6566
</div>
6667
<Modal
@@ -73,7 +74,7 @@ class BulkPublishConfirmation extends React.Component<IBulkPublishProps, any>{
7374
onClose={this.handleModalToggle}
7475
footer={footer}
7576
>
76-
<strong>{`${this.props.isBulkUnpublish ? "Unpublished" : "Published"} Succeessfully:`}</strong>
77+
<strong>Succeeded:</strong>
7778
<br />
7879
<span id="update-succeeded">
7980
{this.props.updateSucceeded.length > 0 && <List aria-label="succeeded" component={ListComponent.ol} type={OrderType.number}>
@@ -88,7 +89,7 @@ class BulkPublishConfirmation extends React.Component<IBulkPublishProps, any>{
8889
</span>
8990
<br />
9091
<br />
91-
{!this.props.isBulkUnpublish && (<div><strong>Publish Ignored:</strong>
92+
{!this.props.isBulkUnpublish && (<div><strong>Ignored:</strong>
9293
<span id="update-ignored">
9394
{this.props.updateIgnored.length > 0 && <List aria-label="ignored" component={ListComponent.ol} type={OrderType.number}>
9495
{this.props.updateIgnored.split(",").map((data, index) => (
@@ -102,7 +103,7 @@ class BulkPublishConfirmation extends React.Component<IBulkPublishProps, any>{
102103
</span></div>)}
103104
<br />
104105
<br />
105-
<strong>{`${this.props.isBulkUnpublish ? "Unpublish" : "Publish"} Failed:`}</strong>
106+
<strong>Failed:</strong>
106107
<br />
107108
<span id="update-failed">
108109
{this.props.updateFailed.length > 0 && <List aria-label="failed" component={ListComponent.ol} type={OrderType.number}>

pantheon-bundle/frontend/src/app/__snapshots__/bulkOperationConfirmation.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
3232
measureLocation="top"
3333
min={0}
3434
size="sm"
35-
title="Update Succeeded"
35+
title="Succeeded"
3636
tooltipPosition="top"
3737
value={50}
3838
valueText={null}
@@ -49,7 +49,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
4949
measureLocation="top"
5050
min={0}
5151
size="sm"
52-
title="Update failed"
52+
title="Failed"
5353
tooltipPosition="top"
5454
value={10}
5555
valueText={null}
@@ -66,7 +66,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
6666
measureLocation="top"
6767
min={0}
6868
size="sm"
69-
title="No draft version found. No action taken"
69+
title="No drafts found - no action taken"
7070
tooltipPosition="top"
7171
value={40}
7272
valueText={null}
@@ -120,7 +120,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
120120
variant="large"
121121
>
122122
<strong>
123-
Update Succeeded:
123+
Succeeded:
124124
</strong>
125125
<br />
126126
<span
@@ -151,7 +151,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
151151
<br />
152152
<br />
153153
<strong>
154-
Update Ignored:
154+
Ignored:
155155
</strong>
156156
<br />
157157
<span
@@ -177,7 +177,7 @@ exports[`BulkOperationConfirmation tests should render BulkOperationConfirmation
177177
<br />
178178
<br />
179179
<strong>
180-
Update Failed:
180+
Failed:
181181
</strong>
182182
<br />
183183
<span

pantheon-bundle/frontend/src/app/bulkOperationConfirmation.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ class BulkOperationConfirmation extends React.Component<IBulkOperationProps, any
6666
</React.Fragment>
6767
}
6868
>
69-
<div><Progress value={this.props.progressSuccessValue} title="Update Succeeded" variant={ProgressVariant.success} size={ProgressSize.sm} /></div>
70-
<div><Progress value={this.props.progressFailureValue} title="Update failed" variant={ProgressVariant.danger} size={ProgressSize.sm} /></div>
71-
<div><Progress value={this.props.progressWarningValue} title="No draft version found. No action taken" variant={ProgressVariant.warning} size={ProgressSize.sm} /></div>
69+
<div><Progress value={this.props.progressSuccessValue} title="Succeeded" variant={ProgressVariant.success} size={ProgressSize.sm} /></div>
70+
<div><Progress value={this.props.progressFailureValue} title="Failed" variant={ProgressVariant.danger} size={ProgressSize.sm} /></div>
71+
<div><Progress value={this.props.progressWarningValue} title="No drafts found - no action taken" variant={ProgressVariant.warning} size={ProgressSize.sm} /></div>
7272
</Alert>
7373
<Modal
7474
variant={ModalVariant.large}
@@ -80,7 +80,7 @@ class BulkOperationConfirmation extends React.Component<IBulkOperationProps, any
8080
onClose={this.handleModalToggle}
8181
footer={footer}
8282
>
83-
<strong>Update Succeeded:</strong>
83+
<strong>Succeeded:</strong>
8484
<br />
8585
<span id="update-succeeded">
8686
{this.props.updateSucceeded.length > 0 && <List aria-label="succeeded" component={ListComponent.ol} type={OrderType.number}>
@@ -96,7 +96,7 @@ class BulkOperationConfirmation extends React.Component<IBulkOperationProps, any
9696
</span>
9797
<br />
9898
<br />
99-
<strong>Update Ignored:</strong>
99+
<strong>Ignored:</strong>
100100
<br />
101101
<span id="update-ignored">
102102
{this.props.updateIgnored.length > 0 && <List aria-label="ignored" component={ListComponent.ol} type={OrderType.number}>
@@ -111,7 +111,7 @@ class BulkOperationConfirmation extends React.Component<IBulkOperationProps, any
111111
</span>
112112
<br />
113113
<br />
114-
<strong>Update Failed:</strong>
114+
<strong>Failed:</strong>
115115
<br />
116116
<span id="update-failed">
117117
{this.props.updateFailed.length > 0 && <List aria-label="failed" component={ListComponent.ol} type={OrderType.number}>
@@ -158,4 +158,4 @@ class BulkOperationConfirmation extends React.Component<IBulkOperationProps, any
158158
}
159159
}
160160

161-
export { BulkOperationConfirmation }
161+
export { BulkOperationConfirmation }

pantheon-bundle/frontend/src/app/bulkOperationMetadata.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class BulkOperationMetadata extends React.Component<IBulkOperationMetadataProps,
416416
this.calculateWarningProgress(this.state.bulkUpdateWarning)
417417
if (this.state.bulkUpdateWarning > 0 && this.state.bulkUpdateWarning === this.props.documentsSelected.length) {
418418

419-
this.setState({ metadataEditError: "No draft versions found on selected items. Unable to save metadata." })
419+
this.setState({ metadataEditError: "No drafts found on selected items. Unable to save metadata." })
420420
}
421421
})
422422
}
@@ -507,4 +507,4 @@ class BulkOperationMetadata extends React.Component<IBulkOperationMetadataProps,
507507
}
508508
}
509509
}
510-
export { BulkOperationMetadata }
510+
export { BulkOperationMetadata }

pantheon-bundle/frontend/src/app/search.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export interface ISearchState {
6363
// bulk publish
6464
isBulkPublish: boolean
6565
isBulkUnpublish: boolean
66+
bulkOperationTitle: string
6667
}
6768
class Search extends Component<IAppState, ISearchState> {
6869
private drawerRef: React.RefObject<HTMLInputElement>;
@@ -110,7 +111,8 @@ class Search extends Component<IAppState, ISearchState> {
110111

111112
//bulk operation - publish
112113
isBulkPublish: false,
113-
isBulkUnpublish: false
114+
isBulkUnpublish: false,
115+
bulkOperationTitle: "Bulk Publish",
114116
};
115117
this.drawerRef = React.createRef();
116118
}
@@ -348,6 +350,7 @@ class Search extends Component<IAppState, ISearchState> {
348350
isBulkPublish={this.state.isBulkPublish}
349351
isBulkUnpublish={this.state.isBulkUnpublish}
350352
bulkOperationCompleted={this.state.bulkOperationCompleted}
353+
bulkOperationTitle={this.state.bulkOperationTitle}
351354
updateIsBulkPublish={this.updateIsBulkPublish}
352355
updateIsBulkUnpublish={this.updateIsBulkUnpublish}
353356
updateBulkOperationCompleted={this.updateBulkOperationCompleted}
@@ -358,6 +361,7 @@ class Search extends Component<IAppState, ISearchState> {
358361
isBulkPublish={this.state.isBulkPublish}
359362
isBulkUnpublish={this.state.isBulkUnpublish}
360363
bulkOperationCompleted={this.state.bulkOperationCompleted}
364+
bulkOperationTitle={this.state.bulkOperationTitle}
361365
updateIsBulkPublish={this.updateIsBulkPublish}
362366
updateIsBulkUnpublish={this.updateIsBulkUnpublish}
363367
updateBulkOperationCompleted={this.updateBulkOperationCompleted}
@@ -687,7 +691,7 @@ class Search extends Component<IAppState, ISearchState> {
687691

688692
//determine if publish or unpublish bulk operation
689693
if (text === 'publish') {
690-
this.setState({ isBulkPublish: !this.state.isBulkPublish, isBulkUnpublish: false }, () => {
694+
this.setState({ isBulkPublish: true, isBulkUnpublish: false, bulkOperationTitle: "Bulk Publish" }, () => {
691695
if (this.state.bulkOperationWarn === false && this.state.repositoriesSelected.length === 1) {
692696
this.setState({ isBulkOperationButtonDisabled: false, bulkOperationCompleted: false })
693697
} else {
@@ -696,7 +700,7 @@ class Search extends Component<IAppState, ISearchState> {
696700
})
697701
}
698702
else if (text === 'unpublish') {
699-
this.setState({ isBulkUnpublish: !this.state.isBulkUnpublish, isBulkPublish: false }, () => {
703+
this.setState({ isBulkUnpublish: true, isBulkPublish: false, bulkOperationTitle: "Bulk Unpublish" }, () => {
700704
if (this.state.bulkOperationWarn === false && this.state.repositoriesSelected.length === 1) {
701705
this.setState({ isBulkOperationButtonDisabled: false, bulkOperationCompleted: false })
702706
} else {

pantheon-bundle/src/main/java/com/redhat/pantheon/validation/model/Validation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public interface Validation extends WorkspaceChild {
2626

2727
default Validation setValidation (Violations violations, int index) {
2828
if(null != violations.get(PantheonConstants.TYPE_XREF)){
29-
this.message().set("invalid Cross reference exists in the document");
29+
this.message().set("Invalid cross references");
3030
this.status().set("error");
3131
this.validationType().set("xref");
3232
this.xrefTarget().set(violations.get(PantheonConstants.TYPE_XREF).getDetails(index));

0 commit comments

Comments
 (0)