Skip to content
Snippets Groups Projects
Select Git revision
  • e00cffac76f7871300f4cd93cdd57f0bdcccc36b
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

projectStatusDialog.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    projectStatusDialog.js 2.48 KiB
    import PropTypes from 'prop-types';
    import { useState } from "react";
    import { RadioButton } from "primereact/radiobutton";
    import { Dialog } from 'primereact/dialog';
    import { Button  } from 'primereact/button';
    
    export default function ProjectStatusDialog(props) {
        const {
            visible,
            onSave,
            onHide,
            onCancel,
            statusOptions
        } = props
    
        const [projectStatus, setProjectStatus] = useState('');
    
    
        const Save = () => {
            if (!onSave) return;
            onSave(projectStatus);
    
        }
    
        const footer = (
            <div >
                <Button label="Save" className="p-button-primary p-mr-2" icon="pi pi-check" disabled={projectStatus==''} onClick={Save} data-testid="save-btn" />
                <Button label="Cancel" className="act-btn-cancel mr-0" icon="pi pi-times" onClick={onCancel} />
            </div>
        );
        return (
            <Dialog header={`Update Project(s) Status`}
            footer={footer} maximizable= {false}
            visible={visible} maximized={false} position="center" style={{ width: '20vw' }}
            onHide={onHide}
            className="content_dlg">
                <div style={{ width: '100%' }}>
                    <div className="p-fluid">
                        <div className="p-grid p-field" style={{ paddingLeft: '15px' }}>Select the status and click &apos;Save&apos; to update.</div>
                        {statusOptions?.map((option) => {
                            return (
                                <div className="p-col-12 p-2 " style={{width: "100%"}} key={option.value} >
                                    <RadioButton
                                        inputId={option.value}
                                        name={option.value}
                                        value={option.value}
                                        onChange={(e) => setProjectStatus(e.value)} 
                                        checked= {projectStatus === option.value}
                                    />
                                    <label htmlFor={option.value} className='p-radiobutton-label' style={{textTransform: 'capitalize'}}>
                                        {option.value}
                                    </label>
                                </div>
                            )
                        })}
                    </div>
                </div>
        </Dialog>
        );
    }
    
    ProjectStatusDialog.propTypes = {
      visible: PropTypes.any,
      onSave: PropTypes.func,
      onHide: PropTypes.any,
      onCancel: PropTypes.any,
      statusOptions: PropTypes.shape({
        map: PropTypes.func
      })
    }