Skip to content

Commit

Permalink
Merge pull request #393 from Duke-MatSci/develop
Browse files Browse the repository at this point in the history
BREAKING CHANGES
  • Loading branch information
tholulomo authored May 18, 2023
2 parents 1f65fbe + e7a1e12 commit 9d7d0dd
Show file tree
Hide file tree
Showing 64 changed files with 11,312 additions and 53 deletions.
49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
MaterialsMine App

## :high_brightness: Installation
Make sure to install [docker](https://docs.docker.com/get-docker/) on your machine first, then `git clone` the repo and run `cmd` below to instantiate or terminate the application.
Make sure to install [docker](https://docs.docker.com/get-docker/) on your machine first, then `git clone` the repo and run commands below to instantiate or terminate the application.

Windows OS:
- Be sure to run the Docker installer as an administrator
Expand All @@ -15,32 +15,51 @@ Windows OS:
# :warning: ADVISORY :warning:
> Before running the steps below, follow the steps [here](https://github.com/Duke-MatSci/materialsmine/blob/develop/resfulservice/misc/README.md) to retrieve and deploy required environment variables
> *IMPORTANT NOTICE:* Install nvm. For windows PC click [windows](https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows#install-nvm-windows-nodejs-and-npm), for Mac `brew install nvm`
## :high_brightness: Testing
To avoid testing failure, install nvm & copy the command below and run in the project root directory.

```bash
npm i && cd app && npm i && cd ../resfulservice && npm i && cd ..
```

## :high_brightness: Starting All Application Services Options 1
Make sure nvm is installed with node >= v16.20.0 or run the command below to install the right node version:
```bash
nvm install 16
```
Run the following command from the root directory:
```bash
npm run dev:install
```
Run the following command to start the applications:
```bash
# Run the following command from the root directory:
# 1. Install npm @ root directory:
npm install
npm run dev:start
```

## :high_brightness: Starting All Application Services Options 2
Run the following command from the root directory:

# 2. Build all services
```bash
docker-compose build
```
Note: The build might stall at first try. If this occurs, repeat the previous step.

# Note:
# The build might stall at first try. If this occurs, repeat the previous step.

# To start all services after the first or initial build
To start all services after the first or initial build
```bash
docker-compose up
```

# To start all services after the first or initial build in detachable mode
If you prefer to start all services after the first or initial build in detachable mode
```bash
docker-compose up -d

# To shutdown/terminate all services
docker-compose down
```

## :high_brightness: Testing
To avoid testing failure, copy the command below and run in the project root directory
To shutdown/terminate all services & unmount volumes
```bash
npm i && cd app && npm i && cd ../resfulservice && npm i && cd ..
docker-compose down -v
```

## :high_brightness: Folder Structure
Expand Down
1 change: 1 addition & 0 deletions app/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.20.0
15 changes: 13 additions & 2 deletions app/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ module.exports = {
transform: {
'^.+\\.vue$': 'vue-jest',
'\\.(gif)$': '<rootDir>/tests/jest/__mocks__/fileMock.js',
'\\.(ttl|rq)': 'jest-raw-loader'
'\\.(ttl|rq)': 'jest-raw-loader',
'^.+\\.js$': 'babel-jest',
'.*\\.(vue)$': 'vue-jest'
},
snapshotSerializers: [
'<rootDir>/node_modules/jest-serializer-vue'
],
moduleNameMapper: {
d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
prismjs: '<rootDir>/node_modules/prismjs/prism.js',
'style-loader!(.*)': '<rootDir>/node_modules/style-loader'
},
setupFilesAfterEnv: ['<rootDir>/tests/jest/script/test-setup.js']
setupFilesAfterEnv: ['<rootDir>/tests/jest/script/test-setup.js'],
moduleFileExtensions: ['js', 'vue', 'json'],
globals: {
'vue-jest': {
templateCompiler: {
compiler: require('vue-template-babel-compiler')
}
}
}
}
61 changes: 61 additions & 0 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"jsonschema": "^1.4.0",
"jszip": "^3.7.1",
"n3": "^1.15.0",
"prismjs": "^1.29.0",
"rdf-literal": "^1.1.0",
"register-service-worker": "^1.7.1",
"smiles-drawer": "^1.2.0",
Expand Down Expand Up @@ -78,6 +79,7 @@
"sass-loader": "^8.0.2",
"sinon": "^12.0.1",
"style-loader": "^2.0.0",
"vue-template-babel-compiler": "^2.0.0",
"vue-template-compiler": "^2.7.14"
},
"gitHooks": {
Expand Down
24 changes: 23 additions & 1 deletion app/src/assets/css/modules/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@
position: relative !important;
&-title {
color: $secondary !important;
font-weight: 900;
:hover {
color:$primary !important;
}
Expand Down Expand Up @@ -651,4 +650,27 @@
.md-chip.md-theme-default .md-icon.md-icon-image svg{
fill: $primary;
}
}

.xmlLoader {
.md-app-side-drawer.md-app-container {
height: calc(100vh - 149px) !important;

@include respond(tab-port) {
height: calc(100vh - 139px) !important;
}
@include respond(phone) {
height: calc(100vh - 107px) !important;
}
}
.md-right {
z-index: 25;
}
.md-drawer {
width: 414px;
@include respond(phone) {
width: 100%;
max-width: 100%;
}
}
}
18 changes: 18 additions & 0 deletions app/src/assets/css/modules/_resetvuematerial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,21 @@
}
}

.md-card-media.md-ratio-4-3 i{
position: absolute;
top: 50%;
right: 0;
left: 0;
transform: translateY(-5rem);
}

.md-snackbar {
&.md-position-left{
&.md-snackbar-adjust{
min-width: auto;
left: 50%;
transform: translateX(-50%);
}
}

}
10 changes: 10 additions & 0 deletions app/src/assets/css/modules/_utility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
max-width: 80%;
}

.md-layout-item{
height: fit-content;
}

.wrapper {
padding-left: 0;
padding-right: 0;
Expand Down Expand Up @@ -136,6 +140,9 @@
margin-left: 1.2rem !important;
}
}
&-auto {
margin-left: auto !important;
}
}
&-header {
margin: 2rem 0 !important;
Expand Down Expand Up @@ -231,6 +238,9 @@
}
}
&--font-emph {
&-900{
font-weight: 900;
}
&-xl {
font-size: $x-large-size;
font-weight: 700;
Expand Down
6 changes: 3 additions & 3 deletions app/src/components/Drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<router-link to="/explorer/images" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Image Gallery</md-list-item>
</router-link>
<router-link to="/explorer/xmls" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">View Xmls</md-list-item>
</router-link>
</md-list>
</md-list-item>
<md-list-item md-expand>
Expand Down Expand Up @@ -84,9 +87,6 @@
<md-icon class="utility-navfonticon">upload</md-icon>
<span class="md-list-item-text utility-navfont">Curate</span>
<md-list slot="md-expand">
<!-- <md-list-item class="md-inset" href="https://materialsmine.org/nm#/XMLCONV">
Upload a Spreadsheet
</md-list-item> -->
<router-link :to="'/explorer/curate/spreadsheet'" v-slot="{navigate, href}" custom>
<md-list-item :href="href" @click="navigate" class="md-inset">Upload a Spreadsheet</md-list-item>
</router-link>
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/Snackbar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<md-snackbar :md-position="position" :md-active.sync="show" :md-duration="!duration ? Infinity : duration">
<md-snackbar :md-position="position" :md-active.sync="show" :md-duration="!duration ? Infinity : duration" class="md-snackbar-adjust">
{{message}}
<span>
<md-button v-if="action && !duration" id="snackbarAction" class="md-primary" @click.native="callAction">Retry</md-button>
Expand All @@ -17,7 +17,7 @@ export default {
position: {
type: String,
required: false,
default: 'center'
default: 'left'
}
},
data () {
Expand Down
Loading

0 comments on commit 9d7d0dd

Please sign in to comment.