Skip to content

Commit dd77acf

Browse files
Merge branch 'release/7.2.0'
2 parents 96c30ec + 058a12a commit dd77acf

File tree

23 files changed

+449
-48
lines changed

23 files changed

+449
-48
lines changed

.husky/pre-commit

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
11
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
32

4-
npx --no-install pretty-quick --staged
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
5+
fi
6+
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
9+
fi
10+
11+
call_lefthook()
12+
{
13+
if test -n "$LEFTHOOK_BIN"
14+
then
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook.exe -h >/dev/null 2>&1
17+
then
18+
lefthook.exe "$@"
19+
elif lefthook.bat -h >/dev/null 2>&1
20+
then
21+
lefthook.bat "$@"
22+
else
23+
dir="$(git rev-parse --show-toplevel)"
24+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
25+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
26+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe"
27+
then
28+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@"
32+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe"
33+
then
34+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@"
35+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
36+
then
37+
"$dir/node_modules/lefthook/bin/index.js" "$@"
38+
39+
elif bundle exec lefthook -h >/dev/null 2>&1
40+
then
41+
bundle exec lefthook "$@"
42+
elif yarn lefthook -h >/dev/null 2>&1
43+
then
44+
yarn lefthook "$@"
45+
elif pnpm lefthook -h >/dev/null 2>&1
46+
then
47+
pnpm lefthook "$@"
48+
elif swift package plugin lefthook >/dev/null 2>&1
49+
then
50+
swift package --disable-sandbox plugin lefthook "$@"
51+
elif command -v mint >/dev/null 2>&1
52+
then
53+
mint run csjones/lefthook-plugin "$@"
54+
elif command -v npx >/dev/null 2>&1
55+
then
56+
npx lefthook "$@"
57+
else
58+
echo "Can't find lefthook in PATH"
59+
fi
60+
fi
61+
}
62+
63+
call_lefthook run "pre-commit" "$@"

.husky/prepare-commit-msg

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/sh
2+
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
5+
fi
6+
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
9+
fi
10+
11+
call_lefthook()
12+
{
13+
if test -n "$LEFTHOOK_BIN"
14+
then
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook.exe -h >/dev/null 2>&1
17+
then
18+
lefthook.exe "$@"
19+
elif lefthook.bat -h >/dev/null 2>&1
20+
then
21+
lefthook.bat "$@"
22+
else
23+
dir="$(git rev-parse --show-toplevel)"
24+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
25+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
26+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe"
27+
then
28+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@"
32+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe"
33+
then
34+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@"
35+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
36+
then
37+
"$dir/node_modules/lefthook/bin/index.js" "$@"
38+
39+
elif bundle exec lefthook -h >/dev/null 2>&1
40+
then
41+
bundle exec lefthook "$@"
42+
elif yarn lefthook -h >/dev/null 2>&1
43+
then
44+
yarn lefthook "$@"
45+
elif pnpm lefthook -h >/dev/null 2>&1
46+
then
47+
pnpm lefthook "$@"
48+
elif swift package plugin lefthook >/dev/null 2>&1
49+
then
50+
swift package --disable-sandbox plugin lefthook "$@"
51+
elif command -v mint >/dev/null 2>&1
52+
then
53+
mint run csjones/lefthook-plugin "$@"
54+
elif command -v npx >/dev/null 2>&1
55+
then
56+
npx lefthook "$@"
57+
else
58+
echo "Can't find lefthook in PATH"
59+
fi
60+
fi
61+
}
62+
63+
call_lefthook run "prepare-commit-msg" "$@"

appcore/modules/shared/models/sync/activity.model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export class TrainingEffect {
166166

167167
export class Scores {
168168
public stress: StressScores;
169+
public efficiency?: number;
169170
public powerHr?: number;
170171
public runningRating?: number;
171172
public swolf?: { 25?: number; 50?: number };

appcore/modules/shared/sync/compute/activity-computer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,13 @@ export class ActivityComputer {
979979
)
980980
: null;
981981

982+
983+
// Efficiency
984+
scores.efficiency =
985+
stats?.power?.weighted && stats?.heartRate?.avg
986+
? _.round(stats?.power?.weighted / stats?.heartRate?.avg, ActivityComputer.RND)
987+
: null;
988+
982989
// Power/HR
983990
scores.powerHr =
984991
stats?.power?.avg && stats?.heartRate?.avg

appcore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "elevate-sports-app",
3-
"version": "7.1.0",
3+
"version": "7.2.0",
44
"license": "MPL-2.0",
55
"scripts": {
66
"ng": "ng",
@@ -106,4 +106,4 @@
106106
"ts-node": "^10.7.0",
107107
"typescript": "~4.8.4"
108108
}
109-
}
109+
}

