Skip to content

Commit

Permalink
Merge dev into trio-bo
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornoleh committed Jul 20, 2024
2 parents 9037eb3 + 9672da2 commit a778332
Show file tree
Hide file tree
Showing 33 changed files with 948 additions and 551 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/add_to_project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 8. DONT RUN Add bugs to bugs project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
if: github.repository_owner == 'nightscout'
steps:
- uses: actions/add-to-project@v1.0.2
with:
# You can target a project in a different organization
# to the issue
project-url: https://github.com/orgs/nightscout/projects/2
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: bug, needs-triage
label-operator: OR

48 changes: 48 additions & 0 deletions .github/workflows/stale_issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 8. DONT RUN close inactive issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
if: github.repository_owner == 'nightscout'
steps:
- uses: actions/stale@v9.0.0
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "hey 👋 - silence for 30 days 🤐 ... anybody? triage is required!"
close-issue-message: "closed 📴 because silencio 🤫 since an additional 14 days after staleness 📠"
close-issue-label: "not-planned"
exempt-issue-labels: "needs-triage, long-term, in-progress"
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}


close-issues-triage:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
if: github.repository_owner == 'nightscout'
steps:
- uses: actions/stale@v9.0.0
with:
days-before-issue-stale: 30
days-before-issue-close: 30
stale-issue-label: "stale"
stale-issue-message: "hey 👋 - no triage is done for 30 days 🤐 ... anybody? triage is required!"
close-issue-message: "closed 📴 because silencio 🤫 since an additional 30 days after staleness 📠"
close-issue-label: "not-planned"
exempt-issue-labels: "long-term, in-progress"
any-of-labels: "needs-triage"
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion CGMBLEKit
1 change: 0 additions & 1 deletion Config.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ APP_BUILD_NUMBER = 1
COPYRIGHT_NOTICE =
DEVELOPER_TEAM = ##TEAM_ID##
BUNDLE_IDENTIFIER = org.nightscout.$(DEVELOPMENT_TEAM).trio
APP_GROUP_ID = group.com.$(DEVELOPMENT_TEAM).loopkit.LoopGroup
APP_ICON = trioBlack
APP_URL_SCHEME = Trio

