Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
actual-vt-capstone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danieljk
actual-vt-capstone
Commits
98a7aac7
Unverified
Commit
98a7aac7
authored
10 months ago
by
youngcw
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
add schedule name check to check templates (#2667)
* check schedule name * note
parent
d49f907f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/loot-core/src/server/budget/goaltemplates.ts
+17
-1
17 additions, 1 deletion
packages/loot-core/src/server/budget/goaltemplates.ts
upcoming-release-notes/2667.md
+6
-0
6 additions, 0 deletions
upcoming-release-notes/2667.md
with
23 additions
and
1 deletion
packages/loot-core/src/server/budget/goaltemplates.ts
+
17
−
1
View file @
98a7aac7
...
@@ -641,17 +641,33 @@ async function checkTemplates(): Promise<Notification> {
...
@@ -641,17 +641,33 @@ async function checkTemplates(): Promise<Notification> {
const
categories
=
await
db
.
all
(
const
categories
=
await
db
.
all
(
'
SELECT * FROM v_categories WHERE tombstone = 0
'
,
'
SELECT * FROM v_categories WHERE tombstone = 0
'
,
);
);
let
all_schedule_names
=
await
db
.
all
(
'
SELECT name from schedules WHERE name NOT NULL AND tombstone = 0
'
,
);
all_schedule_names
=
all_schedule_names
.
map
(
v
=>
v
.
name
);
// run through each line and see if its an error
// run through each line and see if its an error
for
(
let
c
=
0
;
c
<
categories
.
length
;
c
++
)
{
for
(
let
c
=
0
;
c
<
categories
.
length
;
c
++
)
{
const
category
=
categories
[
c
];
const
category
=
categories
[
c
];
const
template
=
category_templates
[
category
.
id
];
const
template
=
category_templates
[
category
.
id
];
if
(
template
)
{
if
(
template
)
{
for
(
let
l
=
0
;
l
<
template
.
length
;
l
++
)
{
for
(
let
l
=
0
;
l
<
template
.
length
;
l
++
)
{
//check for basic error
if
(
template
[
l
].
type
===
'
error
'
)
{
if
(
template
[
l
].
type
===
'
error
'
)
{
//return { type: 'message', message: "found a bad one",};
errors
.
push
(
category
.
name
+
'
:
'
+
template
[
l
].
line
);
errors
.
push
(
category
.
name
+
'
:
'
+
template
[
l
].
line
);
}
}
// check schedule name error
if
(
template
[
l
].
type
===
'
schedule
'
)
{
if
(
!
all_schedule_names
.
includes
(
template
[
l
].
name
))
{
errors
.
push
(
category
.
name
+
'
: Schedule “
'
+
template
[
l
].
name
+
'
” does not exist
'
,
);
}
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
upcoming-release-notes/2667.md
0 → 100644
+
6
−
0
View file @
98a7aac7
---
category
:
Enhancements
authors
:
[
youngcw
]
---
Check schedule name when using the check templates function
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment