@@ -29,7 +29,6 @@ import {
29
29
Checkbox ,
30
30
filters2cql ,
31
31
FormattedTime ,
32
- MenuSection ,
33
32
TextLink ,
34
33
DefaultMCLRowFormatter ,
35
34
NoValue ,
@@ -1460,121 +1459,120 @@ class RequestsRoute extends React.Component {
1460
1459
1461
1460
const actionMenu = ( { onToggle, renderColumnsMenu } ) => (
1462
1461
< >
1463
- < MenuSection label = { intl . formatMessage ( { id : 'ui-requests.actions.label' } ) } >
1464
- < IfPermission perm = "ui-requests.create" >
1465
- < Button
1466
- buttonStyle = "dropdownItem"
1467
- id = "clickable-newrequest"
1468
- to = { `${ this . props . location . pathname } ?layer=create` }
1469
- onClick = { onToggle }
1470
- >
1471
- < Icon icon = "plus-sign" >
1472
- < FormattedMessage id = "stripes-smart-components.new" />
1473
- </ Icon >
1474
- </ Button >
1475
- </ IfPermission >
1476
- { csvReportPending ?
1462
+ < IfPermission perm = "ui-requests.create" >
1463
+ < Button
1464
+ buttonStyle = "dropdownItem"
1465
+ id = "clickable-newrequest"
1466
+ to = { `${ this . props . location . pathname } ?layer=create` }
1467
+ onClick = { onToggle }
1468
+ >
1469
+ < Icon icon = "plus-sign" >
1470
+ < FormattedMessage id = "stripes-smart-components.new" />
1471
+ </ Icon >
1472
+ </ Button >
1473
+ </ IfPermission >
1474
+ { csvReportPending ?
1475
+ < LoadingButton >
1476
+ < FormattedMessage id = "ui-requests.csvReportPending" />
1477
+ </ LoadingButton > :
1478
+ < Button
1479
+ buttonStyle = "dropdownItem"
1480
+ id = "exportToCsvPaneHeaderBtn"
1481
+ disabled = { ! requestCount }
1482
+ onClick = { ( ) => {
1483
+ this . context . sendCallout ( { message : < FormattedMessage id = "ui-requests.csvReportInProgress" /> } ) ;
1484
+ onToggle ( ) ;
1485
+ this . exportData ( ) ;
1486
+ } }
1487
+ >
1488
+ < Icon icon = "download" >
1489
+ < FormattedMessage id = "ui-requests.exportSearchResultsCsv" />
1490
+ </ Icon >
1491
+ </ Button >
1492
+ }
1493
+ {
1494
+ isPickSlipsArePending ?
1477
1495
< LoadingButton >
1478
- < FormattedMessage id = "ui-requests.csvReportPending " />
1496
+ < FormattedMessage id = "ui-requests.pickSlipsLoading " />
1479
1497
</ LoadingButton > :
1480
- < Button
1481
- buttonStyle = "dropdownItem"
1482
- id = "exportToCsvPaneHeaderBtn"
1483
- disabled = { ! requestCount }
1484
- onClick = { ( ) => {
1485
- this . context . sendCallout ( { message : < FormattedMessage id = "ui-requests.csvReportInProgress" /> } ) ;
1486
- onToggle ( ) ;
1487
- this . exportData ( ) ;
1488
- } }
1489
- >
1490
- < Icon icon = "download" >
1491
- < FormattedMessage id = "ui-requests.exportSearchResultsToCsv" />
1492
- </ Icon >
1493
- </ Button >
1494
- }
1495
- {
1496
- isPickSlipsArePending ?
1497
- < LoadingButton >
1498
- < FormattedMessage id = "ui-requests.pickSlipsLoading" />
1499
- </ LoadingButton > :
1500
- < >
1501
- < Button
1502
- data-testid = "exportExpiredHoldShelfToCsvButton"
1503
- buttonStyle = "dropdownItem"
1504
- id = "exportExpiredHoldsToCsvPaneHeaderBtn"
1505
- disabled = { holdsShelfReportPending || ( servicePointId && requestsEmpty ) }
1506
- onClick = { ( ) => {
1498
+ < >
1499
+ < Button
1500
+ data-testid = "exportExpiredHoldShelfToCsvButton"
1501
+ buttonStyle = "dropdownItem"
1502
+ id = "exportExpiredHoldsToCsvPaneHeaderBtn"
1503
+ disabled = { holdsShelfReportPending || ( servicePointId && requestsEmpty ) }
1504
+ onClick = { ( ) => {
1505
+ onToggle ( ) ;
1506
+ this . exportExpiredHoldsToCSV ( ) ;
1507
+ } }
1508
+ >
1509
+ < Icon icon = "report" >
1510
+ < FormattedMessage
1511
+ id = "ui-requests.exportExpiredHoldShelfCsv"
1512
+ values = { { currentServicePoint : servicePointName } }
1513
+ />
1514
+ </ Icon >
1515
+ </ Button >
1516
+ < PrintButton
1517
+ buttonStyle = "dropdownItem"
1518
+ id = "printPickSlipsBtn"
1519
+ disabled = { isPickSlipsEmpty }
1520
+ template = { pickSlipsPrintTemplate }
1521
+ contentRef = { this . pickSlipsPrintContentRef }
1522
+ onBeforeGetContent = { ( ) => this . onBeforeGetContentForPrintButton ( onToggle ) }
1523
+ onBeforePrint = { async ( ) => {
1524
+ if ( isViewPrintDetailsEnabled ) {
1525
+ const requestIds = extractPickSlipRequestIds ( pickSlipsData ) ;
1526
+ await this . savePrintEventDetails ( requestIds ) ;
1527
+ }
1528
+ } }
1529
+ onAfterPrint = { this . onAfterPrintForPrintButton }
1530
+ >
1531
+ < Icon icon = "print" >
1532
+ < FormattedMessage
1533
+ id = "ui-requests.printPickSlipsForSp"
1534
+ values = { { sp : servicePointName } }
1535
+ />
1536
+ </ Icon >
1537
+ </ PrintButton >
1538
+ < PrintButton
1539
+ buttonStyle = "dropdownItem"
1540
+ id = "printSelectedPickSlipsBtn"
1541
+ disabled = { isPrintingDisabled }
1542
+ template = { pickSlipsPrintTemplate }
1543
+ contentRef = { this . printSelectedContentRef }
1544
+ onBeforeGetContent = {
1545
+ ( ) => new Promise ( resolve => {
1546
+ this . context . sendCallout ( { message : < FormattedMessage id = "ui-requests.printInProgress" /> } ) ;
1507
1547
onToggle ( ) ;
1508
- this . exportExpiredHoldsToCSV ( ) ;
1509
- } }
1510
- >
1511
- < Icon icon = "download" >
1512
- < FormattedMessage
1513
- id = "ui-requests.exportExpiredHoldShelfToCsv"
1514
- values = { { currentServicePoint : servicePointName } }
1515
- />
1516
- </ Icon >
1517
- </ Button >
1518
- < PrintButton
1519
- buttonStyle = "dropdownItem"
1520
- id = "printPickSlipsBtn"
1521
- disabled = { isPickSlipsEmpty }
1522
- template = { pickSlipsPrintTemplate }
1523
- contentRef = { this . pickSlipsPrintContentRef }
1524
- onBeforeGetContent = { ( ) => this . onBeforeGetContentForPrintButton ( onToggle ) }
1525
- onBeforePrint = { async ( ) => {
1548
+ // without the timeout the printing process starts right away
1549
+ // and the callout and onToggle above are blocked
1550
+ setTimeout ( ( ) => resolve ( ) , 1000 ) ;
1551
+ multiSelectPickSlipData = getSelectedSlipDataMulti ( pickSlipsData , selectedRows ) ;
1552
+ } )
1553
+ }
1554
+ onBeforePrint = {
1555
+ async ( ) => {
1526
1556
if ( isViewPrintDetailsEnabled ) {
1527
- const requestIds = extractPickSlipRequestIds ( pickSlipsData ) ;
1528
- await this . savePrintEventDetails ( requestIds ) ;
1529
- }
1530
- } }
1531
- onAfterPrint = { this . onAfterPrintForPrintButton }
1532
- >
1533
- < Icon icon = "print" >
1534
- < FormattedMessage
1535
- id = "ui-requests.printPickSlips"
1536
- values = { { sp : servicePointName } }
1537
- />
1538
- </ Icon >
1539
- </ PrintButton >
1540
- < PrintButton
1541
- buttonStyle = "dropdownItem"
1542
- id = "printSelectedPickSlipsBtn"
1543
- disabled = { isPrintingDisabled }
1544
- template = { pickSlipsPrintTemplate }
1545
- contentRef = { this . printSelectedContentRef }
1546
- onBeforeGetContent = {
1547
- ( ) => new Promise ( resolve => {
1548
- this . context . sendCallout ( { message : < FormattedMessage id = "ui-requests.printInProgress" /> } ) ;
1549
- onToggle ( ) ;
1550
- // without the timeout the printing process starts right away
1551
- // and the callout and onToggle above are blocked
1552
- setTimeout ( ( ) => resolve ( ) , 1000 ) ;
1553
- multiSelectPickSlipData = getSelectedSlipDataMulti ( pickSlipsData , selectedRows ) ;
1554
- } )
1555
- }
1556
- onBeforePrint = {
1557
- async ( ) => {
1558
- if ( isViewPrintDetailsEnabled ) {
1559
- const selectedPickSlips = getSelectedSlipDataMulti ( pickSlipsData , selectedRows ) ;
1560
- const selectedRequestIds = extractPickSlipRequestIds ( selectedPickSlips ) ;
1561
- await this . savePrintEventDetails ( selectedRequestIds ) ;
1562
- }
1557
+ const selectedPickSlips = getSelectedSlipDataMulti ( pickSlipsData , selectedRows ) ;
1558
+ const selectedRequestIds = extractPickSlipRequestIds ( selectedPickSlips ) ;
1559
+ await this . savePrintEventDetails ( selectedRequestIds ) ;
1563
1560
}
1564
1561
}
1565
- onAfterPrint = { this . onAfterPrintForPrintButton }
1566
- >
1567
- < Icon icon = "print" >
1568
- < FormattedMessage
1569
- id = "ui-requests.printPickSlipsSelected"
1570
- values = { { sp : servicePointName } }
1571
- />
1572
- </ Icon >
1573
- </ PrintButton >
1574
- </ >
1575
- }
1576
- {
1577
- isPrintHoldRequestsEnabled &&
1562
+ }
1563
+ onAfterPrint = { this . onAfterPrintForPrintButton }
1564
+ >
1565
+ < Icon icon = "print" >
1566
+ < FormattedMessage
1567
+ id = "ui-requests.printSelectedPickSlipsForSp"
1568
+ values = { { sp : servicePointName } }
1569
+ />
1570
+ </ Icon >
1571
+ </ PrintButton >
1572
+ </ >
1573
+ }
1574
+ {
1575
+ isPrintHoldRequestsEnabled &&
1578
1576
< >
1579
1577
{
1580
1578
isSearchSlipsArePending ?
@@ -1591,15 +1589,14 @@ class RequestsRoute extends React.Component {
1591
1589
>
1592
1590
< Icon icon = "print" >
1593
1591
< FormattedMessage
1594
- id = "ui-requests.printSearchSlips "
1592
+ id = "ui-requests.printSearchSlipsForSp "
1595
1593
values = { { sp : servicePointName } }
1596
1594
/>
1597
1595
</ Icon >
1598
1596
</ PrintButton >
1599
1597
}
1600
1598
</ >
1601
- }
1602
- </ MenuSection >
1599
+ }
1603
1600
{ renderColumnsMenu }
1604
1601
</ >
1605
1602
) ;
0 commit comments