Expand Down
10 changes: 6 additions & 4 deletions FreeAPS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
3871F38725ED661C0013ECB5 /* Suggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3871F38625ED661C0013ECB5 /* Suggestion.swift */; };
3871F39C25ED892B0013ECB5 /* TempTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3871F39B25ED892B0013ECB5 /* TempTarget.swift */; };
3871F39F25ED895A0013ECB5 /* Decimal+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3871F39E25ED895A0013ECB5 /* Decimal+Extensions.swift */; };
3883581C25EE79BB00E024B2 /* DecimalTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3883581B25EE79BB00E024B2 /* DecimalTextField.swift */; };
3883581C25EE79BB00E024B2 /* TextFieldWithToolBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3883581B25EE79BB00E024B2 /* TextFieldWithToolBar.swift */; };
3883583425EEB38000E024B2 /* PumpSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3883583325EEB38000E024B2 /* PumpSettings.swift */; };
388358C825EEF6D200E024B2 /* BasalProfileEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 388358C725EEF6D200E024B2 /* BasalProfileEntry.swift */; };
38887CCE25F5725200944304 /* IOBEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38887CCD25F5725200944304 /* IOBEntry.swift */; };
Expand Down Expand Up @@ -641,7 +641,7 @@
3871F38625ED661C0013ECB5 /* Suggestion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Suggestion.swift; sourceTree = "<group>"; };
3871F39B25ED892B0013ECB5 /* TempTarget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempTarget.swift; sourceTree = "<group>"; };
3871F39E25ED895A0013ECB5 /* Decimal+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Decimal+Extensions.swift"; sourceTree = "<group>"; };
3883581B25EE79BB00E024B2 /* DecimalTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecimalTextField.swift; sourceTree = "<group>"; };
3883581B25EE79BB00E024B2 /* TextFieldWithToolBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldWithToolBar.swift; sourceTree = "<group>"; };
3883583325EEB38000E024B2 /* PumpSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PumpSettings.swift; sourceTree = "<group>"; };
388358C725EEF6D200E024B2 /* BasalProfileEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasalProfileEntry.swift; sourceTree = "<group>"; };
38887CCD25F5725200944304 /* IOBEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOBEntry.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1516,7 +1516,7 @@
isa = PBXGroup;
children = (
3811DE5925C9D4D500A708ED /* ViewModifiers.swift */,
3883581B25EE79BB00E024B2 /* DecimalTextField.swift */,
3883581B25EE79BB00E024B2 /* TextFieldWithToolBar.swift */,
383420D825FFEB3F002D46C1 /* Popup.swift */,
389ECDFD2601061500D86C4F /* View+Snapshot.swift */,
38EA05FF262091870064E39B /* BolusProgressViewStyle.swift */,
Expand Down Expand Up @@ -2719,7 +2719,7 @@
38A504A425DD9C4000C5B9E8 /* UserDefaultsExtensions.swift in Sources */,
38FE826A25CC82DB001FF17A /* NetworkService.swift in Sources */,
FE66D16B291F74F8005D6F77 /* Bundle+Extensions.swift in Sources */,
3883581C25EE79BB00E024B2 /* DecimalTextField.swift in Sources */,
3883581C25EE79BB00E024B2 /* TextFieldWithToolBar.swift in Sources */,
6B1A8D2E2B156EEF00E76752 /* LiveActivityBridge.swift in Sources */,
38DAB28A260D349500F74C1A /* FetchGlucoseManager.swift in Sources */,
38F37828261260DC009DB701 /* Color+Extensions.swift in Sources */,
Expand Down Expand Up @@ -3026,6 +3026,7 @@
baseConfigurationReference = 38F3783A2613555C009DB701 /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_ID = "group.$(BUNDLE_IDENTIFIER).trio-app-group";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -3091,6 +3092,7 @@
baseConfigurationReference = 38F3783A2613555C009DB701 /* Config.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_ID = "group.$(BUNDLE_IDENTIFIER).trio-app-group";
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down
49 changes: 22 additions & 27 deletions FreeAPS/Sources/Modules/AddCarbs/View/AddCarbsRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,34 @@ extension AddCarbs {
HStack {
Text("Carbs").fontWeight(.semibold)
Spacer()
DecimalTextField(
"0",
value: $state.carbs,
formatter: formatter,
autofocus: true,
cleanInput: true
TextFieldWithToolBar(
text: $state.carbs,
placeholder: "0",
shouldBecomeFirstResponder: true,
numberFormatter: formatter
)
Text(state.carbs > state.maxCarbs ? "⚠️" : "g").foregroundColor(.secondary)
}.padding(.vertical)

if state.useFPUconversion {
proteinAndFat()
}
HStack {
Text("Note").foregroundColor(.secondary)
TextField("", text: $state.note).multilineTextAlignment(.trailing)
if isFocused {
Button { isFocused = false } label: { Image(systemName: "keyboard.chevron.compact.down") }
.controlSize(.mini)
VStack {
HStack {
Text("Note").foregroundColor(.secondary)
TextFieldWithToolBarString(text: $state.note, placeholder: "", maxLength: 25)
if isFocused {
Button { isFocused = false } label: { Image(systemName: "keyboard.chevron.compact.down") }
.controlSize(.mini)
}
}.focused($isFocused)

HStack {
Spacer()
Text("\(state.note.count) / 25")
.foregroundStyle(.secondary)
}
}.focused($isFocused)
}
HStack {
Button {
state.useFPUconversion.toggle()
Expand Down Expand Up @@ -269,25 +276,13 @@ extension AddCarbs {
HStack {
Text("Fat").foregroundColor(.orange) // .fontWeight(.thin)
Spacer()
DecimalTextField(
"0",
value: $state.fat,
formatter: formatter,
autofocus: false,
cleanInput: true
)
TextFieldWithToolBar(text: $state.fat, placeholder: "0", numberFormatter: formatter)
Text(state.fat > state.maxFat ? "⚠️" : "g").foregroundColor(.secondary)
}
HStack {
Text("Protein").foregroundColor(.red) // .fontWeight(.thin)
Spacer()
DecimalTextField(
"0",
value: $state.protein,
formatter: formatter,
autofocus: false,
cleanInput: true
)
TextFieldWithToolBar(text: $state.protein, placeholder: "0", numberFormatter: formatter)
Text(state.protein > state.maxProtein ? "⚠️" : "g").foregroundColor(.secondary)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ extension AddTempTarget {
HStack {
Text("Target")
Spacer()
DecimalTextField("0", value: $state.low, formatter: formatter, cleanInput: true)
TextFieldWithToolBar(text: $state.low, placeholder: "0", numberFormatter: formatter)
Text(state.units.rawValue).foregroundColor(.secondary)
}
HStack {
Text("Duration")
Spacer()
DecimalTextField("0", value: $state.duration, formatter: formatter, cleanInput: true)
TextFieldWithToolBar(text: $state.duration, placeholder: "0", numberFormatter: formatter)
Text("minutes").foregroundColor(.secondary)
}
}
Expand All @@ -203,7 +203,7 @@ extension AddTempTarget {
HStack {
Text("Duration")
Spacer()
DecimalTextField("0", value: $state.duration, formatter: formatter, cleanInput: true)
TextFieldWithToolBar(text: $state.duration, placeholder: "0", numberFormatter: formatter)
Text("minutes").foregroundColor(.secondary)
}
}
Expand Down
11 changes: 5 additions & 6 deletions FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ extension Bolus {
HStack {
Text("Bolus")
Spacer()
DecimalTextField(
"0",
value: $state.amount,
formatter: formatter,
autofocus: true,
cleanInput: true
TextFieldWithToolBar(
text: $state.amount,
placeholder: "0",
shouldBecomeFirstResponder: true,
numberFormatter: formatter
)
Text(state.amount > state.maxBolus ? "⚠️" : "U").foregroundColor(.secondary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ extension Calibrations {
HStack {
Text("Meter glucose")
Spacer()
DecimalTextField(
"0",
value: $state.newCalibration,
formatter: formatter,
autofocus: false,
cleanInput: true
)
TextFieldWithToolBar(text: $state.newCalibration, placeholder: "0", numberFormatter: formatter)
Text(state.units.rawValue).foregroundColor(.secondary)
}
Button {
Expand Down
29 changes: 16 additions & 13 deletions FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,11 @@ extension DataTable {
Section {
HStack {
Text("New Glucose")
DecimalTextField(
" ... ",
value: $state.manualGlucose,
formatter: glucoseFormatter,
autofocus: true,
cleanInput: true
TextFieldWithToolBar(
text: $state.manualGlucose,
placeholder: " ... ",
shouldBecomeFirstResponder: true,
numberFormatter: glucoseFormatter
)
Text(state.units.rawValue).foregroundStyle(.secondary)
}
Expand Down Expand Up @@ -253,12 +252,11 @@ extension DataTable {
HStack {
Text("Amount")
Spacer()
DecimalTextField(
"0",
value: $state.externalInsulinAmount,
formatter: insulinFormatter,
autofocus: true,
cleanInput: true
TextFieldWithToolBar(
text: $state.externalInsulinAmount,
placeholder: "0",
shouldBecomeFirstResponder: true,
numberFormatter: insulinFormatter
)
Text("U").foregroundColor(.secondary)
}
Expand Down Expand Up @@ -316,7 +314,12 @@ extension DataTable {
state.units == .mmolL ? $0.asMmolL : Decimal($0)
) as NSNumber)!
} ?? "--")
Text(item.glucose.direction?.symbol ?? "--")
if item.glucose.type == "Manual" {
Image(systemName: "drop.fill")
.foregroundColor(Color.loopRed)
} else {
Text(item.glucose.direction?.symbol ?? "--")
}
Spacer()

Text(dateFormatter.string(from: item.glucose.dateString))
Expand Down
18 changes: 11 additions & 7 deletions FreeAPS/Sources/Modules/FPUConfig/View/FPUConfigRootView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,42 @@ extension FPUConfig {
Section(header: Text("Limit Per Entry")) {
HStack {
Text("Max Carbs")
DecimalTextField("g", value: $state.maxCarbs, formatter: formatter)
TextFieldWithToolBar(text: $state.maxCarbs, placeholder: "g", numberFormatter: formatter)
}
HStack {
Text("Max Fat")
DecimalTextField("g", value: $state.maxFat, formatter: formatter)
TextFieldWithToolBar(text: $state.maxFat, placeholder: "g", numberFormatter: formatter)
}
HStack {
Text("Max Protein")
DecimalTextField("g", value: $state.maxProtein, formatter: formatter)
TextFieldWithToolBar(text: $state.maxProtein, placeholder: "g", numberFormatter: formatter)
}
}

Section(header: Text("Fat and Protein Conversion Settings")) {
HStack {
Text("Delay In Minutes")
Spacer()
DecimalTextField("60", value: $state.delay, formatter: intFormater)
TextFieldWithToolBar(text: $state.delay, placeholder: "60", numberFormatter: intFormater)
}
HStack {
Text("Maximum Duration In Hours")
Spacer()
DecimalTextField("8", value: $state.timeCap, formatter: intFormater)
TextFieldWithToolBar(text: $state.timeCap, placeholder: "8", numberFormatter: intFormater)
}
HStack {
Text("Interval In Minutes")
Spacer()
DecimalTextField("30", value: $state.minuteInterval, formatter: intFormater)
TextFieldWithToolBar(text: $state.minuteInterval, placeholder: "30", numberFormatter: intFormater)
}
HStack {
Text("Override With A Factor Of ")
Spacer()
DecimalTextField("0.5", value: $state.individualAdjustmentFactor, formatter: conversionFormatter)
TextFieldWithToolBar(
text: $state.individualAdjustmentFactor,
placeholder: "0.5",
numberFormatter: conversionFormatter
)
}
}

Expand Down
Loading

0 comments on commit a778332

Please sign in to comment.