Skip to content

Commit

Permalink
update webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
cayb0rg committed Sep 21, 2023
1 parent 37f1870 commit 6bcdff2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 42 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cleanName": "secret-spreadsheet"
},
"dependencies": {
"materia-widget-development-kit": "^2.4.2"
"materia-widget-development-kit": "../../MWDK4"
},
"devDependencies": {
"@babel/preset-react": "^7.0.0",
Expand All @@ -18,10 +18,10 @@
"react-test-renderer": "^16.9.0"
},
"scripts": {
"start": "webpack-dev-server",
"lint": "eslint src/**/*.js",
"build": "webpack -p",
"build-dev": "webpack",
"start": "mwdk-start",
"build": "mwdk-build-prod",
"build-dev": "mwdk-build-dev",
"test": "jest",
"test-ci": "TZ='America/New_York' CI=true jest --ci --useStderr --coverage --coverageReporters text-summary cobertura"
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/player/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class Cell extends React.Component {
value = value.slice(0, 36);
}

if (value.length > 0) {
this.props.saveAnswer(event)
}

this.setState({
value: value,
colorClass: this.state.colorClass,
Expand Down
21 changes: 7 additions & 14 deletions src/components/player/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,11 @@ class PlayerTable extends React.Component {
// add in the row labels if needed
if (j === 0 && this.props.spreadsheet) {
// make the first label generated a th if needed
if (i === 0 && this.props.header) {
cells.push(
<th key={`row-label-${i+1}`} id={`row-label-${i+1}`} className="label skinny" >
{i+1}
</th>
);
}
else {
cells.push(
<td key={`row-label-${i+1}`} id={`row-label-${i+1}`} className="label skinny" >
{i+1}
</td>
);
}
cells.push(
<th key={`row-label-${i+1}`} id={`row-label-${i+1}`} className="label skinny" >
{i+1}
</th>
);
}

// make the first row of user created content a header if needed
Expand Down Expand Up @@ -177,6 +168,7 @@ class PlayerTable extends React.Component {
}

return(
<>
<table>
<thead>
{headRows}
Expand All @@ -186,6 +178,7 @@ class PlayerTable extends React.Component {
{mainRows}
</tbody>
</table>
</>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/scoreScreen/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ScoreTable extends React.Component {
// add in the row labels if needed
if (this.props.spreadsheet) {
cells.push(
<th key="row=label-1" id="row-label-1" className={`label skinny${this.props.leftAlign ? ` leftAlign`:``}`}>1</th>
<th key="row-label-1" id="row-label-1" className={`label skinny${this.props.leftAlign ? ` leftAlign`:``}`}>1</th>
);
}

Expand Down Expand Up @@ -124,9 +124,9 @@ class ScoreTable extends React.Component {
// add in row labels if needed
if (j === 0 && this.props.spreadsheet) {
cells.push(
<td key={`row-label-${i+1}`} id={`row-label-${i+1}`} className={`label skinny${this.props.leftAlign ? ` leftAlign`:``}`}>
<th key={`row-label-${i+1}`} id={`row-label-${i+1}`} className={`label skinny${this.props.leftAlign ? ` leftAlign`:``}`}>
{i+1}
</td>
</th>
);
}

Expand Down
1 change: 1 addition & 0 deletions src/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ export default class CreatorApp extends React.Component {
if (row >= 0 && row < this.state.qset.dimensions.rows &&
col >= 0 && col < this.state.qset.dimensions.columns) {
this.refsArray[row][col].focus();
console.log(document.activeElement)
// return value for testing
return 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class PlayerApp extends React.Component {
// check if question has been answered. If it is, submit the answer, or submit blank
submitAnswer(id, counter) {
if (Object.prototype.hasOwnProperty.call(this.answers, `${counter}-input`)) {
console.log(id)
Materia.Score.submitQuestionForScoring(id, this.answers[`${counter}-input`]);
}
else {
Expand Down Expand Up @@ -216,7 +217,7 @@ class PlayerApp extends React.Component {
</div>
</div>

<p>You've filled out {this.state.answered} of {this.blankPositions.size} missing cells</p>
<p aria-hidden="true" >You've filled out {this.state.answered} of {this.blankPositions.size} missing cells</p>

{
this.state.question
Expand Down
26 changes: 6 additions & 20 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,20 @@ const rules = widgetWebpack.getDefaultRules()
const copy = widgetWebpack.getDefaultCopyList()

const entries = {
'player.js': [
path.join(srcPath, 'player.js')
],
'player.css': [
'player': [
path.join(srcPath, 'player.html'),
path.join(srcPath, 'player.js'),
path.join(srcPath, 'player.scss')
],
'creator.js': [
path.join(srcPath, 'creator.js')
],
'creator.css': [
'creator': [
path.join(srcPath, 'creator.html'),
path.join(srcPath, 'creator.js'),
path.join(srcPath, 'creator.scss')
],
'scoreScreen.js': [
path.join(srcPath, 'scoreScreen.js')
],
'scoreScreen.css': [
'scoreScreen': [
path.join(srcPath, 'scoreScreen.html'),
path.join(srcPath, 'scoreScreen.js'),
path.join(srcPath, 'scoreScreen.scss')
],
'guides/player.temp.html': [
path.join(srcPath, '_guides', 'player.md')
],
'guides/creator.temp.html': [
path.join(srcPath, '_guides', 'creator.md')
]
}

Expand All @@ -54,9 +42,7 @@ const customReactLoader = {

const customRules = [
rules.loadHTMLAndReplaceMateriaScripts,
rules.loadAndPrefixCSS,
rules.loadAndPrefixSASS,
rules.loadAndCompileMarkdown,
rules.copyImages,
customReactLoader
]
Expand Down

0 comments on commit 6bcdff2

Please sign in to comment.