Skip to content

Commit

Permalink
v1.2.1 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EPRI-SQA committed May 4, 2022
1 parent 2c8be6d commit 7dee0f5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: node:15.13.0
image: node:17.9.0

stages:
# all jobs for each stage are completed before moving to the next stage
Expand Down
6 changes: 6 additions & 0 deletions DervetApp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Questions and feedback can be submitted to the Electric Power Research Institute

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [1.2.1] - 2022-05-04
## Added
- disable the setting of the battery duration_max parameter when NOT sizing the battery.
## Fixed
- allow import of project.json files created via the Export Project button

## [1.2.0] - 2022-03-30
## Added
- fuel costs are now handled in a project-wide fashion
Expand Down
2 changes: 1 addition & 1 deletion DervetApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DER-VET",
"version": "1.2.0",
"version": "1.2.1",
"author": "",
"description": "",
"license": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,22 @@
</div>
</div>

<radio-button-input
v-model="shouldMaxDuration"
:metadata="metadata.shouldMaxDuration"
:isInvalid="submitted && $v.shouldMaxDuration.$error"
:errorMessage="getErrorMsg('shouldMaxDuration')">
</radio-button-input>
<div v-if="(shouldPowerSize === true) || (shouldEnergySize === true)">
<radio-button-input
v-model="shouldMaxDuration"
:metadata="metadata.shouldMaxDuration"
:isInvalid="submitted && $v.shouldMaxDuration.$error"
:errorMessage="getErrorMsg('shouldMaxDuration')">
</radio-button-input>

<div v-if="shouldMaxDuration === true">
<text-input
v-model="maxDuration"
:metadata="metadata.maxDuration"
:isInvalid="submitted && $v.maxDuration.$error"
:errorMessage="getErrorMsg('maxDuration')">
</text-input>
<div v-if="shouldMaxDuration === true">
<text-input
v-model="maxDuration"
:metadata="metadata.maxDuration"
:isInvalid="submitted && $v.maxDuration.$error"
:errorMessage="getErrorMsg('maxDuration')">
</text-input>
</div>
</div>

<text-input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default class BatteryMetadata extends TechnologyMetadata {
isRequired: true,
type: Boolean,
unit: null,
description: 'Include Housekeeping Power" – Apply a constant AC power consumption that does not discharge the battery directly. This is usually associated with HVAC requirements and keeping all equipment on.',
description: 'Include Housekeeping Power? – Apply a constant AC power consumption that does not discharge the battery directly. This is usually associated with HVAC requirements and keeping all equipment on.',
allowedValues: YES_NO_OPTIONS,
};
includeCycleDegradation: ValueFieldMetadata = {
Expand Down
1 change: 1 addition & 0 deletions DervetApp/src/renderer/models/Project/Project.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface Project {
name: string;
schemaVersion: string;
storeType: string;
objectivesDA: boolean;
tsDaPrice: number[];
fuelPriceGas: number;
Expand Down
9 changes: 5 additions & 4 deletions DervetApp/src/renderer/service/ProjectFileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ import * as FileUtil from '@/util/file';

export const PROJECT_FILE = 'project.json';
const { PROJECT_SCHEMA_VERSION } = process.env;
const STORE_TYPE = 'project';

const getProjectPath = (directory: string) => path.join(directory, PROJECT_FILE);

export const exportProject = (directory: string, project: Project) => {
// TODO LL handle error
const projectCopy = _.cloneDeep(project);
projectCopy.schemaVersion = PROJECT_SCHEMA_VERSION;
projectCopy.storeType = STORE_TYPE;
const exportDirectory = path.join(directory, project.name);
return fsPromises.mkdir(exportDirectory, { recursive: true })
.then(() => Promise.all([
FileUtil.writeObjectToFile(getProjectPath(exportDirectory), project),
FileUtil.writeObjectToFile(getProjectPath(exportDirectory), projectCopy),
]));
};

Expand Down Expand Up @@ -57,9 +59,9 @@ const parseFileBuffersForImport = (contents: any) => {
return Promise.all(promises);
};

// TODO eventually unnecessary
// TODO remove eventually, unnecessary
const convertParsedToImportDto = (parsed: any) => (
parsed.find((item: any) => item.storeType === 'project')
parsed.find((item: any) => item.storeType === STORE_TYPE)
);

export const importProject = (directory: string): Promise<object> => (
Expand All @@ -71,7 +73,6 @@ export const importProject = (directory: string): Promise<object> => (
);

export const checkSchemaVersion = (project: any): Promise<object> => {
// TODO update with the link to Andrew's powerpoint
const errorMsg = `Import Error: This project is incompatible with the current GUI release.<br/>
To check whether your project is compatible, open the project.json file: it must contain a schemaVersion equal to ${PROJECT_SCHEMA_VERSION}.<br/>
To migrate a project exported with a previous version to the most current, see https://github.com/epri-dev/DER-VET/tree/master/migrations/migrate_project_DERVET_GUI.py`;
Expand Down

0 comments on commit 7dee0f5

Please sign in to comment.