Skip to content

Commit 055e493

Browse files
authored
Merge pull request #380 from NREL/develop
Merge 0.4.1 into Main
2 parents c90d064 + cef1282 commit 055e493

File tree

37 files changed

+646
-503
lines changed

37 files changed

+646
-503
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
# Reenable pull_request if we start receiving 3rd party contributions.
6-
# Otherwise all pull_requests will also be push test and we are enforcing
7-
# that code must be up to date with parent in the PRs.
5+
# Re-enable pull_request if we start receiving 3rd party contributions.
6+
# Otherwise, all pull_requests will also be push test and we are enforcing
7+
# that code must be up-to-date with parent in the PRs.
88
#pull_request:
99

1010
jobs:
@@ -76,6 +76,8 @@ jobs:
7676
# the webpack calling on the web container for .dev.yml can take some
7777
# time.
7878
- name: Build and run stack
79+
env:
80+
GIT_COMMIT: ${{ github.sha }}
7981
run: |
8082
printenv
8183
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d worker
@@ -90,11 +92,11 @@ jobs:
9092

9193
- name: Run modelica job tests in Docker worker container
9294
run: |
93-
docker exec alfalfa_worker bash -c "cd /alfalfa && pytest -m docker tests/jobs/modelica -o log_cli=true -o log_level=info"
95+
docker exec alfalfa_worker_1 bash -c "cd /alfalfa && pytest -m docker tests/jobs/modelica -o log_cli=true -o log_level=info"
9496
9597
- name: Run openstudio job tests in Docker worker container
9698
run: |
97-
docker exec alfalfa_worker bash -c "cd /alfalfa && pytest -m docker tests/jobs/openstudio -o log_cli=true -o log_level=info"
99+
docker exec alfalfa_worker_1 bash -c "cd /alfalfa && pytest -m docker tests/jobs/openstudio -o log_cli=true -o log_level=info"
98100
99101
- name: Dump docker logs on failure
100102
if: failure()
@@ -122,6 +124,8 @@ jobs:
122124
poetry-version: 1.2.1
123125

124126
- name: Build and run stack
127+
env:
128+
GIT_COMMIT: ${{ github.sha }}
125129
run: |
126130
printenv
127131
docker-compose up --build -d
@@ -173,6 +177,8 @@ jobs:
173177
poetry-version: 1.2.1
174178

175179
- name: Build and run stack
180+
env:
181+
GIT_COMMIT: ${{ github.sha }}
176182
run: |
177183
export HISTORIAN_ENABLE=true
178184
printenv

alfalfa_web/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM node:16 AS base
2+
ARG GIT_COMMIT
3+
ENV GIT_COMMIT=$GIT_COMMIT
24

35
RUN apt-get update && apt-get install -y \
46
ca-certificates \

alfalfa_web/components/Sims/Sims.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,23 @@ class Sims extends React.Component {
6666
selected: []
6767
};
6868

69-
isSelected = (simRef) => {
70-
return this.state.selected.indexOf(simRef) !== -1;
69+
isSelected = (id) => {
70+
return this.state.selected.indexOf(id) !== -1;
7171
};
7272

7373
selectedSims = () => {
7474
return this.props.data.viewer.sims.filter((sim) => {
75-
return this.state.selected.some((simRef) => {
76-
return simRef === sim.simRef;
77-
});
75+
return this.state.selected.some((id) => id === sim.siteRef);
7876
});
7977
};
8078

81-
handleRowClick = (event, simRef) => {
79+
handleRowClick = (event, id) => {
8280
const { selected } = this.state;
83-
const selectedIndex = selected.indexOf(simRef);
81+
const selectedIndex = selected.indexOf(id);
8482
let newSelected = [];
8583

8684
if (selectedIndex === -1) {
87-
newSelected = newSelected.concat(selected, simRef);
85+
newSelected = newSelected.concat(selected, id);
8886
} else if (selectedIndex === 0) {
8987
newSelected = newSelected.concat(selected.slice(1));
9088
} else if (selectedIndex === selected.length - 1) {
@@ -156,12 +154,12 @@ class Sims extends React.Component {
156154
</TableHead>
157155
<TableBody>
158156
{sims.map((sim) => {
159-
const isSelected = this.isSelected(sim.simRef);
157+
const isSelected = this.isSelected(sim.siteRef);
160158
return (
161159
<TableRow
162-
key={sim.simRef}
160+
key={sim.siteRef}
163161
style={{ cursor: "default" }}
164-
onClick={(event) => this.handleRowClick(event, sim.simRef)}>
162+
onClick={(event) => this.handleRowClick(event, sim.siteRef)}>
165163
<TableCell padding="checkbox">
166164
<Checkbox checked={isSelected} />
167165
</TableCell>
@@ -214,7 +212,6 @@ const simsQL = gql`
214212
query SimsQuery {
215213
viewer {
216214
sims {
217-
simRef
218215
name
219216
simStatus
220217
siteRef

alfalfa_web/components/Sites/Sites.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class Sites extends React.Component {
113113
};
114114

115115
handleRemoveSite = () => {
116-
this.selectedSites().map((item) => {
117-
this.props.removeSiteProp(item.siteRef);
116+
this.selectedSites().map(({ siteRef }) => {
117+
this.props.removeSiteProp(siteRef);
118118
});
119119
};
120120

alfalfa_web/generate-docs.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ const openapiSpecification = swaggerJsdoc({
3838
],
3939
components: {
4040
schemas: {
41-
Model: {
41+
Error: {
42+
type: "object",
43+
properties: {
44+
error: {
45+
type: "string"
46+
}
47+
}
48+
},
49+
Site: {
4250
type: "object",
4351
properties: {
4452
id: {
4553
type: "string"
4654
},
47-
description: {
55+
name: {
4856
type: "string"
4957
},
5058
uploadTimestamp: {

0 commit comments

Comments
 (0)