Skip to content

Commit

Permalink
refactor(stage): move stage to model
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentinTh committed Aug 9, 2023
1 parent 1332404 commit b7bb9eb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/scripts/app/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ErrorOverlay } from '../components/overlay.js';
import { FileHelper } from '../helpers/file-helper.js';
import { StringHelper } from '../helpers/string-helper.js';
import { TypeHelper } from '../helpers/type-helper.js';
import { Stages } from '../data/stages.js';
import { Stage } from '../models/stage.js';
import { Configuration } from './configuration.js';

const fs = nw.require('fs');
Expand All @@ -21,7 +21,7 @@ const readAppDataFile = new Promise((resolve, reject) => {
});

export class Metadata {
#stages = Object.values(Stages);
#stages = Object.values(Stage);
#metadataRootFolder = '.metadata';
#metadataFilename = 'data.json';
#inputDataPath;
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/data/stages.js → src/scripts/models/stage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const Stages = {
export const Stage = {
CONCENTRIC: 'concentric',
ECCENTRIC: 'eccentric'
};
4 changes: 2 additions & 2 deletions src/scripts/participants-selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Loader } from './components/loader.js';
import { ErrorOverlay } from './components/overlay';
import { getAllParticipants } from './utils/participants';
import { Metadata } from './app/metadata.js';
import { Stages } from './data/stages.js';
import { Stage } from './models/stage.js';
import { PathHelper } from './helpers/path-helper.js';
import { StringHelper } from './helpers/string-helper';
import { Switch } from './utils/switch';
Expand Down Expand Up @@ -108,7 +108,7 @@ const sessionStage = PathHelper.sanitizePath(
sessionStorage.getItem('stage').toString().toLowerCase().trim()
);

let stage = sessionStage === undefined ? Stages.CONCENTRIC : sessionStage;
let stage = sessionStage === undefined ? Stage.CONCENTRIC : sessionStage;

let participantItems;
let isAllSelected = false;
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createPopper } from '@popperjs/core';
import { Menu } from './components/menu.js';
import { Router } from './routes/router.js';
import { Metadata } from './app/metadata.js';
import { Stages } from './data/stages.js';
import { Stage } from './models/stage.js';
import { PathHelper } from './helpers/path-helper';
import { ErrorOverlay } from './components/overlay';
import { FileHelper } from './helpers/file-helper';
Expand Down Expand Up @@ -190,7 +190,7 @@ const getRelevantRatioCoords = analysis => {
let antagonist = appData.muscles.find(item => item.id === antagonistID).label;
let agonist = appData.muscles.find(item => item.id === agonistID).label;

if (!(stage === Stages.CONCENTRIC)) {
if (!(stage === Stage.CONCENTRIC)) {
antagonist = appData.muscles.find(item => item.id === agonistID).label;
agonist = appData.muscles.find(item => item.id === antagonistID).label;
}
Expand Down

0 comments on commit b7bb9eb

Please sign in to comment.