1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

Testcase widget improve containment (#8529)

* testcase improve containment using navigator-widget

* testcase implement minimal edit new-tiddler interface
This commit is contained in:
Mario Pietsch 2024-08-20 17:29:16 +02:00 committed by GitHub
parent f10d4eb58d
commit b75fa58746
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 9 deletions

View File

@ -3,7 +3,7 @@ code-body: yes
\whitespace trim
\function tf.state() [<qualify "$:/state/testcase">]
\function tf.state() "$:/state/testcase"
\procedure linkcatcherActions()
<%if [<navigateTo>has[title]] %>
@ -102,9 +102,12 @@ code-body: yes
[all[tiddlers]sort[]] Output +[putfirst[]]
-Description
-Narrative
-[[$:/temp/testcase/draft-title]]
-[has[plugin-type]]
-[prefix<tf.state>]
-[prefix[$:/state/popup/export]]
-[prefix[$:/HistoryList]]
-[prefix[$:/StoryList]]
\end
\procedure testcase-source()
@ -129,13 +132,17 @@ code-body: yes
\procedure testcase-body()
<div class="tc-test-case-wrapper">
<<testcase-header>>
<%if [[Narrative]is[tiddler]] %>
<<testcase-narrative>>
<%endif%>
<%if [<testResult>match[fail]] %>
<<testcase-fail>>
<%endif%>
<<testcase-panes>>
<$let testcase-source-state = <<tf.state>>>
<$navigator story="$:/StoryList" history="$:/HistoryList">
<%if [[Narrative]is[tiddler]] %>
<<testcase-narrative>>
<%endif%>
<%if [<testResult>match[fail]] %>
<<testcase-fail>>
<%endif%>
<<testcase-panes>>
</$navigator>
</$let>
</div>
\end

View File

@ -1,6 +1,22 @@
title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
\whitespace trim
\procedure testcaseNewTitle() $:/temp/testcase/draft-title
\procedure saveActions()
<$action-setfield $tiddler=<<currentTab>> $field="draft.title" $value=<<newTitle>>/>
<$action-sendmessage $message="tm-save-tiddler" $param=<<title>> />
<$action-setfield $tiddler=<<testcase-source-state>> text=<<newTitle>>/>
<$action-deletetiddler $tiddler=<<testcaseNewTitle>>/>
\end
\procedure saveButton(title, newTitle)
<$button class="tc-btn-invisible tc-test-case-save-button tc-small-gap-left" actions=<<saveActions>> disabled={{{ [<testcaseNewTitle>!has[text]then[yes]] }}}>
{{$:/core/images/done-button}}
</$button>
\end
\procedure body()
<$list filter="[<currentTab>fields[]] -text +[limit[1]]" variable="ignore">
<table class="tc-field-table">
@ -11,7 +27,12 @@ title: $:/core/ui/testcases/DefaultTemplate/SourceTabs
<$text text=<<fieldName>>/>
</td>
<td>
<$view tiddler=<<currentTab>> field=<<fieldName>>/>
<%if [<fieldName>match[draft.title]] %>
<$edit-text class="tc-edit-texteditor tc-max-width-80" tiddler=<<testcaseNewTitle>> focus="yes" tag="input"/>
<$macrocall $name="saveButton" newTitle={{{ [<testcaseNewTitle>get[text]] }}} title=<<currentTab>>/>
<%else%>
<$view tiddler=<<currentTab>> field=<<fieldName>>/>
<%endif%>
</td>
</tr>
</$list>