Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#416 bulk curation #420

Merged
merged 48 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5ef3dc6
feat(#416): Fix styling and page issues for admin portal
tholulomo Jun 29, 2023
561ae1d
feat(#416): Add a library to unzip files on the server
tholulomo Jun 29, 2023
8963a98
feat(#416): adding a middleware to calculate latency and add it to ba…
tholulomo Jun 29, 2023
ece8363
feat(#416): Adding bulk curation feature and updated swagger doc with…
tholulomo Jun 29, 2023
6810da2
feat(#416): Fix reusable search component import
tholulomo Jul 1, 2023
7141f83
Merge branch 'develop' of github.com:Duke-MatSci/materialsmine into #…
tholulomo Jul 1, 2023
621a2ab
feat(#416): Update deleteFile import at auth check
tholulomo Jul 1, 2023
906ad11
feat(#416): Add unit testing for bulk curation
tholulomo Jul 1, 2023
6871c20
feat(#416): Refactor file directory name to be served from env config
tholulomo Jul 5, 2023
eae4cac
Merge branch 'develop' of github.com:Duke-MatSci/materialsmine into #…
tholulomo Jul 5, 2023
901d94f
feat(#416): Add new mongo collection for storing temporary files
tholulomo Jul 11, 2023
98a7fd3
feat(#416): Remove latency logic and merge into middleware
tholulomo Jul 11, 2023
9f95874
feat(#416): Creating a whitelist of acceptable files
tholulomo Jul 11, 2023
246aab3
feat(#416): Update file validation logic and add files route to swagger
tholulomo Jul 11, 2023
55f9a13
feat(#416): Updating latency response middleware service
tholulomo Jul 11, 2023
6e63043
feat(#416): Updating bulk curation logic
tholulomo Jul 11, 2023
855bfd6
feat(#416): Properly define and set file response headers
tholulomo Jul 13, 2023
e77dba9
feat(#425): separate the XML view code, update unit test
aswallace Jul 14, 2023
4c545b7
fix lint errors
aswallace Jul 14, 2023
8bcfaab
feat(#416): Add coverage threshold to frontend app test
tholulomo Jul 18, 2023
6c7f9a7
feat(#416): Fix UI styling bugs, fix image loader gallery bug, fix im…
tholulomo Jul 18, 2023
4aa4124
feat(#416): Updating minio image and added required environment varia…
tholulomo Jul 18, 2023
dcc9da0
feat(#416): Exposing minio on proxy
tholulomo Jul 18, 2023
352a4dd
feat(#416): Adding default minio bucket name
tholulomo Jul 18, 2023
a7b663e
feat(#416): Installing minio package for restful service
tholulomo Jul 18, 2023
7a3a512
feat(#416): Adding minio connection utils
tholulomo Jul 18, 2023
01fdb26
feat(#416): Adding logic to parse nested files to filemanager utils l…
tholulomo Jul 18, 2023
c851901
feat(#416): Enabling minio s3 bucket storage
tholulomo Jul 18, 2023
0e48dcc
feat(#416): Update unit test for file and bulk curation changes
tholulomo Jul 18, 2023
fdd9d3f
feat(#416): Removing unused collection
tholulomo Jul 18, 2023
8486725
feat(#416): Update bulk curation to curate nested folders in root and…
tholulomo Jul 18, 2023
311d4cf
feat(#416): Update failing test and linter fixes
tholulomo Jul 18, 2023
5ef37f6
Merge branch '#416_Bulk_Curation' of https://github.com/Duke-MatSci/m…
aswallace Jul 18, 2023
4e100a8
feat(#425): add bulk upload ui and unit test
aswallace Jul 18, 2023
0ba5f51
feat(#425): use Vuex for bulk uploads and re-route to XML page for su…
aswallace Jul 21, 2023
c5fdaf9
Merge pull request #429 from Duke-MatSci/#425_bulk_curation_ui
tholulomo Jul 24, 2023
d5c4090
Merge branch 'develop' into #416_Bulk_Curation
tholulomo Jul 24, 2023
4181343
feat(#416): Reusing imageTotal on search page to render total number …
tholulomo Jul 24, 2023
ed1ddbb
Merge branch '#416_Bulk_Curation' of github.com:Duke-MatSci/materials…
tholulomo Jul 24, 2023
10a8ec1
feat(#416): Linting and text fixes
tholulomo Jul 24, 2023
fd0b70a
feat(#416): Merge upstream changes
tholulomo Jul 25, 2023
a21f999
feat(#416): Add bucket store link for admin user
tholulomo Jul 26, 2023
d8fae4f
feat(#416): Configure bucket storage proxy
tholulomo Jul 26, 2023
57b5765
feat(#416): Bucket store code fixes
tholulomo Jul 26, 2023
aaa0df3
feat(#416): Unit test fix
tholulomo Jul 26, 2023
50074c3
feat(#416): Unit test fix
tholulomo Jul 26, 2023
f272e3c
fix(#254): resolve SDD form errors and add basic unit tests
aswallace Jul 29, 2023
997bab9
Merge pull request #431 from Duke-MatSci/sdd_form_fixes
tholulomo Jul 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/src/assets/css/modules/_utility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
font-size: 3rem;
}
@include respond(phone){
top: -10px;
top: -10px !important;
font-size: 2.3rem;
}
&_subtitle {
Expand Down Expand Up @@ -477,6 +477,14 @@
background-color: rgba($primary-black, 0.7) !important;
border: 1px solid $primary !important;
}
&_icon_mobile {
&_lg {
@include respond(phone){
height: 72px;
font-size: 72px!important;
}
}
}
}

.dialog-box {
Expand Down
1 change: 1 addition & 0 deletions app/src/components/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
document.execCommand('italic')
},
applyHeading () {
if (document.queryCommandValue('formatBlock') === 'h1') { return document.execCommand('formatBlock', false, 'div') }
aswallace marked this conversation as resolved.
Show resolved Hide resolved
document.execCommand('formatBlock', false, '<h1>')
},
applyUl () {
Expand Down
8 changes: 1 addition & 7 deletions app/src/components/nanomine/PageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<router-link to="/nm/tools/simtools" class="nav_menu--siblings-lists"><a>Simulation Tools</a></router-link>
<router-link to="/nm/tools/chemprops" class="nav_menu--siblings-lists"><a>ChemProps</a></router-link>
<router-link to="/nm/tools/plot-curation" class="nav_menu--siblings-lists"><a>Easy CSV Plotter</a></router-link>
<router-link to="" @click.native="loadApiDocs" class="nav_menu--siblings-lists"><a>Api Docs</a></router-link>
<a href="/api/api-docs/" class="nav_menu--siblings-lists"><a>Api Docs</a></a>
</div>
</div>
</li>
Expand Down Expand Up @@ -122,12 +122,6 @@ export default {
isAuth: 'auth/isAuthenticated',
displayName: 'auth/displayName'
})
},
methods: {
loadApiDocs () {
const url = `${location.origin}/api/api-docs/`
return window.location.assign(url)
}
}
}
</script>
35 changes: 25 additions & 10 deletions app/src/pages/explorer/xml/XmlLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</md-drawer>

<md-content class="u_width--max md-app-side-drawer md-app-container md-scrollbar" >
<div>
<div :class="[isSmallTabView ? 'u_margin-top-med' : '']">
<h2 class="visualize_header-h1 u_margin-top-med u_centralize_text"> {{ optionalChaining(() => xmlViewer.title) }} </h2>
</div>
<!-- xml viewer -->
Expand All @@ -22,14 +22,23 @@
</div>

</md-content>
<md-button @click="approveCuration" v-if="isAuth && isAdmin" class="md-fab md-fixed md-dense md-fab-bottom-right md-primary btn--primary u--margin-rightlg">
<md-tooltip md-direction="top">Approve</md-tooltip>
<md-icon>check</md-icon>
</md-button>
<md-button @click="showSidepanel = true" class="md-fab md-fixed md-dense md-fab-bottom-right md-primary btn--primary">
<md-tooltip md-direction="top">Comment</md-tooltip>
<md-icon>comment</md-icon>
</md-button>
<div :class="[isSmallTabView ? 'u_margin-top-small u_adjust-banner-text' : 'u--margin-neg','md-fab md-fab-top-right u_width--max u--shadow-none u--layout-flex u--layout-flex-justify-end u--b-rad']">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally, for screens smaller than laptop the buttons cover the title

<md-button class="md-fab md-dense md-primary btn--primary" @click.native.prevent="navBack">
<md-tooltip> Go Back </md-tooltip>
<md-icon>arrow_back</md-icon>
</md-button>

<md-button @click="showSidepanel = true" class="md-fab md-dense md-primary btn--primary">
<md-tooltip md-direction="top">Comment</md-tooltip>
<md-icon>comment</md-icon>
</md-button>

<md-button @click="approveCuration" v-if="isAuth && isAdmin" class="md-fab md-dense md-primary btn--primary ">
<md-tooltip md-direction="top">Approve</md-tooltip>
<md-icon>check</md-icon>
</md-button>

</div>
</section>

<section class="section_loader u--margin-toplg" v-else-if="$apollo.loading">
Expand Down Expand Up @@ -69,14 +78,20 @@ export default {
...mapGetters({
isAuth: 'auth/isAuthenticated',
isAdmin: 'auth/isAdmin'
})
}),
isSmallTabView () {
return screen.width < 760
}
},
methods: {
approveCuration () {
this.$store.commit('setSnackbar', {
message: 'Something went wrong',
action: () => this.approveCuration()
})
},
navBack () {
this.$router.back()
}
},
mounted () {
Expand Down
7 changes: 3 additions & 4 deletions app/src/pages/portal/curation/ViewCuration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
<md-card-media-cover md-solid>
<div class="u_gridicon">
<div>
<md-tooltip md-direction="left">Last updated</md-tooltip>
<p class="u--color-primary u_margin-none u--padding-zero u_content__result"> {{ new Date().toLocaleDateString() }}</p>
<p class="u--color-primary u_margin-none u--padding-zero u_content__result"><strong>Last updated: </strong>{{ new Date().toLocaleDateString() }}</p>
</div>

</div>
Expand All @@ -37,12 +36,12 @@
<div class="viz-u-postion__rel u--layout-flex md-layout u_centralize_content u_width--max">
<template v-if="xml.samples > 8">
<div v-for="n in 8" :key="n" class="u_margin-top-small md-layout-item md-size-25 viz-u-postion__rel CodeMirror">
<md-icon class="u--color-primary media-icon-mod viz-u-postion__rel md-small-size-3x ">description</md-icon>
<md-icon class="u--color-primary media-icon-mod viz-u-postion__rel u_icon_mobile_lg ">description</md-icon>
</div>
</template>
<template v-else>
<div v-for="n in xml.samples" :key="n" class="u_margin-top-small md-layout-item md-size-25 viz-u-postion__rel CodeMirror">
<md-icon class="u--color-primary media-icon-mod viz-u-postion__rel md-small-size-3x">description</md-icon>
<md-icon class="u--color-primary media-icon-mod viz-u-postion__rel u_icon_mobile_lg">description</md-icon>
</div>
</template>
</div>
Expand Down
3 changes: 2 additions & 1 deletion resfulservice/config/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ module.exports = {
'CHARACTERIZATION METHODS': 'CHARACTERIZATION',
MICROSTRUCTURE: 'MICROSTRUCTURE'
},
ContactPagePurposeOpt: ['QUESTION', 'TICKET', 'SUGGESTION', 'COMMENT']
ContactPagePurposeOpt: ['QUESTION', 'TICKET', 'SUGGESTION', 'COMMENT'],
SupportedFileTypes: ['png', 'jpg', 'jpeg', 'tiff', 'tif', 'csv', 'zip', 'xls', 'xlsx']
};
1 change: 1 addition & 0 deletions resfulservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"axios": "^0.26.1",
"bcryptjs": "^2.4.3",
"csv-parser": "^3.0.0",
"decompress": "^4.2.1",
"express": "^4.17.1",
"express-validator": "^6.14.0",
"graphql": "^15.3.0",
Expand Down
12 changes: 2 additions & 10 deletions resfulservice/spec/controllers/adminController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const chai = require('chai');
const sinon = require('sinon');
const DatasetProperty = require('../../src/models/datasetProperty');
const { getDatasetProperties } = require('../../src/controllers/adminController');

const { next } = require('../mocks');
const { expect } = chai;

const mockDatasetProperties = [
Expand Down Expand Up @@ -53,9 +53,6 @@ describe('Admin Controllers Unit Tests:', function() {

context('getDatasetProperties', () => {
it('should return a 400 error if no search query params', async function() {
const next = function (fn) {
return fn;
};
sinon.stub(res, 'status').returnsThis();
sinon.stub(res, 'json').returnsThis();
const result = await getDatasetProperties(req, res, next);
Expand All @@ -66,9 +63,6 @@ describe('Admin Controllers Unit Tests:', function() {

it('should return a list of filtered dataset properties', async function() {
req.query = { search: 'Loss' }
const next = function (fn) {
return fn;
};
sinon.stub(res, 'status').returnsThis();
sinon.stub(res, 'json').returns({data: mockDatasetProperties});
sinon.stub(DatasetProperty, 'find').returns(fetchedDatasetProperties)
Expand All @@ -79,9 +73,7 @@ describe('Admin Controllers Unit Tests:', function() {

it.skip('should return a 500 server error', async function() {
req.query = { search: 'Loss' }
const next = function (fn) {
return fn;
};

sinon.stub(res, 'status').returnsThis();
sinon.stub(res, 'json').returns({message: 'Server Error'});
sinon.stub(DatasetProperty, 'find').throws('Error connecting to database');
Expand Down
Loading