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

Epic/sof 5386 #53

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89af5b9
Bugfix: stop lattice size change when toggling isNonPeriodic repeatedly
adewyer Jan 13, 2022
be88f06
Merge branch 'epic/SOF-5386' into feature/SOF-5478
adewyer Jan 19, 2022
a29815c
removed unneccessary logic from toggleIsNonPeriodic reducer
adewyer Jan 19, 2022
9e34938
updates to check num atoms from materials-designer
adewyer Jan 21, 2022
d1e54cd
check nAtoms in materials-designer
adewyer Jan 24, 2022
99ac6bb
updated functions to call made.js
adewyer Jan 24, 2022
d8d040d
update github commit hash for made-js
adewyer Jan 24, 2022
7f8b2fb
updated non-periodic toggle option
adewyer Jan 24, 2022
2965b70
moved maxAtom check to validate function, updated made-js commit hash
adewyer Jan 25, 2022
c630d1e
updated error messages based on error number
adewyer Jan 26, 2022
1dbe19c
moved toCartesian to material tool in made.js
adewyer Jan 26, 2022
cad0e60
reverted toggle isNonPeriodic switch label back to original label and…
adewyer Jan 26, 2022
5d1dcd2
updated error checking to use enums dictionary of errors as reference…
adewyer Jan 26, 2022
df4c2ac
feat: configure git in docker for git+https in package.json
tjduigna Jan 27, 2022
0704316
fix: restore default behavior of run-tests.sh for jenkins
tjduigna Jan 27, 2022
39f4891
updates to naming inside functions based on PR
adewyer Feb 8, 2022
60fd1be
updated made hash in package.json
adewyer Feb 8, 2022
d450dbd
fixed function calling typo for xyz parser
adewyer Feb 9, 2022
6e148b5
updated made.js link
adewyer Feb 12, 2022
507e79a
Merge pull request #48 from Exabyte-io/feature/SOF-5175
adewyer Feb 12, 2022
a33d654
Merge branch 'epic/SOF-5386' into feature/SOF-5478
adewyer Feb 14, 2022
dc65adc
Merge pull request #45 from Exabyte-io/feature/SOF-5478
adewyer Feb 14, 2022
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
5 changes: 5 additions & 0 deletions dockerfiles/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ WORKDIR /opt/app

COPY . .

RUN yum install -y git
RUN git init
RUN git config --global url."https://github.com".insteadOf [email protected]:
RUN git config --global url."https://".insteadOf git://

# Enabling devtoolset puts compilers like g++
# in the PATH so that node-gyp can build native
# compiled node modules as part of the install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@babel/preset-react": "7.0.0",
"@babel/runtime": "^7.5.0",
"@babel/runtime-corejs2": "^7.5.0",
"@exabyte-io/made.js": "2021.12.22-0",
"@exabyte-io/made.js": "git+https://github.com/Exabyte-io/made.js.git#3144ca42b45b8dadf4835dcb1945c345b2f9e9ef",
"@exabyte-io/wave.js": "3.1.5",
"bootstrap": "^3.3.7",
"classnames": "^2.2.5",
Expand Down
3 changes: 2 additions & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ SCREENSHOTS_DIR="${CUCUMBER_DIR}/screenshots"
export ROOT_URL="${HOST}:${PORT}"

cd ${TESTS_DIR}
source ${NVM_DIR}/nvm.sh
DEFAULT_NVM_DIR="${HOME}/.nvm"
source ${NVM_DIR:-$DEFAULT_NVM_DIR}/nvm.sh
nvm use ${NODE_VERSION}
npm ci

Expand Down
23 changes: 11 additions & 12 deletions src/components/source_editor/BasisText.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import _ from "underscore";
import React from 'react';
import setClass from 'classnames';
import {Made} from "@exabyte-io/made.js";

import {displayMessage} from "../../i18n/messages";
import { xyzValidationErrorMessagesConfig } from "./enums";

import "codemirror/lib/codemirror.css";
import "codemirror/theme/darcula.css";
Expand Down Expand Up @@ -31,25 +30,25 @@ class BasisText extends React.Component {
}

isContentPassingValidation(content) {
try {
Made.parsers.xyz.validate(content);
// only show the success message first time after last failure
const error = Made.parsers.xyz.validateAll(content);
const errorMessage = xyzValidationErrorMessagesConfig[error];
if (error !== 0) {
this.setState({
isContentValidated: false,
message: errorMessage
});
return false;
} else {
if (!this.state.isContentValidated) {
this.setState({
isContentValidated: true,
// TODO: consider removing the success message after a timeout period
message: displayMessage('basis.validationSuccess')
message: errorMessage
});
} else {
// already validated before -> remove message
this.setState({message: ''});
}
} catch (err) {
this.setState({
isContentValidated: false,
message: displayMessage('basis.validationError')
});
return false;
}
return true;
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/source_editor/enums.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Made} from "@exabyte-io/made.js";
import {displayMessage} from "../../i18n/messages";

export const xyzValidationErrorMessagesConfig = {
0: displayMessage('basis.validationSuccess'),
1001: displayMessage('basis.validationError'),
2001: displayMessage('basis.maxAtomError', Made.Basis.nonPeriodicMaxAtomsCount)
}
1 change: 1 addition & 0 deletions src/i18n/en/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
"elementsNotEqual": "Atomic elements differ",
"validationError": "Invalid basis format. Please see documentation",
"validationSuccess": "Valid basis format",
"maxAtomError": "Number of atoms (%s) exceeded for non-periodic structures."
},
"resetToLast": "Material is reset to last valid state",
"combinatorialBasesCountExceeded": "Number of combinations exceeded the limit (%s)"
Expand Down