Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HARMONY
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amel Abdic
HARMONY
Commits
9d0f67f0
Commit
9d0f67f0
authored
Dec 3, 2023
by
jensilo
Browse files
Options
Downloads
Patches
Plain Diff
fix error when creating new file
parent
439a8696
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/app/eiffel/output.go
+4
-8
4 additions, 8 deletions
src/app/eiffel/output.go
src/app/eiffel/web.go
+7
-2
7 additions, 2 deletions
src/app/eiffel/web.go
templates/eiffel/_elicitation-template.go.html
+1
-1
1 addition, 1 deletion
templates/eiffel/_elicitation-template.go.html
with
12 additions
and
11 deletions
src/app/eiffel/output.go
+
4
−
8
View file @
9d0f67f0
...
...
@@ -76,17 +76,13 @@ func DirSearch(baseDir string, query string) ([]string, error) {
return
dirs
,
nil
}
// FileSearch searches
the base directory +
a specified sub
-path
for .csv-files containing the query string in their name.
// FileSearch searches a specified sub
directory
for .csv-files containing the query string in their name.
// Only files with the .csv-extension are considered. The search is case-insensitive. Returns a slice of matching files.
func
FileSearch
(
baseDir
string
,
sub
Path
string
,
query
string
)
([]
string
,
error
)
{
func
FileSearch
(
dir
Path
string
,
query
string
)
([]
string
,
error
)
{
var
files
[]
string
queryLower
:=
strings
.
ToLower
(
query
)
if
subPath
!=
""
{
subPath
=
filepath
.
Clean
(
subPath
)
}
err
:=
filepath
.
WalkDir
(
filepath
.
Join
(
baseDir
,
subPath
),
func
(
path
string
,
d
os
.
DirEntry
,
err
error
)
error
{
err
:=
filepath
.
WalkDir
(
dirPath
,
func
(
path
string
,
d
os
.
DirEntry
,
err
error
)
error
{
if
err
!=
nil
{
return
err
}
...
...
@@ -109,7 +105,7 @@ func FileSearch(baseDir string, subPath string, query string) ([]string, error)
return
nil
})
if
err
!=
nil
{
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
// ignore "file/dir does not exist" errors - the search might be submitted before the file/dir is created
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
src/app/eiffel/web.go
+
7
−
2
View file @
9d0f67f0
...
...
@@ -269,7 +269,7 @@ func parseRequirement(appCtx *hctx.AppCtx, webCtx *web.Ctx, cfg Cfg) http.Handle
templateID
:=
web
.
URLParam
(
request
,
"templateID"
)
variant
:=
web
.
URLParam
(
request
,
"variant"
)
outputDir
:=
BuildDirPath
(
cfg
.
Output
.
BaseDir
,
request
.
FormValue
(
"elicitationOutputDir"
))
outputFile
:=
BuildFilename
(
request
.
FormValue
(
"elicitationOutputFile"
)
)
outputFile
Raw
:=
request
.
FormValue
(
"elicitationOutputFile"
)
formData
,
err
:=
TemplateFormFromRequest
(
ctx
,
...
...
@@ -284,6 +284,11 @@ func parseRequirement(appCtx *hctx.AppCtx, webCtx *web.Ctx, cfg Cfg) http.Handle
return
io
.
InlineError
(
err
)
}
if
outputFileRaw
==
""
{
outputFileRaw
=
formData
.
Template
.
Name
}
outputFile
:=
BuildFilename
(
outputFileRaw
)
segmentMap
,
err
:=
SegmentMapFromRequest
(
request
,
len
(
formData
.
Variant
.
Rules
))
if
err
!=
nil
{
return
io
.
InlineError
(
web
.
ErrInternal
)
...
...
@@ -391,7 +396,7 @@ func outputFileSearch(appCtx *hctx.AppCtx, webCtx *web.Ctx, cfg Cfg) http.Handle
query
:=
request
.
FormValue
(
"output-file"
)
dir
:=
request
.
FormValue
(
"output-dir"
)
files
,
err
:=
FileSearch
(
cfg
.
Output
.
BaseDir
,
dir
,
query
)
files
,
err
:=
FileSearch
(
BuildDirPath
(
cfg
.
Output
.
BaseDir
,
dir
)
,
query
)
if
err
!=
nil
{
return
io
.
InlineError
(
web
.
ErrInternal
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
templates/eiffel/_elicitation-template.go.html
+
1
−
1
View file @
9d0f67f0
...
...
@@ -25,7 +25,7 @@
</div>
</div>
<div
class=
"accordion mt-
5
eiffel-elicitation-template-info"
id=
"eiffelTemplateInfoAccordion"
>
<div
class=
"accordion mt-
4
eiffel-elicitation-template-info"
id=
"eiffelTemplateInfoAccordion"
>
<div
class=
"accordion-item"
>
<h2
class=
"accordion-header"
id=
"headingConstruction"
>
<button
class=
"accordion-button"
type=
"button"
data-bs-toggle=
"collapse"
data-bs-target=
"#collapseConstruction"
aria-expanded=
"true"
aria-controls=
"collapseConstruction"
>
...
...
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