diff --git a/.travis.yml b/.travis.yml index ef047fe6..b1885829 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,15 @@ language: python matrix: include: - - os: linux - python: 3.5 - env: TOXENV=py35 - os: linux python: 3.6 env: TOXENV=py36 - os: linux python: 3.7 env: TOXENV=py37 + - os: linux + python: 3.8 + env: TOXENV=py38 before_install: | if [ "$TRAVIS_OS_NAME" == "osx" ]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cd820dd..9ab91809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## v2.0.3 (2020/11/27) + +Patch Update + +- Fixed missing download paths of papers after publishing on Qresp +- Fixed social preview link image display +- Other minor styling and stability improvements & bugfixes +- Dropped support for Python 3.5, only 3.6 and above supported now ## v2.0.2 (2020/11/16) Patch Update diff --git a/backend/requirements.txt b/backend/requirements.txt index fa748676..9ca888d1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,5 +1,5 @@ setuptools -jsonschema==2.6.0 +jsonschema Flask Flask-API Flask-Cors @@ -10,7 +10,7 @@ Flask-Session Flask-WTF itsdangerous Jinja2 -mongoengine==0.19.0 +mongoengine paramiko pre-commit py3dns @@ -21,7 +21,7 @@ swagger-spec-validator swaggerpy urllib3 validate-email -Werkzeug==0.16.0 +Werkzeug WTForms schedule flask-sitemap diff --git a/backend/setup.py b/backend/setup.py index 5ee738db..bca712b0 100644 --- a/backend/setup.py +++ b/backend/setup.py @@ -2,8 +2,8 @@ setup( name='qresp', - version='2.0.2', - url='http://qresp.org/', + version='2.0.3', + url='https://qresp.org/', entry_points = { 'console_scripts': ['qresp=project.__main__:main'], }, @@ -11,7 +11,7 @@ author='Sushant Bansal, Aditya Tanikanti, Marco Govoni', author_email='datadev@lists.uchicago.edu', description='Qresp "Curation and Exploration of Reproducible Scientific Papers" is a Python application that facilitates the organization, annotation and exploration of data presented in scientific papers. ', - python_requires='>=3.5', + python_requires='>=3.6', packages=find_packages(), install_requires=[ 'flask_api', @@ -23,12 +23,12 @@ 'flask-mongoengine', 'Flask-Session', 'Flask-WTF', - 'mongoengine==0.19.0', + 'mongoengine', 'cryptography', 'jinja2', - 'jsonschema==2.6.0', + 'jsonschema', 'pyOpenSSL', - 'werkzeug==0.16.0', + 'werkzeug', 'itsdangerous', 'python-dateutil', 'expiringdict', diff --git a/frontend/Context/Curator/CuratorState.js b/frontend/Context/Curator/CuratorState.js index 63175181..e81e7893 100644 --- a/frontend/Context/Curator/CuratorState.js +++ b/frontend/Context/Curator/CuratorState.js @@ -5,7 +5,7 @@ import CuratorContext from "./curatorContext"; import WebStore from "../../Utils/Persist"; import { - SET_ALL, + SET_CURATOR_STATE, SET_CURATORINFO, SET_FILESERVERPATH, SET_PAPERINFO, @@ -83,9 +83,10 @@ const CuratorState = (props) => { ]); }, [state.charts, state.scripts, state.datasets, state.tools, state.heads]); - const setAll = (data) => dispatch({ type: SET_ALL, payload: data }); + const setAll = (data) => dispatch({ type: SET_CURATOR_STATE, payload: data }); - const resetAll = () => dispatch({ type: SET_ALL, payload: initialState }); + const resetAll = () => + dispatch({ type: SET_CURATOR_STATE, payload: initialState }); const setCuratorInfo = (info) => dispatch({ type: SET_CURATORINFO, payload: info }); diff --git a/frontend/Context/Curator/curatorReducer.js b/frontend/Context/Curator/curatorReducer.js index cbfe9820..11d3a6fc 100644 --- a/frontend/Context/Curator/curatorReducer.js +++ b/frontend/Context/Curator/curatorReducer.js @@ -1,6 +1,6 @@ import { + SET_CURATOR_STATE, SET_CURATORINFO, - SET_ALL, SET_FILESERVERPATH, SET_PAPERINFO, SET_REFERENCE_AUTHORS, @@ -24,7 +24,7 @@ export default (state, action) => { ...state, curatorInfo: action.payload, }; - case SET_ALL: + case SET_CURATOR_STATE: return action.payload; case SET_FILESERVERPATH: return { ...state, fileServerPath: action.payload }; diff --git a/frontend/Context/Servers/ServerState.js b/frontend/Context/Servers/ServerState.js index ea8e3c5b..793acd91 100644 --- a/frontend/Context/Servers/ServerState.js +++ b/frontend/Context/Servers/ServerState.js @@ -5,7 +5,9 @@ import serverReducer from "./serverReducer"; import servers from "../../data/qresp_servers"; import httpServers from "../../data/http_servers"; -import { SET_SELECTED, SET_SELECTED_HTTP } from "../types"; +import { SET_SELECTED, SET_SELECTED_HTTP, SET_SERVER_STATE } from "../types"; + +import WebStore from "../../Utils/Persist"; const ServerState = (props) => { const initialState = { @@ -17,6 +19,20 @@ const ServerState = (props) => { const [state, dispatch] = useReducer(serverReducer, initialState); + useEffect(() => { + const data = WebStore.get("srvr"); + if (data !== null) { + setServerState(data); + } + }, []); + + useEffect(() => { + WebStore.set("srvr", state); + }, [state]); + + const setServerState = (state) => + dispatch({ type: SET_SERVER_STATE, payload: state }); + const setSelected = (selected) => { dispatch({ type: SET_SELECTED, payload: selected }); }; diff --git a/frontend/Context/Servers/serverReducer.js b/frontend/Context/Servers/serverReducer.js index bdf36d2f..fc6cd2e1 100644 --- a/frontend/Context/Servers/serverReducer.js +++ b/frontend/Context/Servers/serverReducer.js @@ -1,7 +1,9 @@ -import { SET_SELECTED, SET_SELECTED_HTTP } from "../types"; +import { SET_SELECTED, SET_SELECTED_HTTP, SET_SERVER_STATE } from "../types"; export default (state, action) => { switch (action.type) { + case SET_SERVER_STATE: + return action.payload; case SET_SELECTED: return { ...state, selected: action.payload }; case SET_SELECTED_HTTP: diff --git a/frontend/Context/types.js b/frontend/Context/types.js index 99a189ed..ed545793 100644 --- a/frontend/Context/types.js +++ b/frontend/Context/types.js @@ -11,6 +11,7 @@ export const SHOW_LOADER = "SHOW_LOADER"; export const HIDE_LOADER = "HIDE_LOADER"; // Server Actions +export const SET_SERVER_STATE = "SET_SERVER_STATE"; export const SET_SELECTED = "SET_SELECTED"; export const SET_SELECTED_HTTP = "SET_SELECTED_HTTP"; @@ -25,7 +26,7 @@ export const SET_CHILDREN = "SET_CHILDREN"; export const SET_TITLE = "SET_TITLE"; // Curator Actions -export const SET_ALL = "SET_ALL"; +export const SET_CURATOR_STATE = "SET_CURATOR_STATE"; export const SET_CURATORINFO = "SET_CURATORINFO"; export const SET_FILESERVERPATH = "SET_FILESERVERPATH"; export const SET_PAPERINFO = "SET_PAPERINFO"; diff --git a/frontend/components/CuratorForms/ReferenceInfoForm.js b/frontend/components/CuratorForms/ReferenceInfoForm.js index 5b291ed0..342d48ac 100644 --- a/frontend/components/CuratorForms/ReferenceInfoForm.js +++ b/frontend/components/CuratorForms/ReferenceInfoForm.js @@ -50,6 +50,7 @@ const ReferenceInfoForm = ({ editor }) => { .required("Required"), year: Yup.number() .min(1750, "Cannot be less than 1700") + .integer("Plese enter a valid year") .required("Required"), url: Yup.string().url("Please enter a valid url"), }); @@ -351,11 +352,10 @@ const ReferenceInfoForm = ({ editor }) => { placeholder="Enter url" name="url" helperText="Enter paper url" - label="URLs" + label="URL" inputRef={register} error={errors.url} defaultValue={referenceInfo.url} - required /> diff --git a/frontend/components/seo.js b/frontend/components/seo.js index 8f3bd86b..3cce3d0c 100644 --- a/frontend/components/seo.js +++ b/frontend/components/seo.js @@ -8,10 +8,7 @@ const SEO = (props) => { {title} - + {author ? ( diff --git a/frontend/package.json b/frontend/package.json index ce2d846c..8009085c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "qresp", - "version": "2.0.2", + "version": "2.0.3", "private": true, "scripts": { "dev": "next dev", diff --git a/frontend/pages/search.js b/frontend/pages/search.js index bef4e62d..7c511497 100644 --- a/frontend/pages/search.js +++ b/frontend/pages/search.js @@ -6,7 +6,7 @@ import { Container, Typography, Box, Divider } from "@material-ui/core"; import SEO from "../components/seo"; -import { SmallStyledButton } from "../components/button"; +import { RegularStyledButton } from "../components/button"; import RecordTable from "../components/Table/Table"; import AdvancedSearch from "../components/AdvancedSearch"; import Summary from "../components/Paper/Summary"; @@ -96,7 +96,7 @@ const search = ({ initialdata, error, selectedservers }) => { setAlert( "Search Error !", error.msg, - Retry + Retry ); } }, []); @@ -145,9 +145,10 @@ export async function getServerSideProps(ctx) { }; if (!query.servers || query.servers.length == 0) { + error.is = true; error["msg"] = "No servers selected to be searched"; return { - props: { initialdata: data, error: true, servers: query.servers }, + props: { initialdata: data, error: error, servers: null }, }; } diff --git a/frontend/public/images/QrespLogoColor.png b/frontend/public/images/QrespLogoColor.png new file mode 100644 index 00000000..e07d8af9 Binary files /dev/null and b/frontend/public/images/QrespLogoColor.png differ