diff --git a/messages/de.json b/messages/de.json index f53c0f6c..8e90afad 100644 --- a/messages/de.json +++ b/messages/de.json @@ -973,7 +973,7 @@ "Session has expired": "Sitzung ist abgelaufen", "Set Outdated": "Hergestellt", "Set To Outdated": "Auf den Wunschzettel", - "Set to default text": "Standardtext festlegen", + "Set to default text": "Auf Standardtext einstellen", "Short Name": "Kurzbezeichnung", "Short Status": "Kurzstatus", "Shortname": "", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "Überprüfung {number} Sicherheitslücken werden geändert", "There are internal server error": "Es liegen interne Serverfehler vor", "There are some errors while creating project": "Es gibt einige Fehler bei der Erstellung von Projekten", + "There are some errors while fetching default license info header": "Beim Abrufen des Standard-Lizenzinformationsheaders sind einige Fehler aufgetreten", "There are some errors while updating moderation request": "Beim Aktualisieren der Moderationsanfrage sind einige Fehler aufgetreten", "There are some errors while updating project": "Beim Aktualisieren des Projekts sind einige Fehler aufgetreten", "There are some problem to update your comments": "Es gibt ein Problem beim Aktualisieren Ihrer Kommentare!", diff --git a/messages/en.json b/messages/en.json index 53ee9763..1d43fee8 100644 --- a/messages/en.json +++ b/messages/en.json @@ -973,7 +973,7 @@ "Session has expired": "Session has expired", "Set Outdated": "Set Outdated", "Set To Outdated": "Set To Outdated", - "Set to default text": "Set to default text", + "Set to default text": "Set to Default Text", "Short Name": "Short Name", "Short Status": "Short Status", "Shortname": "Shortname", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "The verification of {number} vulnerabilities will be changed to", "There are internal server error": "There are internal server error", "There are some errors while creating project": "There are some errors while creating project", + "There are some errors while fetching default license info header": "There are some errors while fetching default license info header", "There are some errors while updating moderation request": "There are some errors while updating moderation request", "There are some errors while updating project": "There are some errors while updating project", "There are some problem to update your comments": "There are some problem to update your comments !", diff --git a/messages/es.json b/messages/es.json index 001fe8ea..6f9e6636 100644 --- a/messages/es.json +++ b/messages/es.json @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "La verificación de {número} vulnerabilidades se cambiarán", "There are internal server error": "Hay un error interno del servidor.", "There are some errors while creating project": "Hay algunos errores al crear proyecto", + "There are some errors while fetching default license info header": "Hay algunos errores al recuperar el encabezado de información de licencia predeterminado", "There are some errors while updating moderation request": "Hay algunos errores al actualizar la solicitud de moderación.", "There are some errors while updating project": "Hay algunos errores al actualizar el proyecto.", "There are some problem to update your comments": "¡Hay algún problema para actualizar tus comentarios!", diff --git a/messages/fr.json b/messages/fr.json index 037d6ffd..0bb4e13a 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "La vérification {numéro} les vulnérabilités seront changées en", "There are internal server error": "Il y a une erreur de serveur interne", "There are some errors while creating project": "Il y a quelques erreurs lors de la création du projet", + "There are some errors while fetching default license info header": "Il y a des erreurs lors de la récupération de l'en-tête des informations de licence par défaut", "There are some errors while updating moderation request": "Il y a des erreurs lors de la mise à jour de la demande de modération", "There are some errors while updating project": "Il y a des erreurs lors de la mise à jour du projet", "There are some problem to update your comments": "Il y a un problème pour mettre à jour vos commentaires !", diff --git a/messages/ja.json b/messages/ja.json index adcde863..acfeca8a 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -973,7 +973,7 @@ "Session has expired": "セッションの有効期限が切れました", "Set Outdated": "セット古い", "Set To Outdated": "古いものに設定", - "Set to default text": "デフォルトのテキストに設定する", + "Set to default text": "デフォルトのテキストに設定", "Short Name": "短縮名", "Short Status": "ショートステータス", "Shortname": "", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "{number} 件の脆弱性の検証を変更", "There are internal server error": "内部サーバーエラーが発生しています", "There are some errors while creating project": "プロジェクトの作成中にいくつかのエラーが発生しました", + "There are some errors while fetching default license info header": "デフォルトのライセンス情報ヘッダーを取得中にいくつかのエラーが発生しました", "There are some errors while updating moderation request": "モデレートリクエストの更新中にエラーが発生しました", "There are some errors while updating project": "プロジェクトの更新中にいくつかのエラーが発生しました", "There are some problem to update your comments": "コメントを更新するには問題があります。", diff --git a/messages/ko.json b/messages/ko.json index 8cb7ec6a..3afc64c7 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -973,7 +973,7 @@ "Session has expired": "세션이 만료되었습니다.", "Set Outdated": "설치하기", "Set To Outdated": "설치하기", - "Set to default text": "기본 텍스트 설정", + "Set to default text": "기본 텍스트로 설정", "Short Name": "이름 *", "Short Status": "단기 상태", "Shortname": "", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "인증현황 이름 * 취약점이 변경됩니다.", "There are internal server error": "내부서버 오류가 있습니다", "There are some errors while creating project": "프로젝트를 만드는 동안 몇 가지 오류가 있습니다.", + "There are some errors while fetching default license info header": "기본 라이선스 정보 헤더를 가져오는 중에 오류가 발생했습니다.", "There are some errors while updating moderation request": "검토 요청을 업데이트하는 중에 오류가 발생했습니다.", "There are some errors while updating project": "프로젝트를 업데이트하는 중 오류가 발생했습니다.", "There are some problem to update your comments": "귀하의 의견을 업데이트하는 데 문제가 있습니다!", diff --git a/messages/pt-BR.json b/messages/pt-BR.json index 9f6b15ff..41210931 100644 --- a/messages/pt-BR.json +++ b/messages/pt-BR.json @@ -973,7 +973,7 @@ "Session has expired": "A sessão expirou", "Set Outdated": "Definir desatualizado", "Set To Outdated": "Definir como desatualizado", - "Set to default text": "Restaurar Definições", + "Set to default text": "Definir como texto padrão", "Short Name": "Nome Curto", "Short Status": "Status curto", "Shortname": "", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "A verificação de {number} vulnerabilidades será alterada para", "There are internal server error": "Há erros internos do servidor", "There are some errors while creating project": "Ocorreram alguns erros ao criar o projeto", + "There are some errors while fetching default license info header": "Existem alguns erros ao buscar o cabeçalho de informações de licença padrão", "There are some errors while updating moderation request": "Ocorreram alguns erros ao atualizar a solicitação de moderação", "There are some errors while updating project": "Existem alguns erros ao atualizar o projeto", "There are some problem to update your comments": "Há algum problema para atualizar seus comentários!", diff --git a/messages/vi.json b/messages/vi.json index 7d58c442..e4c45b32 100644 --- a/messages/vi.json +++ b/messages/vi.json @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "Việc xác minh lỗ hổng {number} sẽ được thay đổi thành", "There are internal server error": "Có lỗi máy chủ nội bộ", "There are some errors while creating project": "Có một số lỗi khi tạo dự án", + "There are some errors while fetching default license info header": "Có một số lỗi khi tìm nạp tiêu đề thông tin giấy phép mặc định", "There are some errors while updating moderation request": "Có một số lỗi trong khi cập nhật yêu cầu kiểm duyệt", "There are some errors while updating project": "Có một số lỗi trong khi cập nhật dự án", "There are some problem to update your comments": "Có một số vấn đề khi cập nhật nhận xét của bạn!", diff --git a/messages/zh-CN.json b/messages/zh-CN.json index 12180aa0..1ae64d94 100644 --- a/messages/zh-CN.json +++ b/messages/zh-CN.json @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "{number} 个漏洞的验证将更改为", "There are internal server error": "服务器内部出现错误", "There are some errors while creating project": "创建项目时出现一些错误", + "There are some errors while fetching default license info header": "获取默认许可证信息标头时出现一些错误", "There are some errors while updating moderation request": "更新审核请求时出现一些错误", "There are some errors while updating project": "更新项目时出现一些错误", "There are some problem to update your comments": "更新评论有问题!", diff --git a/messages/zh-TW.json b/messages/zh-TW.json index 1ec6aff6..808ecdf7 100644 --- a/messages/zh-TW.json +++ b/messages/zh-TW.json @@ -973,7 +973,7 @@ "Session has expired": "會話已過期", "Set Outdated": "設定已过期", "Set To Outdated": "設定為已过期", - "Set to default text": "設定為預設文字", + "Set to default text": "設定為預設文本", "Short Name": "短名", "Short Status": "空頭狀態", "Shortname": "", @@ -1046,6 +1046,7 @@ "The verification of vulnerabilities will be changed to": "核查 {數字} 弱點將變為", "There are internal server error": "伺服器內部出現錯誤", "There are some errors while creating project": "建立專案時有一些錯誤", + "There are some errors while fetching default license info header": "取得預設許可證資訊標頭時出現一些錯誤", "There are some errors while updating moderation request": "更新審核請求時出現一些錯誤", "There are some errors while updating project": "更新項目時出現一些錯誤", "There are some problem to update your comments": "更新評論有問題!", diff --git a/src/components/ProjectAddSummary/component/Administration/LicenseInfoHeader.tsx b/src/components/ProjectAddSummary/component/Administration/LicenseInfoHeader.tsx index 3d8d3c87..33d2da76 100644 --- a/src/components/ProjectAddSummary/component/Administration/LicenseInfoHeader.tsx +++ b/src/components/ProjectAddSummary/component/Administration/LicenseInfoHeader.tsx @@ -11,13 +11,21 @@ import { useTranslations } from 'next-intl' -import { ProjectPayload } from '@/object-types' +import { HttpStatus, ProjectPayload } from '@/object-types' +import { getSession, signOut } from 'next-auth/react' +import CommonUtils from '@/utils/common.utils' +import { ApiUtils } from '@/utils/index' +import MessageService from '@/services/message.service' interface Props { projectPayload: ProjectPayload setProjectPayload: React.Dispatch> } +interface LicenseInfoHeader { + licenseInfoHeaderText: string +} + export default function LicenseInfoHeader({ projectPayload, setProjectPayload }: Props): JSX.Element { const t = useTranslations('default') const updateInputField = (event: React.ChangeEvent { + try { + const session = await getSession() + if(CommonUtils.isNullOrUndefined(session)) + return signOut() + const url = 'projects/licenseInfoHeader' + const response = await ApiUtils.GET(url, session.user.access_token) + if (response.status == HttpStatus.OK) { + const data = await response.json() as LicenseInfoHeader + setProjectPayload({ + ...projectPayload, + licenseInfoHeaderText: data.licenseInfoHeaderText + }) + } else { + MessageService.error(t('There are some errors while fetching default license info header')) + } + } catch(e) { + console.error(e) + } + } + return ( <>
{t('License Info Header')}
-