Skip to content

Commit

Permalink
Merge pull request eclipse-sw360#108 from toshiba/release/create_tab_…
Browse files Browse the repository at this point in the history
…Commercial_ECC_Detail

feat(release): Edit Release - Create tab Commercial , ECC Details
  • Loading branch information
hoangnt2 authored Sep 8, 2023
2 parents 8358e4f + feca31e commit abec9a9
Show file tree
Hide file tree
Showing 12 changed files with 406 additions and 1 deletion.
5 changes: 5 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"Assessment Summary information is not present in CLI file": "Assessment Summary information is not present in CLI file",
"Authentication failed Please try again": "Authentication failed. Please try again.",
"Administration": "Administration",
"Ausfuhrliste": "Ausfuhrliste",
"Basic Info": "Basic Info",
"Bazaar": "Bazaar",
"BitKeeper": "BitKeeper",
Expand Down Expand Up @@ -224,6 +225,8 @@
"Enter Domain": "Enter Domain",
"Everyone": "Everyone",
"Enter Version": "Enter Version",
"ECC_STATUS": "Open, \n In Progress, \n Approved, \n Rejected",
"ECCN": "ECCN",
"Field Name": "Field Name",
"File name": "File name",
"Finalized License Scan Report": "Finalized License Scan Report",
Expand Down Expand Up @@ -271,6 +274,7 @@
"INTERNAL_USE": "Internal use",
"Is Checked": "Is Checked",
"IS USED BY THE FOLLOWING COMPONENTS": "IS USED BY THE FOLLOWING COMPONENTS",
"IN_PROGRESS": "In Progress",
"key": "key",
"Key User": "Key User",
"Lifecycle": "Lifecycle",
Expand Down Expand Up @@ -304,6 +308,7 @@
"Linked Releases and Projects": "Linked Releases and Projects",
"Link Release to Project": "Link Release to Project",
"Link To Project": "Link To Project",
"Learn more about ECC statuses":"Learn more about ECC statuses",
"Me and Moderators": "Me and Moderators",
"Mailing list": "Mailing list",
"Mailing List URL": "Mailing List URL",
Expand Down
5 changes: 5 additions & 0 deletions messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"Assessment Summary information is not present in CLI file": "Assessment Summary information is not present in CLI file",
"Authentication failed Please try again": "認証に失敗しました。もう一度お試しください。",
"Administration": "NOT TRANSLATED",
"Ausfuhrliste": "Ausfuhrliste",
"Basic Info": "基本情報",
"Bazaar": "バザール",
"BitKeeper": "ビットキーパー",
Expand Down Expand Up @@ -222,6 +223,8 @@
"Enable Displaying Vulnerabilities": "NOT TRANSLATED",
"Everyone": "NOT TRANSLATED",
"Enter Version": "NOT TRANSLATED",
"ECC_STATUS": "Open, \n In Progress, \n Approved, \n Rejected",
"ECCN": "ECCN",
"Field Name": "フィールド名",
"File name": "ファイル名",
"Finalized License Scan Report": "ライセンススキャンレポート完成",
Expand Down Expand Up @@ -269,6 +272,7 @@
"INTERNAL_USE": "内部利用",
"Is Checked": "NOT TRANSLATED",
"IS USED BY THE FOLLOWING COMPONENTS": "は以下のコンポーネントで使用されます。",
"IN_PROGRESS": "In Progress",
"key": "NOT TRANSLATED",
"Key User": "NOT TRANSLATED",
"Link to Projects": "Link to Projects",
Expand Down Expand Up @@ -299,6 +303,7 @@
"Learn more about project state": "NOT TRANSLATED",
"Linked Releases and Projects": "NOT TRANSLATED",
"Link Releases": "リンクリリース",
"Learn more about ECC statuses":"Learn more about ECC statuses",
"Me and Moderators": "NOT TRANSLATED",
"MAINLINE": "メインライン",
"Mailing list": "メーリングリスト",
Expand Down
5 changes: 5 additions & 0 deletions messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"Assessment Summary information is not present in CLI file": "Assessment Summary information is not present in CLI file",
"Authentication failed Please try again": "Đăng nhập thất bại. Vui lòng thử lại.",
"Administration": "NOT TRANSLATED",
"Ausfuhrliste": "Ausfuhrliste",
"Basic Info": "Basic Info",
"based on license file count": "based on license file count",
"basic_fossology_process": "Nếu nguồn của một bản phát hành được đính kèm với nó, một quy trình FOSSology cơ bản có thể được gọi bằng cách chỉ mở hộp thoại này. Nó bao gồm",
Expand Down Expand Up @@ -223,6 +224,8 @@
"Everyone": "NOT TRANSLATED",
"Enter Version": "NOT TRANSLATED",
"Enter URL": "Nhập URL",
"ECC_STATUS": "Open, \n In Progress, \n Approved, \n Rejected",
"ECCN": "ECCN",
"Field Name": "Tên trường",
"File name": "Tên tệp",
"Finalized License Scan Report": "Báo cáo quét giấy phép đã hoàn thành",
Expand Down Expand Up @@ -270,6 +273,7 @@
"Is Checked": "NOT TRANSLATED",
"IBM Rational Synergy": "Sức mạnh tổng hợp hợp lý của IBM",
"IS USED BY THE FOLLOWING COMPONENTS": "ĐƯỢC SỬ DỤNG BỞI CÁC THÀNH PHẦN SAU",
"IN_PROGRESS": "In Progress",
"key": "NOT TRANSLATED",
"Key User": "NOT TRANSLATED",
"Link to Projects": "Link to Projects",
Expand Down Expand Up @@ -300,6 +304,7 @@
"Licenses": "NOT TRANSLATED",
"Logout": "Đăng Xuất",
"Linked Releases and Projects": "NOT TRANSLATED",
"Learn more about ECC statuses":"Learn more about ECC statuses",
"Me and Moderators": "NOT TRANSLATED",
"MAINLINE": "Đường chính",
"Mailing list": "Danh sách gửi thư",
Expand Down
5 changes: 5 additions & 0 deletions messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Assessment Summary information is not present in CLI file": "CLI文件中没有评估摘要信息",
"Authentication failed Please try again": "认证失败,请重试。",
"Administration": "NOT TRANSLATED",
"Ausfuhrliste": "Ausfuhrliste",
"Basic Info": "基本信息",
"based on license file count": "基于许可证文件数量",
"basic_fossology_process": "如果源文件被附加到一个发行版本,则只需打开此对话框即可调用基本的FOSSology进程。它包括",
Expand Down Expand Up @@ -222,6 +223,8 @@
"Everyone": "NOT TRANSLATED",
"Enter Version": "NOT TRANSLATED",
"Enter URL": "输入网址",
"ECC_STATUS": "Open, \n In Progress, \n Approved, \n Rejected",
"ECCN": "ECCN",
"Field Name": "领域名称",
"File name": "文件名",
"Finalized License Scan Report": "最终许可证扫描报告",
Expand Down Expand Up @@ -268,6 +271,7 @@
"Is Checked": "NOT TRANSLATED",
"IBM Rational Synergy": "IBM Rational Synergy",
"IS USED BY THE FOLLOWING COMPONENTS": "被以下组件使用",
"IN_PROGRESS": "In Progress",
"key": "NOT TRANSLATED",
"Key User": "NOT TRANSLATED",
"Link to Projects": "Link to Projects",
Expand Down Expand Up @@ -298,6 +302,7 @@
"Logout": "登出",
"learn_more_components": "了解有关组件类型的更多信息。",
"Linked Releases and Projects": "NOT TRANSLATED",
"Learn more about ECC statuses":"Learn more about ECC statuses",
"Me and Moderators": "NOT TRANSLATED",
"MAINLINE": "主线",
"Mailing list": "邮件列表",
Expand Down
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;
}
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)
Loading

0 comments on commit abec9a9

Please sign in to comment.