forked from eclipse-sw360/sw360-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-sw360#108 from toshiba/release/create_tab_…
…Commercial_ECC_Detail feat(release): Edit Release - Create tab Commercial , ECC Details
- Loading branch information
Showing
12 changed files
with
406 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/app/[locale]/components/editRelease/[id]/releases/ECCDetails/EditECCDetails.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright (C) TOSHIBA CORPORATION, 2023. Part of the SW360 Frontend Project. | ||
Copyright (C) Toshiba Software Development (Vietnam) Co., Ltd., 2023. Part of the SW360 Frontend Project. | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
License-Filename: LICENSE | ||
*/ | ||
|
||
.link-sidebar { | ||
background-color: white !important; | ||
color: #6b6c7e !important; | ||
} | ||
|
||
.button, | ||
.button:focus, | ||
.button:active { | ||
background-color: #f28809 !important; | ||
border-color: #dbdce4 !important; | ||
color: black !important; | ||
} | ||
.button:hover { | ||
background-color: #f28809 !important; | ||
border-color: #dbdce4 !important; | ||
color: white !important; | ||
} | ||
|
||
.button-plain, | ||
.button-plain:focus, | ||
.button-plain:active { | ||
border-color: #dbdce4 !important; | ||
color: #6b6c7e !important; | ||
background-color: white !important; | ||
} | ||
.button-plain:hover { | ||
border-color: #dbdce4 !important; | ||
color: black !important; | ||
background-color: #f8f9fa !important; | ||
} | ||
|
||
.header { | ||
background-color: #5D8EA9; | ||
color: white; | ||
} | ||
|
||
.list-group-item-action { | ||
background-color: white !important; | ||
color: #6b6c7e !important; | ||
} | ||
|
||
.list-group-item-action:hover { | ||
border-color: #dbdce4 !important; | ||
color: #6b6c7e !important; | ||
background-color: #edcaa0 !important; | ||
} | ||
|
||
.sidebar-active { | ||
border-color: #dbdce4 !important; | ||
color: #6b6c7e !important; | ||
background-color: #e89734 !important; | ||
} |
203 changes: 203 additions & 0 deletions
203
src/app/[locale]/components/editRelease/[id]/releases/ECCDetails/EditECCDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
// Copyright (C) TOSHIBA CORPORATION, 2023. Part of the SW360 Frontend Project. | ||
// Copyright (C) Toshiba Software Development (Vietnam) Co., Ltd., 2023. Part of the SW360 Frontend Project. | ||
|
||
// This program and the accompanying materials are made | ||
// available under the terms of the Eclipse Public License 2.0 | ||
// which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
// SPDX-License-Identifier: EPL-2.0 | ||
// License-Filename: LICENSE | ||
|
||
'use client' | ||
import { useTranslations } from 'next-intl' | ||
import styles from './EditECCDetails.module.css' | ||
import { COMMON_NAMESPACE } from '@/object-types/Constants' | ||
import { OverlayTrigger, Tooltip } from 'react-bootstrap' | ||
import { BiInfoCircle } from 'react-icons/bi' | ||
import React from 'react' | ||
import ReleasePayload from '@/object-types/ReleasePayload' | ||
|
||
interface Props { | ||
releasePayload?: ReleasePayload | ||
setReleasePayload?: React.Dispatch<React.SetStateAction<ReleasePayload>> | ||
} | ||
|
||
const ShowInfoOnHover = ({ text }: { text: string }) => { | ||
return ( | ||
<> | ||
<OverlayTrigger overlay={<Tooltip>{text}</Tooltip>}> | ||
<span className='d-inline-block'> | ||
<BiInfoCircle /> | ||
</span> | ||
</OverlayTrigger> | ||
</> | ||
) | ||
} | ||
|
||
const EditECCDetails = ({ releasePayload, setReleasePayload }: Props) => { | ||
const t = useTranslations(COMMON_NAMESPACE) | ||
const updateField = (e: React.ChangeEvent<HTMLSelectElement | HTMLInputElement>) => { | ||
setReleasePayload({ | ||
...releasePayload, | ||
eccInformation: { | ||
...releasePayload.eccInformation, | ||
[e.target.name]: e.target.value, | ||
}, | ||
}) | ||
} | ||
|
||
return ( | ||
<> | ||
<div className='container' style={{ maxWidth: '98vw', marginTop: '10px', fontSize: '0.875rem' }}> | ||
<div className='col' style={{ padding: '0px 12px', fontSize: '0.875rem' }}> | ||
<div className='row mb-4'> | ||
<div className={`${styles['header']} mb-2`}> | ||
<p className='fw-bold mt-3'>{t('ECC Information')}</p> | ||
</div> | ||
<div className='row'> | ||
<div className='col-lg-4'> | ||
<label htmlFor='ECC_Status' className='form-label fw-bold'> | ||
{t('ECC Status')} | ||
</label> | ||
<select | ||
className='form-select' | ||
aria-label='component_type' | ||
id='ECC_Status' | ||
required | ||
name='eccStatus' | ||
value={releasePayload.eccInformation?.eccStatus ?? ''} | ||
onChange={updateField} | ||
> | ||
<option value='OPEN'>{t('OPEN')}</option> | ||
<option value='IN_PROGRESS'> {t('IN_PROGRESS')}</option> | ||
<option value='APPROVED'>{t('APPROVED')}</option> | ||
<option value='REJECTED'>{t('REJECTED')}</option> | ||
</select> | ||
<div className='form-text' id='addProjects.visibility.HelpBlock'> | ||
<ShowInfoOnHover text={t('ECC_STATUS')} /> | ||
{t('Learn more about ECC statuses')}. | ||
</div> | ||
</div> | ||
<div className='col-lg-4'> | ||
<label htmlFor='ECC_comment' className='form-label fw-bold'> | ||
{t('ECC Comment')} | ||
</label> | ||
<input | ||
type='text' | ||
className='form-control' | ||
placeholder='Enter ECC comment' | ||
id='ECC_comment' | ||
aria-describedby='version' | ||
required | ||
name='eccComment' | ||
value={releasePayload.eccInformation?.eccComment ?? ''} | ||
onChange={updateField} | ||
/> | ||
</div> | ||
</div> | ||
<hr className='my-2' /> | ||
<div className='row'> | ||
<div className='col-lg-4'> | ||
<label htmlFor='ausfuhrliste' className='form-label fw-bold'> | ||
{t('Ausfuhrliste')} | ||
</label> | ||
<input | ||
type='text' | ||
className='form-control' | ||
placeholder='Enter AL' | ||
id='ausfuhrliste' | ||
aria-describedby='ausfuhrliste' | ||
name='al' | ||
value={releasePayload.eccInformation?.al ?? ''} | ||
onChange={updateField} | ||
/> | ||
</div> | ||
<div className='col-lg-4'> | ||
<label htmlFor='eccn' className='form-label fw-bold'> | ||
{t('ECCN')} | ||
</label> | ||
<input | ||
type='text' | ||
className='form-control' | ||
placeholder='Enter ECCN' | ||
id='eccn' | ||
aria-describedby='eccn' | ||
name='eccn' | ||
value={releasePayload.eccInformation?.eccn ?? ''} | ||
onChange={updateField} | ||
/> | ||
</div> | ||
<div className='col-lg-4'> | ||
<label htmlFor='material_index_number' className='form-label fw-bold'> | ||
{t('Material Index Number')} | ||
</label> | ||
<input | ||
type='text' | ||
className='form-control' | ||
placeholder='Enter material index number' | ||
id='material_index_number' | ||
aria-describedby='material_index_number' | ||
name='materialIndexNumber' | ||
value={releasePayload.eccInformation?.materialIndexNumber ?? ''} | ||
onChange={updateField} | ||
/> | ||
</div> | ||
</div> | ||
<hr className='my-2' /> | ||
<div className='row'> | ||
<div className='col-lg-4'> | ||
<label htmlFor='assessor_contact_person' className='form-label fw-bold'> | ||
{t('Assessor Contact Person')} | ||
</label> | ||
<input | ||
type='URL' | ||
className='form-control' | ||
placeholder='Will be set automatically' | ||
id='assessor_contact_person' | ||
aria-describedby='assessor_contact_person' | ||
name='assessorContactPerson' | ||
readOnly={true} | ||
value={releasePayload.eccInformation?.assessorContactPerson ?? ''} | ||
/> | ||
</div> | ||
<div className='col-lg-4'> | ||
<label htmlFor='assessor_department' className='form-label fw-bold'> | ||
{t('Assessor Department')} | ||
</label> | ||
<input | ||
type='text' | ||
className='form-control' | ||
placeholder='Will be set automatically' | ||
id='assessor_department' | ||
aria-describedby='assessor_department' | ||
name='assessorDepartment' | ||
readOnly={true} | ||
value={releasePayload.eccInformation?.assessorDepartment ?? ''} | ||
/> | ||
</div> | ||
<div className='col-lg-4'> | ||
<label htmlFor='assessment_date' className='form-label fw-bold'> | ||
{t('Assessment Date')} | ||
</label> | ||
<input | ||
type='date' | ||
className='form-control' | ||
data-bs-toggle='modal' | ||
data-bs-target='#search_vendors_modal' | ||
placeholder={t('Will be set automatically')} | ||
id='assessment_date' | ||
aria-describedby='assessment_date' | ||
readOnly={true} | ||
name='assessmentDate' | ||
value={releasePayload.eccInformation?.assessmentDate ?? ''} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default React.memo(EditECCDetails) |
Oops, something went wrong.