appcore/src/app/activities/activity-columns.namespace.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,16 @@ export namespace ActivityColumns {
478478
Print.number,
479479
1
480480
).setDescription('"Running Rating" is an equivalent of "Running Index" from Polar'),
481+
new NumberColumn(
482+
Category.COMMON,
483+
["stats", "scores", "efficiency"],
484+
null,
485+
"Efficiency Factor",
486+
Print.number,
487+
2
488+
).setDescription(
489+
'Efficiency Factor (EF) is your "Normalized Power® (Input)/ Average Heart rate (Output)". Higher value means better aerobic fit.'
490+
),
481491
new NumberColumn(
482492
Category.COMMON,
483493
["stats", "scores", "powerHr"],

appcore/src/app/desktop/activity-view/shared/models/stats/groups/essential-stats-group.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export abstract class EssentialStatsGroup extends StatsGroup {
1010
StatsDef.Generic.movingTime,
1111
StatsDef.Generic.elapsedTime,
1212
StatsDef.Generic.moveRatio,
13+
StatsDef.Scores.efficiency,
1314
StatsDef.Scores.powerHr,
1415
StatsDef.Generic.calories,
1516
StatsDef.Generic.caloriesPerHour,

appcore/src/app/desktop/activity-view/shared/models/stats/groups/power-stats-group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export class CyclingPowerStatsGroup extends PowerStatsGroup {
2828
StatsDef.Power.threshold(cyclingPowerSensor),
2929
StatsDef.Scores.Stress.Cycling.pss(cyclingPowerSensor, activity.startTime),
3030
StatsDef.Scores.Stress.Cycling.pssPerHour(cyclingPowerSensor, activity.startTime),
31-
StatsDef.Power.variabilityIndex(cyclingPowerSensor),
3231
StatsDef.Power.Cycling.intensity(cyclingPowerSensor, activity.startTime),
32+
StatsDef.Power.variabilityIndex(cyclingPowerSensor),
3333
StatsDef.Power.q25(cyclingPowerSensor),
3434
StatsDef.Power.q50(cyclingPowerSensor),
3535
StatsDef.Power.q75(cyclingPowerSensor),

appcore/src/app/desktop/activity-view/shared/models/stats/stats-def.namespace.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,14 @@ export namespace StatsDef {
840840
}
841841

842842
export namespace Scores {
843+
export const efficiency = Stat.create<Scores>(
844+
VoidSensor.DEFAULT,
845+
"Efficiency Factor",
846+
["stats", "scores", "efficiency"],
847+
'Efficiency Factor is your "Normalized Power® / Average Heart rate" ("Input Power / Output HR"). Higher value means better aerobic fit.',
848+
2
849+
).asEmptyUnit();
850+
843851
export const powerHr = Stat.create<Scores>(
844852
VoidSensor.DEFAULT,
845853
"Power/Hr",
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { DesktopMigration } from "./desktop-migrations.model";
22
import { Upgrade_7_0_0$beta_3 } from "./upgrade_7_0_0-beta.3/upgrade_7_0_0-beta.3";
33
import { Upgrade_7_0_0$beta_5 } from "./upgrade_7_0_0-beta.5/upgrade_7_0_0-beta.5";
4+
import { Upgrade_7_2_0 } from "./upgrade_7_2_0/upgrade_7_2_0";
45

56
/**
67
* Add desktop migrations inside LIST. The LIST is sorted from lowest to high versions
78
*/
89
export class DesktopRegisteredMigrations {
910
public static readonly LIST: DesktopMigration[] = [
1011
new Upgrade_7_0_0$beta_3(), // To version 7.0.0-beta.3
11-
new Upgrade_7_0_0$beta_5() // To version 7.0.0-beta.5
12+
new Upgrade_7_0_0$beta_5(), // To version 7.0.0-beta.5
13+
new Upgrade_7_2_0() // To version 7.2.0
1214
/* Next Upgrade Here */
1315
];
1416
}

0 commit comments

Comments
 (0)