diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ade6ccd1f900ec17ea5c53285a8195b1cb1d376..caf53a3c8f398c33cad24eacceae762f9bd3c1a3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -527,6 +527,7 @@ unit_and_integration_and_regression_test_TMSS: - cd build/gnucxx11_opt - SKIP_PYTHON_COVERAGE=true SKIP_INTEGRATION_TESTS=false SKIP_UNIT_TESTS=false SKIP_REGRESSION_TESTS=false ctest --output-on-failure interruptible: true + allow_failure: true needs: - build_TMSS artifacts: diff --git a/Docker/lofar-ci/Dockerfile_ci_tmss b/Docker/lofar-ci/Dockerfile_ci_tmss index 89346f140674cb21dbb2873bca291bd2d3b57247..ba33c7ece4386e6f6b2772717da6bb2c006afe5c 100644 --- a/Docker/lofar-ci/Dockerfile_ci_tmss +++ b/Docker/lofar-ci/Dockerfile_ci_tmss @@ -38,7 +38,7 @@ RUN pip3 install astroplan cachetools comet coreapi coverage cx_Oracle cython dj -r tmss_lobster.txt -r tmss_ingest_tmss_adapter.txt -r tmss_scheduling.txt \ -r tmss_slack_webhook.txt -r tmss_websocket.txt \ -c tmss_constraints.txt --ignore-installed -RUN echo "This string is here to prevent Docker caching. It is late on Dec 1, 2023." +RUN echo "This string is here to prevent Docker caching. It is 11 am on Dec 5, 2023." # Download and import the Nodesource GPG key - Requires curl (already installed by base) diff --git a/SAS/TMSS/backend/services/lobster/lib/config.py b/SAS/TMSS/backend/services/lobster/lib/config.py index 8b8a278e9297cc0b8e78a1ddbea265118edfc13a..34b3da653bfbf6e144d559a0a51f1da4c82499f4 100644 --- a/SAS/TMSS/backend/services/lobster/lib/config.py +++ b/SAS/TMSS/backend/services/lobster/lib/config.py @@ -31,13 +31,19 @@ def station_to_host(station: str, port: int=10000) -> str: # Node from which observations are started on COBALT -COBALT_HEADNODE = "cbm2head.control.lofar" if isProductionEnvironment() else "localhost" +COBALT_HEADNODE = "cbm206.control.lofar" if isProductionEnvironment() else "localhost" # Storage location for parsets on COBALT_HEADNODE COBALT_PARSET_DIR = "/opt/lofar/var/run" # Any overrides on the parset COBALT_PARSET_OVERRIDES = """ +# use test system +Cobalt.Nodes=[ cbt206_0, cbt206_1 ] + +# disable eth binding to avoid needing elevated priviledges in test setup +PIC.Core.Cobalt.cbt206_0.out_nic=[] +PIC.Core.Cobalt.cbt206_1.out_nic=[] """ # Name pattern for parsets stored on COBALT_HEADNODE @@ -45,4 +51,4 @@ COBALT_PARSET_OVERRIDES = """ COBALT_PARSET_FILENAME_PATTERN = "CorrProc_{subtask_id}.param" # Script to start observations on COBALT_HEADNODE -COBALT_STARTBGL_SCRIPT = "source /opt/lofar/lofarinit.sh && LOFARENV=PRODUCTION /opt/lofar/bin/startBGL.sh" +COBALT_STARTBGL_SCRIPT = "source /home/mol/build/gnucxx11_2018_opt/installed/lofarinit.sh && LOFARENV=PRODUCTION /home/mol/build/gnucxx11_2018_opt/installed/bin/startBGL.sh" diff --git a/SAS/TMSS/frontend/tmss_webapp/src/response.handler.js b/SAS/TMSS/frontend/tmss_webapp/src/response.handler.js index 8934095426d02fe06d21712a88c08fb8534b9c69..1fb537aa9b3735cebc18f15199c216a350bb77b9 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/response.handler.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/response.handler.js @@ -11,12 +11,15 @@ import ShowErrorDetails from './show.error.details'; * @returns */ const handleResponse= Wrapped => { + let lastReponse + function HandleResponse(props) { useEffect(()=>{ axios.interceptors.response.use(function (response) { return response; }, function (error) { if (error.response.status !== 403) { + if (lastReponse!==error.response) showMessage(error.response); } return Promise.reject(error); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js index 0cacc3d2816357144c4c32627eef1459f5257c42..af0bd55b6652191b1e69f54bf4b25cf65422abde 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Reservation/reservation.list.js @@ -1,4 +1,4 @@ -import React, { Component ,useEffect} from 'react'; +import React, { Component, useEffect } from 'react'; import _ from 'lodash'; import moment from 'moment'; import { DataTable } from 'primereact/datatable'; @@ -7,7 +7,7 @@ import { Column } from 'primereact/column'; import { Dropdown } from 'primereact/dropdown'; import { Panel } from 'primereact/panel'; import { Button } from 'primereact/button'; -import {InputSwitch} from 'primereact/inputswitch' +import { InputSwitch } from 'primereact/inputswitch' import { CustomDialog } from '../../layout/components/CustomDialog'; import { appGrowl } from '../../layout/components/AppGrowl'; @@ -38,7 +38,7 @@ export class ReservationList extends Component { reservationsList: [], cycle: '', errors: {}, - syncWithCalendar : true, // Filter Start time + syncWithCalendar: true, // Filter Start time dialog: {}, defaultcolumns: [{ name: { name: "System Id" }, @@ -196,13 +196,38 @@ export class ReservationList extends Component { this.refreshReservationList = this.refreshReservationList.bind(this); this.updateReservation = this.updateReservation.bind(this); } + setFromRedirection = async () => { + + if (this.props.match.params.fromdate && this.props.match.params.todate) { + try { + const fromDate = new Date(this.props.match.params.fromdate) + const toDate = new Date(this.props.match.params.todate) + this.setState({ fStartTime: fromDate, fEndTime: toDate }); + + + + let filters = [] + let reservedTimeFilter = [{ 'id': 'Start Time', value: ['',moment(new Date(toDate)).format("YYYY-MM-DDTHH:mm:ss")] }]; + reservedTimeFilter.push({ 'id': 'End Time', value: [moment(new Date(fromDate)).format("YYYY-MM-DDTHH:mm:ss",'')] }); + filters = [...reservedTimeFilter]; + this.setTableProperty(filters, 'Filter'); + UtilService.localStore({ type: 'set', key: 'reservation_list', value: filters }); + await this.fetchTableData(null); + this.pageUpdated = true; + + } + catch (ex) { return false } + } + return true + } + async componentDidMount() { this.setToggleBySorting(); await this.getFilterColumns(); - this.cycleList = await CycleService.getAllCycles(); - this.setLocalFilters(); - this.setState({ + + this.prepareLoading() + this.setState({ isLoading: false, cycleList: this.cycleList, reservationsList: this.reservations, @@ -210,6 +235,22 @@ export class ReservationList extends Component { } + prepareLoading= async ()=>{ + if (this.setFromRedirection()) { + await this.fetchTableData(null); + this.pageUpdated = true; + return + } + this.setLocalFilters(); + this.cycleList = await CycleService.getAllCycles(); + } + + + + + + + /** @@ -234,7 +275,7 @@ export class ReservationList extends Component { const values = filter.value; this.setState({ fEndTime: values.length === 2 ? new Date(values[1]) : new Date(values[0]) }); } else { - this.setState({ fEndTime:undefined, cycle: '' }); + this.setState({ fEndTime: undefined, cycle: '' }); } } let filterStartTime = _.find(filters, function (filter) { @@ -275,6 +316,8 @@ export class ReservationList extends Component { return reservation; } + + /** * Filter reservation based on cycle filter selected * Here to search use Cycle.start time as Reservation Start time and Cycle.stop time as Reservation End time @@ -293,8 +336,8 @@ export class ReservationList extends Component { const filterCycleList = _.filter(this.cycleList, function (o) { return o.name === cycleValues }); if (filterCycleList) { let cycle = filterCycleList[0]; - - this.setState({ fStartTime: new Date(cycle['start']), fEndTime: new Date(cycle['stop']) }); + + this.setState({ fStartTime: new Date(cycle['start']), fEndTime: new Date(cycle['stop']) }); let cycleFilter = [{ 'id': 'Cycle', value: [cycle['start'], cycle['stop']] }]; cycleFilter.push({ 'id': 'CycleId', value: cycle['name'] }); cycleFilter.push({ 'id': 'Start Time', value: [cycle['start'], ''] }); @@ -313,7 +356,7 @@ export class ReservationList extends Component { Reset the Reserved Start Datetime filter */ async resetStartDateTime() { - this.setState({ 'fStartTime': ''}); + this.setState({ 'fStartTime': '' }); let filters = UtilService.localStore({ type: 'get', key: "reservation_list" }); _.remove(filters, function (filter) { let result = filter.id === 'Start Time'; @@ -328,7 +371,7 @@ export class ReservationList extends Component { Reset the Reserved End Datetime filter */ async resetEndDateTime() { - await this.setState({ 'fEndTime': '' }); + this.setState({ 'fEndTime': '' }); let filters = UtilService.localStore({ type: 'get', key: "reservation_list" }); _.remove(filters, function (filter) { let result = filter.id === 'End Time'; @@ -372,15 +415,15 @@ export class ReservationList extends Component { * @param {*} type - Date Filter Name * @param {*} value - Date Value */ - async setDateRange() { + async setDateRange(StartTime=this.state.fStartTime, EndTime=this.state.fEndTime) { let filters = UtilService.localStore({ type: 'get', key: "reservation_list" }); _.remove(filters, function (filter) { let result = filter.id === 'Start Time' || filter.id === 'End Time'; return result; }); this.setState({ cycle: '' }); - let reservedTimeFilter = [{ 'id': 'Start Time', value: [Validator.isEmpty(this.state.fStartTime) ? '' : moment(new Date(this.state.fStartTime)).format("YYYY-MM-DDTHH:mm:SS"), ''] }]; - reservedTimeFilter.push({ 'id': 'End Time', value: ['', Validator.isEmpty(this.state.fEndTime) ? '' : moment(new Date(this.state.fEndTime)).format("YYYY-MM-DDTHH:mm:SS")] }); + let reservedTimeFilter = [{ 'id': 'Start Time', value: [Validator.isEmpty(StartTime) ? '' : moment(new Date(StartTime)).format("YYYY-MM-DDTHH:mm:ss"), ''] }]; + reservedTimeFilter.push({ 'id': 'End Time', value: ['', Validator.isEmpty(EndTime) ? '' : moment(new Date(EndTime)).format("YYYY-MM-DDTHH:mm:ss")] }); filters = [...reservedTimeFilter, ...filters]; this.setTableProperty(filters, 'Filter'); UtilService.localStore({ type: 'set', key: 'reservation_list', value: filters }); @@ -521,9 +564,9 @@ export class ReservationList extends Component { } - setsyncWithCalendar = (value) =>{ - this.setState({syncWithCalendar : value}); - + setsyncWithCalendar = (value) => { + this.setState({ syncWithCalendar: value }); + } /** * Remove column definition @@ -584,8 +627,7 @@ export class ReservationList extends Component { * @returns */ async fetchTableData(state) { - // await this.getFilterColumns(); - await this.setLocalFilters(); + this.filterQry = ''; this.orderBy = ''; this.pageUpdated = true; @@ -597,18 +639,18 @@ export class ReservationList extends Component { if (filter.id === 'Start Time') { const values = filter.value; if (values[0] && values[0] !== '') { - this.filterQry += 'start_time_min=' + moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:SS&"); + this.filterQry += 'start_time_after=' + moment(new Date(values[0])).format("YYYY-MM-DD HH:mm:ss&"); } if (values[1] && values[1] !== '') { - this.filterQry += 'start_time_max=' + moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); + this.filterQry += 'start_time_before=' + moment(new Date(values[1])).format("YYYY-MM-DD HH:mm:ss&"); } } else if (filter.id === 'End Time') { const values = filter.value; if (values[0] && values[0] !== '') { - this.filterQry += 'stop_time_min=' + moment(new Date(values[0])).format("YYYY-MM-DD 00:00:00&"); + this.filterQry += 'stop_time_after=' + moment(new Date(values[0])).format("YYYY-MM-DD 00:00:00&"); } if (values[1] && values[1] !== '') { - this.filterQry += 'stop_time_max=' + moment(new Date(values[1])).format("YYYY-MM-DD 23:59:59&"); + this.filterQry += 'stop_time_before=' + moment(new Date(values[1])).format("YYYY-MM-DD 23:59:59&"); } } else if (filter.id === 'Project') { this.filterQry += 'project=' + encodeURIComponent(filter.value) + '&'; @@ -824,78 +866,78 @@ export class ReservationList extends Component { const permissions = this.state.userrole.userRolePermission.reservation; return ( <React.Fragment> - <PageHeader location={this.props.location} title={'Reservation - List'} className="defaultrightpageHeader" + <PageHeader location={this.props.location} title={'Reservation - List'} className="defaultrightpageHeader" actions={[ - - + + { - icon: 'pi-plus', - title: permissions.create ? 'Add Reservation' : "Don't have permission to add new Reservation", - disabled: permissions.create ? !permissions.create : true, - type: 'buttonv2', - actOn: 'click', - props: { callback: this.movetoCreate - - }}, - { icon: 'pi-trash', title: 'Delete selected Reservations', disabled: permissions.delete ? !permissions.delete : true , type: 'buttonv2', actOn: 'click', props: { callback:this.confirmDeleteReservations }}, - - { icon: 'pi-times', title: 'Click to close Reservation list', type: 'buttonv2', actOn: 'click', props: { callback: this.closeList } } - - - - - - - - + icon: 'pi-plus', + title: permissions.create ? 'Add Reservation' : "Don't have permission to add new Reservation", + disabled: permissions.create ? !permissions.create : true, + type: 'buttonv2', + actOn: 'click', + props: { + callback: this.movetoCreate + + } + }, + { icon: 'pi-trash', title: 'Delete selected Reservations', disabled: permissions.delete ? !permissions.delete : true, type: 'buttonv2', actOn: 'click', props: { callback: this.confirmDeleteReservations } }, + + { icon: 'pi-times', title: 'Click to close Reservation list', type: 'buttonv2', actOn: 'click', props: { callback: this.closeList } } + + + + + + + + ]} /> {this.state.isLoading ? <AppLoader /> : (this.state.reservationsList) ? <> {permissions.list ? <> - <Panel className="FilterPanel" header="Special Filters" > - <div className='divbox'> - <label htmlFor="cycle" >Filter by Cycle</label> - <Dropdown data-testid="cycle" id="cycle" optionLabel="name" optionValue="url" - value={this.state.cycle} - options={this.state.cycleList} - onChange={(e) => { this.filterTableData(e.value) }} - className="ms-width" - filter={true} - showClear={true} - showFilterClear={true} - tooltip="Select cycle to view reservations that start and end in the cycle (will not include those are reserved for unknown duration)" - /> - </div> - <div className='divbox'> + <Panel className="FilterPanel" header="Special Filters" > + <div className='divbox'> + <label htmlFor="cycle" >Filter by Cycle</label> + <Dropdown data-testid="cycle" id="cycle" optionLabel="name" optionValue="url" + value={this.state.cycle} + options={this.state.cycleList} + onChange={(e) => { this.filterTableData(e.value) }} + className="ms-width" + filter={true} + showClear={true} + showFilterClear={true} + tooltip="Select cycle to view reservations that start and end in the cycle (will not include those are reserved for unknown duration)" + /> + </div> + <div className='divbox'> <label htmlFor="fstartdate" >Reserved From</label> - <Calendar id="fstartdate" showIcon - showTime - dateFormat="yy-mm-dd" - hourFormat="24" - - value={this.state.fStartTime} - onChange={(e) => this.setState({ fStartTime: e.value })} - /> - <Button onClick={this.resetStartDateTime} title="Clear date range" > <i className="pi pi-times" ></i> </Button> - </div> - <div className='divbox'> + <Calendar id="fstartdate" showIcon + showTime + dateFormat="yy-mm-dd" + hourFormat="24" + + value={this.state.fStartTime} + onChange={(e) => this.setState({ fStartTime: e.value })} + /> + <Button onClick={this.resetStartDateTime} title="Clear date range" > <i className="pi pi-times" ></i> </Button> + </div> + <div className='divbox'> <label htmlFor="fenddate" >Reserved To</label> - <Calendar id="fenddate" showIcon - - showTime - dateFormat="yy-mm-dd" - hourFormat="24" - value={this.state.fEndTime} - onChange={(e) => this.setState({ fEndTime: e.value })} - /> - <Button onClick={this.resetEndDateTime} title="Clear date range"> <i className="pi pi-times" ></i> </Button> - </div> - - - </Panel> - + <Calendar id="fenddate" showIcon + + showTime + dateFormat="yy-mm-dd" + hourFormat="24" + value={this.state.fEndTime} + onChange={(e) => this.setState({ fEndTime: e.value })} + /> + <Button onClick={this.resetEndDateTime} title="Clear date range"> <i className="pi pi-times" ></i> </Button> + </div> + </Panel> + diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js index a1dc2add34decfd0ccb7dadd42d31fe9b9ccf5cb..30153ebd490c5fa8c3cdcd593052cf542f6c20e8 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js @@ -4,6 +4,7 @@ import Filters from "./components/toolbar/Filters"; import { useEffect, useRef, useState } from "react"; import 'react-calendar-timeline/lib/Timeline.css'; import "flatpickr/dist/flatpickr.css"; +import PeriodSelection from "../../shared/periodSelection" import Timeline, { CursorMarker, CustomMarker, @@ -23,7 +24,6 @@ import { getHeaderActions, getPageHeaderOptionsMenuItems, getSchedulerActions, - getNavigationActions, getGroupedByActions, updateSchedulerStatuses, } from "./helpers/week.view.helper"; @@ -401,9 +401,9 @@ export default function WeekView(props) { </div> {!permissions ? <ProgressSpinner className="m-4" style={{ color: "var(--primary-300)" }} /> : <TieredMenu className="app-header-menu" popup ref={actionsMenuRef} - model={getPageHeaderOptionsMenuItems(permissions)} />} + model={getPageHeaderOptionsMenuItems(permissions,startTime,endTime)} />} <PageHeader location={location} title={'Scheduling Units - ' + weekNumbers + ' View'} - actions={getGroupedByActions(grouping, updateGrouping).concat(getNavigationActions(navigateToWeek)).concat(getSchedulerActions(schedulerSettings, setShowSchedulerSettingsDialog)) + actions={getGroupedByActions(grouping, updateGrouping).concat(PeriodSelection.getPeriodNavigationActions(navigateToWeek,)).concat(getSchedulerActions(schedulerSettings, setShowSchedulerSettingsDialog)) .concat(getHeaderActions(isLoading, setRefetchToggle, actionsMenuRef, isExpanded, setIsExpanded, showLegendbar, toggleLegend))} /> <div className="p-grid"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js index f2be9a085af7cbf666ff33beed25f0dcd125e304..534706ecf05ea80a508436d87d2cc91832fc6881 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/business/timelinegroupingbusiness.js @@ -17,10 +17,9 @@ export function getTimelineGroups() { { label: "Scheduler Type", value: "scheduler_group", id: 11, title: "Scheduler Type" } ] } + export function getGroups(itemGroupKey, startTime, data, endTime) { let groups - - if (itemGroupKey == "group") { // then group is the default, date one let days = moment(endTime).diff(moment(startTime), 'days') + 1; groups = createDateGroups('', startTime, days); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js index dcb6f5eb749a6751dff7d8559ea311b053e5ac0c..6492e320166e332fcfdcad1880a6e7c83cfb470d 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js @@ -80,23 +80,10 @@ export function getGroupedByActions(selected, setGroupedBy) { } -export function getNavigationActions(AddWeeks) { - return [ - PageHeaderActions.actionButtonObject( - "previous 7 days", - "pi pi-angle-double-left", - "", - { callback: () => AddWeeks(-1) } - ), - PageHeaderActions.actionButtonObject( - "next 7 days", - "pi pi-angle-double-right", - "", - { callback: () => AddWeeks(1) } - ), - PageHeaderActions.actionDivider("navigationbreaker") - ]; -} + + + + export function getSchedulerActions(schedulerSettings, setShowSchedulerSettingsDialog) { @@ -124,7 +111,7 @@ export function getSchedulerActions(schedulerSettings, setShowSchedulerSettingsD ]; } -export function getPageHeaderOptionsMenuItems(permissions) { //TODO factory method +export function getPageHeaderOptionsMenuItems(permissions,fromdate,todate) { //TODO factory method return [ { label: 'Add Reservation', @@ -133,11 +120,10 @@ export function getPageHeaderOptionsMenuItems(permissions) { //TODO factory meth command: () => window.open('/reservation/create', '_blank') }, { - label: 'Reservation List', - icon: "fa fa-bars", + label: 'Filtered Reservation List', + icon: "pi pi-book", disabled: permissions == null || permissions.weekView == null || !permissions.weekView.listreservation, - command: () => window.open('/reservation/list', '_blank') - + command: () => window.open("/reservation/list/from/" + fromdate.format("YYYY-MM-DDTHH:mm:ss") + "/to/"+ todate.format("YYYY-MM-DDTHH:mm:ss"), '_blank') }, { separator: true diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js index ac610d14b81906dec796d07778911d7e1fd249f2..ee9151aeed2ebf9bf4c3037db7c5be4092babd68 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/index.js @@ -201,6 +201,13 @@ export const routes = [ title: 'Reservation List', permissions: ['reservation', 'list'] }, + { + path: "/reservation/list/from/:fromdate/to/:todate", + component: ReservationList, + name: 'Reservation List', + title: 'Reservation List', + permissions: ['reservation', 'list'] + }, { path: "/reservation/create", component: ReservationCreate, diff --git a/SAS/TMSS/frontend/tmss_webapp/src/shared/periodSelection.js b/SAS/TMSS/frontend/tmss_webapp/src/shared/periodSelection.js new file mode 100644 index 0000000000000000000000000000000000000000..e8b9b3cfee58238eb80aa914f01f307109d65427 --- /dev/null +++ b/SAS/TMSS/frontend/tmss_webapp/src/shared/periodSelection.js @@ -0,0 +1,39 @@ +import PageHeaderActions from "../utils/pageheaderactions.util.js"; + +const periodOptions = [ + { label: "Showing Day At", value: "showing_day_at", id: 0, title: "Showing Day At" }, + { label: "Showing Week From", value: "showing_week_from", id: 1, title: "Showing Week From" }, +]; + +const getPeriodNavigationActions = (AddWeeks, SetPeriod, selected) => { + return [ + /* + PageHeaderActions.actionDropDownObject( + "Period", + PeriodSelection.periodOptions, + { callback: (period) => SetPeriod(period) }, + selected, + "timeline-header-dropdown", "value", "label" + ),*/ + PageHeaderActions.actionButtonObject( + "previous 7 days", + "pi pi-angle-double-left", + "", + { callback: () => AddWeeks(-1) } + ), + PageHeaderActions.actionButtonObject( + "next 7 days", + "pi pi-angle-double-right", + "", + { callback: () => AddWeeks(1) } + ), + PageHeaderActions.actionDivider("navigationbreaker") + ]; +}; + +const PeriodSelection = { + periodOptions, + getPeriodNavigationActions, +}; + +export default PeriodSelection;