Skip to content
Snippets Groups Projects
Commit 106b19d6 authored by Mihail Gorceag's avatar Mihail Gorceag
Browse files

fix: change coko to aperture

parent e8af0cec
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,12 @@ build:
- docker:20.10.5-dind
stage: build
before_script:
- cp app/brand-instances-configs/coko.json app/brandConfig.json
- cp app/brand-instances-configs/aperture.json app/brandConfig.json
script:
- |
if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then echo "Not pushing" && exit 0; fi
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker build --build-arg instance_name=coko --file ./Dockerfile-ci --cache-from $IMAGE_ORG/$IMAGE_NAME:latest --tag $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA --tag $IMAGE_ORG/$IMAGE_NAME:latest .
docker build --build-arg instance_name=aperture --file ./Dockerfile-ci --cache-from $IMAGE_ORG/$IMAGE_NAME:latest --tag $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA --tag $IMAGE_ORG/$IMAGE_NAME:latest .
docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
docker push $IMAGE_ORG/$IMAGE_NAME:latest
......
......@@ -21,9 +21,9 @@ ncrc-pipeline:
- local: .gitlab-ci.ncrc.yml
strategy: depend
coko-pipeline:
aperture-pipeline:
stage: run-pipeline
trigger:
include:
- local: .gitlab-ci.coko.yml
- local: .gitlab-ci.aperture.yml
strategy: depend
{
"logoPath": "/public/logo-kotahi.png",
"primaryColor": "red",
"secondaryColor": "blue",
"brandName": "Coko"
}
......@@ -138,7 +138,7 @@ const AdminPage = () => {
: null
}
if (currentUser && process.env.INSTANCE_NAME === 'coko') {
if (currentUser && process.env.INSTANCE_NAME === 'aperture') {
links.push({ link: homeLink, name: 'Dashboard', icon: 'home' })
}
......@@ -234,14 +234,14 @@ const AdminPage = () => {
path={`${urlFrag}/admin/manuscripts`}
redirectLink={redirectLink}
/>
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) &&
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) && (
<PrivateRoute
component={SubmitPage}
exact
path={`${urlFrag}/versions/:version/evaluation`}
redirectLink={redirectLink}
/>
}
)}
</Switch>
<RolesUpdater />
</Root>
......
......@@ -65,7 +65,7 @@ const User = ({ manuscriptId, manuscript, submitter }) => {
return (
<Row>
{process.env.INSTANCE_NAME === 'coko' && (
{process.env.INSTANCE_NAME === 'aperture' && (
<Cell>{manuscript.meta && manuscript.meta.title}</Cell>
)}
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) && (
......@@ -119,7 +119,7 @@ const User = ({ manuscriptId, manuscript, submitter }) => {
Evaluation
</Action>
)}
{process.env.INSTANCE_NAME === 'coko' && (
{process.env.INSTANCE_NAME === 'aperture' && (
<Action to={`${urlFrag}/versions/${manuscriptId}/decision`}>
Control
</Action>
......
......@@ -80,13 +80,10 @@ const GET_MANUSCRIPTS = gql`
const Manuscripts = ({ history, ...props }) => {
const SortHeader = ({ thisSortName, children }) => {
if(!thisSortName) {
return (
<th>
{children}
</th>
)
if (!thisSortName) {
return <th>{children}</th>
}
const changeSort = () => {
if (sortName !== thisSortName) {
setSortName(thisSortName)
......@@ -135,11 +132,11 @@ const Manuscripts = ({ history, ...props }) => {
if (loading) return <Spinner />
if (error) return `Error! ${error.message}`
const manuscripts = data.paginatedManuscripts.manuscripts.map(el => {
return { ...el, submission: JSON.parse(el.submission) }
})
const { totalCount } = data.paginatedManuscripts
return (
......@@ -156,27 +153,31 @@ const Manuscripts = ({ history, ...props }) => {
</HeadingWithAction>
)}
{process.env.INSTANCE_NAME === 'coko' && <Heading>Manuscripts</Heading>}
{process.env.INSTANCE_NAME === 'aperture' && (
<Heading>Manuscripts</Heading>
)}
<Content>
<Table>
<Header>
<tr>
{process.env.INSTANCE_NAME === 'coko' && (
{process.env.INSTANCE_NAME === 'aperture' && (
<SortHeader thisSortName="meta:title">Title</SortHeader>
)}
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) && (
<SortHeader thisSortName="submission:articleId">Article Id</SortHeader>
<SortHeader thisSortName="submission:articleId">
Article Id
</SortHeader>
)}
<SortHeader thisSortName="created">Created</SortHeader>
<SortHeader thisSortName="updated">Updated</SortHeader>
{process.env.INSTANCE_NAME === 'ncrc' &&
{process.env.INSTANCE_NAME === 'ncrc' && (
<SortHeader>Topic</SortHeader>
}
)}
<SortHeader thisSortName="status">Status</SortHeader>
{process.env.INSTANCE_NAME === 'ncrc' &&
{process.env.INSTANCE_NAME === 'ncrc' && (
<SortHeader thisSortName="submission:labels">Label</SortHeader>
}
)}
<SortHeader thisSortName="submitterId">Author</SortHeader>
<th />
</tr>
......
......@@ -159,7 +159,11 @@ const FormTemplate = ({
// If there are errors, do a fake submit
// to focus on the error
if (hasErrors || values.status === articleStatuses.evaluated || values.status === articleStatuses.submitted) {
if (
hasErrors ||
values.status === articleStatuses.evaluated ||
values.status === articleStatuses.submitted
) {
handleSubmit()
} else {
toggleConfirming()
......@@ -274,7 +278,7 @@ const FormTemplate = ({
</Section>
) : null}
{process.env.INSTANCE_NAME === 'coko' &&
{process.env.INSTANCE_NAME === 'aperture' && (
<>
{!['submitted', 'revise'].includes(values.status) &&
form.haspopup === 'false' && (
......@@ -287,22 +291,27 @@ const FormTemplate = ({
form.haspopup === 'true' &&
submitButton('Submit your research object')}
</>
}
)}
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) &&
{['elife', 'ncrc'].includes(process.env.INSTANCE_NAME) && (
<>
{!['revise'].includes(values.status) &&
form.haspopup === 'false' && (
<Button onClick={() => handleSubmit()} primary type="submit">
{match.url.includes('/evaluation') ? 'Submit Evaluation' : 'Submit your research object'}
</Button>
)}
{!['revise'].includes(values.status) && form.haspopup === 'false' && (
<Button onClick={() => handleSubmit()} primary type="submit">
{match.url.includes('/evaluation')
? 'Submit Evaluation'
: 'Submit your research object'}
</Button>
)}
{!['revise'].includes(values.status) &&
form.haspopup === 'true' &&
submitButton(match.url.includes('/evaluation') ? 'Submit Evaluation' : 'Submit your research object')}
submitButton(
match.url.includes('/evaluation')
? 'Submit Evaluation'
: 'Submit your research object',
)}
</>
}
)}
{values.status === 'revise' && submitButton('Submit your revision')}
......
......@@ -217,7 +217,9 @@ const SubmitPage = ({ match, history }) => {
}
const onSubmit = async versionId => {
const delta = { status: match.url.includes('/evaluation') ? 'evaluated' : 'submitted' }
const delta = {
status: match.url.includes('/evaluation') ? 'evaluated' : 'submitted',
}
await submit({
variables: {
......@@ -226,11 +228,11 @@ const SubmitPage = ({ match, history }) => {
},
})
if(process.env.INSTANCE_NAME === 'coko') {
if (process.env.INSTANCE_NAME === 'aperture') {
history.push(`${urlFrag}/dashboard`)
}
if(['elife', 'ncrc'].includes(process.env.INSTANCE_NAME)) {
if (['elife', 'ncrc'].includes(process.env.INSTANCE_NAME)) {
history.push(`${urlFrag}/admin/manuscripts`)
}
}
......@@ -242,12 +244,12 @@ const SubmitPage = ({ match, history }) => {
confirming={confirming}
createNewVersion={createNewVersion}
form={cloneDeep(form)}
match={match}
onChange={handleChange}
onSubmit={onSubmit}
parent={manuscript}
toggleConfirming={toggleConfirming}
versions={versions}
match={match}
/>
)
}
......
......@@ -45,7 +45,7 @@ module.exports = {
path: deferConfig(cfg => {
const formTemplatePath = {
elife: '../app/storage/forms',
coko: '../app/storage/forms-coko',
aperture: '../app/storage/forms-aperture',
ncrc: '../app/storage/forms-ncrc',
}
// eslint-disable-next-line
......
......@@ -102,7 +102,7 @@ module.exports = app => {
let redirectionURL
if (process.env.INSTANCE_NAME === 'coko') {
if (process.env.INSTANCE_NAME === 'aperture') {
redirectionURL = '/kotahi/dashboard'
if (req.user.firstLogin) {
......
......@@ -267,29 +267,37 @@ const resolvers = {
const requestBody = {
uri: manuscript.submission.articleURL,
text: manuscript.submission.evaluationContent,
tags: [
manuscript.submission.evalType
],
tags: [manuscript.submission.evalType],
// group: "q5X6RWJ6",
}
try {
const response = await axios.post('https://api.hypothes.is/api/annotations', requestBody, {
headers: {
'Authorization': 'Bearer 6879-C9eSHATI6gsjTD0GmZ9NIojOPDnntsdt76iE1AKlyzA'
}
})
const updatedManuscript = await ctx.models.Manuscript.query().updateAndFetchById(id, {
published: new Date(),
status: 'published',
})
const response = await axios.post(
'https://api.hypothes.is/api/annotations',
requestBody,
{
headers: {
Authorization:
'Bearer 6879-C9eSHATI6gsjTD0GmZ9NIojOPDnntsdt76iE1AKlyzA',
},
},
)
const updatedManuscript = await ctx.models.Manuscript.query().updateAndFetchById(
id,
{
published: new Date(),
status: 'published',
},
)
return updatedManuscript
} catch {
return
}
}
if (!manuscript.published && process.env.INSTANCE_NAME === 'coko') {
if (!manuscript.published && process.env.INSTANCE_NAME === 'aperture') {
manuscript = ctx.models.Manuscript.query().updateAndFetchById(id, {
published: new Date(),
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment