Skip to content

Commit

Permalink
Merge pull request #331 from toshiba/release/fix-linter-for-component…
Browse files Browse the repository at this point in the history
…-release

fix(Code): Fix linter error component/release pages
  • Loading branch information
heliocastro authored Sep 30, 2024
2 parents 883d312 + 732d5ac commit 32316bb
Show file tree
Hide file tree
Showing 118 changed files with 3,263 additions and 3,059 deletions.
5 changes: 4 additions & 1 deletion messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Lizenzarchiv herunterladen",
"Drop a File Here": "Eine Datei hier fallen lassen",
"Duplicate": "Duplikat",
"Dynamically linked": "Dynamisch verknüpft",
"Duplicated Releases": "Doppelte Veröffentlichungen",
"Dynamically linked": "Dynamisch verknüpft",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Zeitpunkt",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "Vollständiger Name",
"License Info": "Lizenzinformationen",
"License Info Header": "Lizenz Info Header",
"License Name": "Lizenzname",
"License Obligation": "Lizenzpflicht",
"License Scan Report Result": "Lizenz Scan Report Ergebnis",
"License Shortname": "Kurzbezeichnung",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Quelle Code Original aus der Gemeinschaft",
"Source Code Self-Made": "Quelle Code Self-Made",
"Source Code Tool-Made": "Quelle Code Tool-Made",
"Source File List": "Liste der Quelldateien",
"Source file": "Quelldatei",
"Source file (Self-made)": "Quelle-Datei (Self-made)",
"Source file information not found in CLI": "Informationen zur Quelldatei wurden in der CLI nicht gefunden",
"Source file information not found in ISR": "Informationen zur Quelldatei wurden im ISR nicht gefunden",
"Special risk Open Source Software": "Spezialrisiko Open Source Software",
"Special risks 3rd party software": "Sonderrisiken Software für Dritte",
"Specific": "Spezifisch",
Expand Down
5 changes: 4 additions & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Download License Archive",
"Drop a File Here": "Drop a File Here",
"Duplicate": "Duplicate",
"Dynamically linked": "Dynamically linked",
"Duplicated Releases": "Duplicated Releases",
"Dynamically linked": "Dynamically linked",
"E-Mail Notification Preferences": "E-Mail Notification Preferences",
"ECC": "ECC",
"ECC Assessment Date": "ECC Assessment Date",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "License Fullname",
"License Info": "License Info",
"License Info Header": "License Info Header",
"License Name": "License Name",
"License Obligation": "License Obligation",
"License Scan Report Result": "License Scan Report Result",
"License Shortname": "License Shortname",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Source Code Original from Community",
"Source Code Self-Made": "Source Code Self-Made",
"Source Code Tool-Made": "Source Code Tool-Made",
"Source File List": "Source File List",
"Source file": "Source file",
"Source file (Self-made)": "Source file (Self-made)",
"Source file information not found in CLI": "Source file information not found in CLI",
"Source file information not found in ISR": "Source file information not found in ISR",
"Special risk Open Source Software": "Special risk Open Source Software",
"Special risks 3rd party software": "Special risks 3rd party software",
"Specific": "Specific",
Expand Down
5 changes: 4 additions & 1 deletion messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Descargar Archivo de la licencia",
"Drop a File Here": "Suelte un archivo aquí",
"Duplicate": "Duplicar",
"Dynamically linked": "Vinculado dinámicamente",
"Duplicated Releases": "Lanzamientos duplicados",
"Dynamically linked": "Vinculado dinámicamente",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Fecha de evaluación",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "Licencia Nombre completo",
"License Info": "Información de licencia",
"License Info Header": "Información de licencia",
"License Name": "Nombre de licencia",
"License Obligation": "Obligación de licencia",
"License Scan Report Result": "Informe de exploración de licencias Resultado",
"License Shortname": "Licencia Nombre",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Código original de la comunidad",
"Source Code Self-Made": "Código de Fuente Auto-Made",
"Source Code Tool-Made": "Fuente Code Tool-Made",
"Source File List": "Lista de archivos fuente",
"Source file": "Archivo fuente",
"Source file (Self-made)": "Archivo fuente (auto-hecha)",
"Source file information not found in CLI": "La información del archivo fuente no se encuentra en la CLI",
"Source file information not found in ISR": "La información del archivo fuente no se encuentra en ISR",
"Special risk Open Source Software": "Riesgo especial Software de código abierto",
"Special risks 3rd party software": "Riesgos especiales Software de terceros",
"Specific": "Específico",
Expand Down
5 changes: 4 additions & 1 deletion messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Télécharger l'archive des licences",
"Drop a File Here": "Déposer un fichier ici",
"Duplicate": "Dupliquer",
"Dynamically linked": "Lié dynamiquement",
"Duplicated Releases": "Versions dupliquées",
"Dynamically linked": "Lié dynamiquement",
"E-Mail Notification Preferences": "",
"ECC": "CCE",
"ECC Assessment Date": "CCE Date d'évaluation",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "Nom complet de licence",
"License Info": "Informations sur la licence",
"License Info Header": "En-tête des informations de licence",
"License Name": "Nom de la licence",
"License Obligation": "Obligation de licence",
"License Scan Report Result": "Résultat du rapport d'analyse de licence",
"License Shortname": "Nom abrégé de licence",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Code source Original de la Communauté",
"Source Code Self-Made": "Code source Auto-Fait",
"Source Code Tool-Made": "Outil de code source",
"Source File List": "Liste des fichiers sources",
"Source file": "Fichier source",
"Source file (Self-made)": "Fichier source (auto-fait)",
"Source file information not found in CLI": "Informations sur le fichier source introuvables dans la CLI",
"Source file information not found in ISR": "Informations sur le fichier source introuvables dans ISR",
"Special risk Open Source Software": "Risque spécial Logiciel Open Source",
"Special risks 3rd party software": "Risques spéciaux Logiciels tiers",
"Specific": "Spécifique",
Expand Down
5 changes: 4 additions & 1 deletion messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "ライセンスアーカイブのダウンロード",
"Drop a File Here": "Drop a File Here",
"Duplicate": "Duplicate",
"Dynamically linked": "動的にリンクされる",
"Duplicated Releases": "重複したリリース",
"Dynamically linked": "動的にリンクされる",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Assessment Date",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "ライセンスのフルネーム",
"License Info": "ライセンス情報",
"License Info Header": "License Info Header",
"License Name": "ライセンス名",
"License Obligation": "ライセンスの義務",
"License Scan Report Result": "ライセンススキャンレポート結果",
"License Shortname": "ライセンスの短縮名",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "ソースコード コミュニティからのオリジナル",
"Source Code Self-Made": "独自・自作のソースコード",
"Source Code Tool-Made": "ツール生成のソースコード",
"Source File List": "ソースファイルリスト",
"Source file": "ソースファイル",
"Source file (Self-made)": "ソースファイル(自作)",
"Source file information not found in CLI": "CLI でソース ファイル情報が見つかりません",
"Source file information not found in ISR": "ソース ファイル情報が ISR に見つかりません",
"Special risk Open Source Software": "特別なリスク オープンソース ソフトウェア",
"Special risks 3rd party software": "特別なリスクがあるサードパーティ製ソフトウェア",
"Specific": "特定の",
Expand Down
5 changes: 4 additions & 1 deletion messages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "다운로드 License Archive",
"Drop a File Here": "파일 삭제",
"Duplicate": "기타 제품",
"Dynamically linked": "동적으로 연결됨",
"Duplicated Releases": "중복된 릴리스",
"Dynamically linked": "동적으로 연결됨",
"E-Mail Notification Preferences": "",
"ECC": "사이트맵",
"ECC Assessment Date": "사이트맵 평가 날짜",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "라이센스 Fullname",
"License Info": "라이센스 정보",
"License Info Header": "라이센스 정보 Header",
"License Name": "라이센스 이름",
"License Obligation": "라이센스 의무",
"License Scan Report Result": "면허 검사 결과",
"License Shortname": "라이센스 Shortname",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Source Code Original from 커뮤니티",
"Source Code Self-Made": "소스 코드 Self-Made",
"Source Code Tool-Made": "소스 코드 Tool-Made",
"Source File List": "소스 파일 목록",
"Source file": "소스 파일",
"Source file (Self-made)": "소스 파일 (Self-made)",
"Source file information not found in CLI": "CLI에서 소스 파일 정보를 찾을 수 없습니다.",
"Source file information not found in ISR": "ISR에서 소스 파일 정보를 찾을 수 없습니다.",
"Special risk Open Source Software": "특수 위험 오픈 소스 소프트웨어",
"Special risks 3rd party software": "특별 위험 3rd 파티 소프트웨어",
"Specific": "특정한",
Expand Down
5 changes: 4 additions & 1 deletion messages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Baixar arquivo de licença",
"Drop a File Here": "Solte um arquivo aqui ou",
"Duplicate": "Duplicate",
"Dynamically linked": "Vinculado dinamicamente",
"Duplicated Releases": "Versões duplicadas",
"Dynamically linked": "Vinculado dinamicamente",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Assessment Date",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "Nome completo da licença",
"License Info": "Informações sobre licença",
"License Info Header": "Cabeçalho das informações da licença",
"License Name": "Nome da licença",
"License Obligation": "Obrigação de licença",
"License Scan Report Result": "Resultado do relatório de digitalização da licença",
"License Shortname": "Nome abreviado da licença",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Código-fonte original da comunidade",
"Source Code Self-Made": "Código-fonte Self-Made",
"Source Code Tool-Made": "Ferramenta de código-fonte - Feita",
"Source File List": "Lista de arquivos de origem",
"Source file": "Arquivo fonte",
"Source file (Self-made)": "Arquivo fonte (Self-made)",
"Source file information not found in CLI": "Informações do arquivo de origem não encontradas na CLI",
"Source file information not found in ISR": "Informações do arquivo de origem não encontradas no ISR",
"Special risk Open Source Software": "Software de código aberto de risco especial",
"Special risks 3rd party software": "Riscos especiais software DE terceiros",
"Specific": "Específico",
Expand Down
5 changes: 4 additions & 1 deletion messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "Tải xuống kho lưu trữ giấy phép",
"Drop a File Here": "Thả một tập tin ở đây",
"Duplicate": "Nhân bản",
"Dynamically linked": "Liên kết động",
"Duplicated Releases": "Bản phát hành trùng lặp",
"Dynamically linked": "Liên kết động",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Assessment Date",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "Tên đầy đủ của giấy phép",
"License Info": "Thông tin giấy phép",
"License Info Header": "Tiêu đề thông tin giấy phép",
"License Name": "Tên giấy phép",
"License Obligation": "Nghĩa vụ cấp phép",
"License Scan Report Result": "Kết quả báo cáo quét giấy phép",
"License Shortname": "Tên viết tắt giấy phép",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "Mã nguồn gốc từ cộng đồng",
"Source Code Self-Made": "Mã nguồn tự tạo",
"Source Code Tool-Made": "Mã nguồn được tạo bởi công cụ",
"Source File List": "Danh sách tệp nguồn",
"Source file": "Tệp nguồn",
"Source file (Self-made)": "Tệp nguồn (Tự tạo)",
"Source file information not found in CLI": "Không tìm thấy thông tin tệp nguồn trong CLI",
"Source file information not found in ISR": "Không tìm thấy thông tin tệp nguồn trong ISR",
"Special risk Open Source Software": "Rủi ro đặc biệt Phần mềm mã nguồn mở",
"Special risks 3rd party software": "Rủi ro đặc biệt Phần mềm của bên thứ 3",
"Specific": "Cụ thể",
Expand Down
5 changes: 4 additions & 1 deletion messages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "下载许可证归档",
"Drop a File Here": "将文件拖放到此处",
"Duplicate": "复制",
"Dynamically linked": "动态链接",
"Duplicated Releases": "重复发布",
"Dynamically linked": "动态链接",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC Assessment Date",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "许可证全名",
"License Info": "许可证信息",
"License Info Header": "许可证信息标头",
"License Name": "许可证名称",
"License Obligation": "许可义务",
"License Scan Report Result": "许可证扫描报告结果",
"License Shortname": "许可证简称",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "源码来源于社区",
"Source Code Self-Made": "源码自制",
"Source Code Tool-Made": "源代码工具制作",
"Source File List": "源文件列表",
"Source file": "源文件",
"Source file (Self-made)": "源文件(自制)",
"Source file information not found in CLI": "CLI 中未找到源文件信息",
"Source file information not found in ISR": "ISR 中未找到源文件信息",
"Special risk Open Source Software": "特殊风险开源软件",
"Special risks 3rd party software": "特殊风险 第三方软件",
"Specific": "具体的",
Expand Down
5 changes: 4 additions & 1 deletion messages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@
"Download License Archive": "下載授權檔案",
"Drop a File Here": "在這裡丟下檔案",
"Duplicate": "复制",
"Dynamically linked": "動態連結",
"Duplicated Releases": "重複發布",
"Dynamically linked": "動態連結",
"E-Mail Notification Preferences": "",
"ECC": "ECC",
"ECC Assessment Date": "ECC 评估日期",
Expand Down Expand Up @@ -583,6 +583,7 @@
"License Fullname": "駕照全名",
"License Info": "許可證資訊",
"License Info Header": "執照資訊信頭",
"License Name": "許可證名稱",
"License Obligation": "許可義務",
"License Scan Report Result": "憑證掃描報告結果",
"License Shortname": "牌照短名",
Expand Down Expand Up @@ -972,9 +973,11 @@
"Source Code Original from Community": "原始碼來自社區",
"Source Code Self-Made": "源碼自動程式",
"Source Code Tool-Made": "來源碼工具- Made",
"Source File List": "來源檔案列表",
"Source file": "來源檔案",
"Source file (Self-made)": "來源檔案( 自制)",
"Source file information not found in CLI": "CLI 中未找到來源文件信息",
"Source file information not found in ISR": "ISR 中未找到來源文件信息",
"Special risk Open Source Software": "特殊風險開源軟體",
"Special risks 3rd party software": "特殊風險 第三方軟體",
"Specific": "具體的",
Expand Down
2 changes: 1 addition & 1 deletion nextauth.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface SW360User extends DefaultUser {
declare module 'next-auth' {
type User = SW360User
interface Session {
user?: User
user: User
}
}

Expand Down
14 changes: 8 additions & 6 deletions src/app/[locale]/components/add/components/AddComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { signOut, useSession } from 'next-auth/react'
import { useTranslations } from 'next-intl'
import { useRouter } from 'next/navigation'
import { useState } from 'react'
import { ReactNode, useState } from 'react'

import GeneralInfoComponent from '@/components/GeneralInfoComponent/GeneralInfoComponent'
import RolesInformation from '@/components/RolesInformation/RolesInformation'
Expand All @@ -27,11 +27,11 @@ import {
Vendor,
} from '@/object-types'

import { ApiUtils } from '@/utils'
import { ApiUtils, CommonUtils } from '@/utils'
import { AddAdditionalRoles, AddKeyValue, SearchUsersModal, SideBar } from 'next-sw360'
import MessageService from '@/services/message.service'

export default function AddComponent() {
export default function AddComponent() : ReactNode {
const t = useTranslations('default')
const router = useRouter()
const { data: session, status } = useSession()
Expand All @@ -55,7 +55,7 @@ export default function AddComponent() {
moderators: null,
modifiedBy: '',
modifiedOn: '',
componentOwner: undefined,
componentOwner: null,
ownerAccountingUnit: '',
ownerGroup: '',
ownerCountry: '',
Expand Down Expand Up @@ -98,9 +98,11 @@ export default function AddComponent() {
}

const submit = async () => {
if (CommonUtils.isNullOrUndefined(session))
return signOut()
const response = await ApiUtils.POST('components', componentPayload, session.user.access_token)

if (response.status == HttpStatus.CREATED) {
if (response.status === HttpStatus.CREATED) {
const data = (await response.json()) as Component
router.push('/components/edit/' + data.id)
MessageService.success(t('Component is created'))
Expand All @@ -110,7 +112,7 @@ export default function AddComponent() {
}

if (status === 'unauthenticated') {
signOut()
return signOut()
} else {
return (
<>
Expand Down
3 changes: 2 additions & 1 deletion src/app/[locale]/components/add/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

import { Metadata } from 'next'
import AddComponent from './components/AddComponent'
import { ReactNode } from 'react'

export const metadata: Metadata = {
title: 'Components',
}

export default async function ComponentAddPage() {
export default function ComponentAddPage() : ReactNode {
return <AddComponent />
}
Loading

0 comments on commit 32316bb

Please sign in to comment.