Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
74
Issues
74
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
9cee52de
Verified
Commit
9cee52de
authored
Sep 13, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export toLabelText to generate label names from e.g. record field names
parent
6227658d
Pipeline
#31285
passed with stage
in 6 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
Libraries/iTasks/UI/Layout/Common.dcl
Libraries/iTasks/UI/Layout/Common.dcl
+3
-0
Libraries/iTasks/UI/Layout/Common.icl
Libraries/iTasks/UI/Layout/Common.icl
+10
-11
No files found.
Libraries/iTasks/UI/Layout/Common.dcl
View file @
9cee52de
...
...
@@ -145,3 +145,6 @@ setActionIcon :: (Map String String) -> LayoutRule
* Format a basic editor as if it was a generic labelled iconized edtior
*/
toFormItem
::
LayoutRule
//* Format a string as a label (e.g., `firstName` -> `"First name"`)
toLabelText
::
!
String
->
String
Libraries/iTasks/UI/Layout/Common.icl
View file @
9cee52de
...
...
@@ -367,8 +367,7 @@ where
where
createLabelText
attr
=
textAttr
text
where
text
=
formatDefaultLabel
label
+++
(
if
(
enterOrUpdate
&&
not
optional
)
"*"
""
)
+++
":"
formatted
=
formatDefaultLabel
label
text
=
toLabelText
label
+++
(
if
(
enterOrUpdate
&&
not
optional
)
"*"
""
)
+++
":"
enterOrUpdate
=
maybe
False
(\(
JSONString
m
)
->
isMember
m
[
"enter"
,
"update"
])
('
DM
'.
get
"mode"
attr
)
optional
=
maybe
False
(\(
JSONBool
b
)
->
b
)
('
DM
'.
get
"optional"
attr
)
label
=
maybe
"-"
(\(
JSONString
s
)
->
s
)
('
DM
'.
get
"label"
attr
)
...
...
@@ -391,15 +390,15 @@ where
iconCls
=
maybe
"icon-info"
(\(
JSONString
t
)
->
"icon-"
+++
t
)
('
DM
'.
get
HINT_TYPE_ATTRIBUTE
attr
)
tooltip
=
maybe
"-"
(\(
JSONString
s
)
->
s
)
('
DM
'.
get
HINT_ATTRIBUTE
attr
)
formatDefaultLabel
label
=
{
c
\\
c
<-
[
toUpper
lname
:
addspace
lnames
]}
where
[
lname
:
lnames
]
=
fromString
label
addspace
[]
=
[]
addspace
[
c
:
cs
]
|
c
==
'_'
=
[
' '
:
addspace
cs
]
|
isUpper
c
=
[
' '
,
toLower
c
:
addspace
cs
]
|
otherwise
=
[
c
:
addspace
cs
]
removeLabelAttribute
=
layoutSubUIs
(
SelectAND
SelectChildren
(
SelectByHasAttribute
"label"
))
(
delUIAttributes
(
SelectKeys
[
"label"
]))
toLabelText
::
!
String
->
String
toLabelText
label
=
{
c
\\
c
<-
[
toUpper
lname
:
addspace
lnames
]}
where
[
lname
:
lnames
]
=
fromString
label
addspace
[]
=
[]
addspace
[
c
:
cs
]
|
c
==
'_'
=
[
' '
:
addspace
cs
]
|
isUpper
c
=
[
' '
,
toLower
c
:
addspace
cs
]
|
otherwise
=
[
c
:
addspace
cs
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment