diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1cb91f4774f0690e32f14a3f54c23f9ea3ba8ea..323a668fce5ff9daa5adfb5911cc24c7ead9660c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - prettier - test - deploy + - packaging cache: paths: - ~/.cache @@ -75,3 +76,22 @@ deploy_staging: - vercel pull --yes --environment=production --token=$VERCEL_TOKEN - vercel build --prod --token=$VERCEL_TOKEN - vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN + +build:deb: + image: node:16.16.0 + stage: packaging + only: + - tags + - development + before_script: + - apt-get update + - DEBIAN_FRONTEND=noninteractive apt-get install -y dh-make build-essential lintian devscripts xsltproc fakeroot xsltproc docbook-xsl curl gnupg git zip + artifacts: + # you cannot enforce never here yet + expire_in: 1000 yrs + paths: + - 'debian/*.deb' + script: + - export DEBFULLNAME="Piotr Gawron" + - export DEBEMAIL="piotr.gawron@uni.lu" + - debian/create-debian-pkg.sh diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000000000000000000000000000000000000..d88a916bee84dfa62f970d2f3d4fe15dbf262af2 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,7 @@ +minerva-front (18.0.0~beta.2) stable; urgency=medium + * Feature: minerva frontend - first version + * Bugfix: when opening overlay provide loading info (#285) + * Bugfix: problem with reporting errors in minervanet (#284) + * Bugfix: license info styling (#284) + + -- Piotr Gawron <piotr.gawron@uni.lu> Thu, 19 Sep 2024 13:00:00 +0200 diff --git a/debian/create-debian-pkg.sh b/debian/create-debian-pkg.sh new file mode 100755 index 0000000000000000000000000000000000000000..7c9002ec983eaea75cbd62ed8aeadc7ba40bd138 --- /dev/null +++ b/debian/create-debian-pkg.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -e + +#Where source file of the debian package should be placed +SRC_DIR=debian/src + +ROOT_DIR=`pwd` + +#clean build directories +rm -rf $SRC_DIR debian/minerva-front* + +#recreate directory +mkdir $SRC_DIR + +export APP_PREFIX=/minerva +npm install +npm run build +cp -r out $SRC_DIR/front + +cd $SRC_DIR +zip -r front.zip front +rm -r front +cd $ROOT_DIR + +#copy changelog file +cp CHANGELOG $ROOT_DIR/debian/template/changelog + +current_version=`cat CHANGELOG |grep minerva-front |head -1 | cut -f2 -d'(' | cut -f1 -d')'` + +echo "Current version: " $current_version + +#dh_make requires directory name to be like <package>-<version> +# this points to the directory +DEBIAN_DIR=debian/minerva-front-$current_version/ + +mkdir $DEBIAN_DIR + +# copy all source files to this directory +cp $SRC_DIR/* $DEBIAN_DIR + +#because dh_make works only from within directory where +#package data will be generated we need to change it +cd $DEBIAN_DIR +#this should be improved (to include src properly) +dh_make -s --createorig -e piotr.gawron@uni.lu -y -t $ROOT_DIR/debian/template + +echo "1.0" > debian/source/format + +#remove example files generated by dh_make +find -name '*.ex' ! -name 'minerva-front*' -type f -exec rm -f {} + + +#set proper architecture +arch=`dpkg --print-architecture` +echo "Architecture: $arch" >>debian/control + +#remove some sample file +rm debian/*.ex debian/*.EX debian/README.Debian debian/README.source debian/minerva-front-docs.docs + +#build debian package +debuild -us -uc --lintian-opts --suppress-tags bad-distribution-in-changes-file + +#run separately to fail on errors (does not work on old debian) +#lintian --suppress-tags bad-distribution-in-changes-file --no-tag-display-limit + +# remove temporary changelog +rm $ROOT_DIR/debian/template/changelog diff --git a/debian/template/compat b/debian/template/compat new file mode 100644 index 0000000000000000000000000000000000000000..f599e28b8ab0d8c9c57a486c89c4a5132dcbd3b2 --- /dev/null +++ b/debian/template/compat @@ -0,0 +1 @@ +10 diff --git a/debian/template/control b/debian/template/control new file mode 100644 index 0000000000000000000000000000000000000000..61e03b269321070dd9a0c8489b8a26cd3fb8772e --- /dev/null +++ b/debian/template/control @@ -0,0 +1,17 @@ +Source: minerva-front +Section: science +Priority: optional +Maintainer: Piotr Gawron <piotr.gawron@uni.lu> +Standards-Version: 3.9.7 +Vcs-Browser: https://gitlab.lcsb.uni.lu/minerva/frontend +Build-Depends: debhelper (>=10) + +Package: minerva-front +Priority: optional +Description: Frontend for standalone web application for visualization, + exploration and management of molecular networks encoded in SBGN-compliant + format. After installation, the resource is used and managed via a web browser, + under the default address 'http://localhost:8080/minerva/'. Full documentation + can be found here: https://minerva.pages.uni.lu/doc/ +Homepage: https://minerva.pages.uni.lu/ +Depends: ${misc:Depends} diff --git a/debian/template/copyright b/debian/template/copyright new file mode 100644 index 0000000000000000000000000000000000000000..6291b335bb553fb2c0f4dcc571b0f4d99702f69d --- /dev/null +++ b/debian/template/copyright @@ -0,0 +1,29 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: minerva-front +Source: https://minerva.pages.uni.lu/doc/ + +Files: front.zip +Copyright: 2024 Piotr Gawron <piotr.gawron@uni.lu> +License: AGPL-3.0 +Comment: Manual for the package. + +Files: debian/* +Copyright: 2024 Piotr Gawron <piotr.gawron@uni.lu> +License: AGPL-3.0 + +License: AGPL-3.0 + Copyright (C) 2024 Piotr Gawron + . + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + . diff --git a/debian/template/install b/debian/template/install new file mode 100644 index 0000000000000000000000000000000000000000..965f82bbf5beb4a680c6467ce685f5ec7dec0f59 --- /dev/null +++ b/debian/template/install @@ -0,0 +1 @@ +front.zip /usr/share/minerva/ diff --git a/debian/template/rules b/debian/template/rules new file mode 100755 index 0000000000000000000000000000000000000000..2d33f6ac8992b7da84b39a5bca0742c4962d3349 --- /dev/null +++ b/debian/template/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx b/src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx index bfc5c1bb1d40793ea528fb920f882e3a2976f2dc..175d2fa0be40b7c54a4e428f84c1d36230109310 100644 --- a/src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx +++ b/src/components/FunctionalArea/Modal/ErrorReportModal/ErroReportModal.component.tsx @@ -28,7 +28,6 @@ export const ErrorReportModal: React.FC = () => { const javaStacktrace = getValue(errorData?.javaStacktrace); const stacktrace = getValue(errorData?.stacktrace); const version = getValue(errorData?.version); - const message = getValue(errorData?.message); const timestamp = errorData ? errorData.timestamp : Math.floor(+new Date() / ONE_THOUSAND); // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -42,7 +41,6 @@ export const ErrorReportModal: React.FC = () => { stacktrace, version, timestamp, - message, }); const handleChange = (e: React.ChangeEvent<HTMLInputElement>): void => { @@ -77,7 +75,6 @@ export const ErrorReportModal: React.FC = () => { return ( <div className="w-[800px] border border-t-[#E1E0E6] bg-white"> <form onSubmit={handleSubmit} className="p-4"> - <p className="my-4 font-bold"> {errorDataToSend.message}</p> <p className="my-4"> If you agree to submit the following information to the minerva maintainers please uncheck all boxes that might contain sensitive data. diff --git a/src/components/Map/Drawer/ProjectInfoDrawer/ProjectInfoDrawer.component.tsx b/src/components/Map/Drawer/ProjectInfoDrawer/ProjectInfoDrawer.component.tsx index 9bf8267cdfde579330b19eb9cb221e79b0c2ad30..3d92366ef43188b3c75df84ac204b9e55a592137 100644 --- a/src/components/Map/Drawer/ProjectInfoDrawer/ProjectInfoDrawer.component.tsx +++ b/src/components/Map/Drawer/ProjectInfoDrawer/ProjectInfoDrawer.component.tsx @@ -90,8 +90,14 @@ export const ProjectInfoDrawer = (): JSX.Element => { )} {licenseExists && ( <li className="mt-2 text-hyperlink-blue"> - <button type="button" onClick={onLicenseClick} className="text-base font-semibold"> - License: {licenseName} + <span className="text-black">License: </span> + <button + type="button" + onClick={onLicenseClick} + className="truncate text-base font-semibold" + title={licenseName} + > + {licenseName} </button> </li> )} diff --git a/src/redux/overlayBioEntity/overlayBioEntity.selector.ts b/src/redux/overlayBioEntity/overlayBioEntity.selector.ts index 2b96a5389302e6acce4f654a67fb7ed4d23abe98..b1276a7c7ad2a55cfde6cec91eac22e85c47ad67 100644 --- a/src/redux/overlayBioEntity/overlayBioEntity.selector.ts +++ b/src/redux/overlayBioEntity/overlayBioEntity.selector.ts @@ -1,6 +1,7 @@ import { OverlayBioEntityRender } from '@/types/OLrendering'; import { createSelector } from '@reduxjs/toolkit'; import { allSubmapConnectionsBioEntitySelector } from '@/redux/bioEntity/bioEntity.selectors'; +import { mapModelIdSelector } from '@/redux/map/map.selectors'; import { currentSearchedBioEntityId } from '../drawer/drawer.selectors'; import { currentModelIdSelector } from '../models/models.selectors'; import { @@ -86,9 +87,18 @@ export const isOverlayActiveSelector = createSelector( ); export const isOverlayLoadingSelector = createSelector( - [overlayBioEntitySelector, (_, overlayId: number): number => overlayId], - ({ overlaysId, data }, overlayId) => - overlaysId.includes(overlayId) && data[overlayId] && !Object.keys(data[overlayId]).length, + [overlayBioEntitySelector, mapModelIdSelector, (_, overlayId: number): number => overlayId], + ({ overlaysId, data }, mapId, overlayId) => { + let result = false; + if (overlaysId.includes(overlayId)) { + if (data[overlayId] && !Object.keys(data[overlayId]).length) { + result = true; + } else if (data[overlayId] && !data[overlayId][mapId]) { + result = true; + } + } + return result; + }, ); export const activeOverlaysSelector = createSelector( diff --git a/src/utils/error-report/ErrorData.ts b/src/utils/error-report/ErrorData.ts index 3d807d9e0f944503ed56c92e0cdd7459d1c77fa2..64ef0f630a0b951f1698ae209f2a642b899d293a 100644 --- a/src/utils/error-report/ErrorData.ts +++ b/src/utils/error-report/ErrorData.ts @@ -6,7 +6,6 @@ export type ErrorData = { timestamp: number | null; version: string | null; comment: string | null; - message: string; stacktrace: string; javaStacktrace: string | null; }; diff --git a/src/utils/error-report/errorReporting.ts b/src/utils/error-report/errorReporting.ts index 4bc652535e50df366fad0a6f6cda6afe1f618a02..de45816c55114d02af68affe11a9ca74b48d20a3 100644 --- a/src/utils/error-report/errorReporting.ts +++ b/src/utils/error-report/errorReporting.ts @@ -16,11 +16,9 @@ export const createErrorData = async ( error: Error | SerializedError | undefined, state: RootState, ): Promise<ErrorData> => { - let stacktrace = ''; - let message = ''; + let stacktrace = 'N/A'; if (error !== undefined) { - stacktrace = error.stack !== undefined ? error.stack : ''; - message = error.message !== undefined ? error.message : ''; + stacktrace = error.stack !== undefined ? error.stack : 'N/A'; } let login = null; @@ -72,6 +70,5 @@ export const createErrorData = async ( stacktrace, timestamp: Math.floor(+new Date() / ONE_THOUSAND), version, - message, }; };