Skip to content

Commit ca7e9b4

Browse files
committed
2 parents f98a2af + a7aaf0c commit ca7e9b4

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

Signum/DynamicQuery/ExpressionContainer.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,22 @@ public ExtensionWithParameterInfo<T, K, V> RegisterWithParameter<T, K, V>(
164164

165165
return ei;
166166
}
167+
168+
public ExtensionWithParameterInfo<T, K, V> RegisterWithParameter<T, K, V>(
169+
Enum message,
170+
Func<QueryToken, IEnumerable<K>> getKeys,
171+
Expression<Func<T, K, V>> extensionLambda,
172+
bool autoExpand = false)
173+
where K : notnull
174+
{
175+
var ei = new ExtensionWithParameterInfo<T, K, V>(extensionLambda, message.ToString(), ()=> message.NiceToString(), getKeys);
176+
177+
RegisteredExtensionsWithParameter.GetOrCreate(typeof(T)).Add(ei.Prefix, ei);
178+
179+
ei.AutoExpand = autoExpand;
180+
181+
return ei;
182+
}
167183
}
168184

169185
public interface IExtensionDictionaryInfo

Signum/React/SearchControl/Search.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ table.sf-search-results > thead {
2929
table.sf-search-results > tbody > tr > td {
3030
white-space: pre-wrap;
3131
vertical-align: middle;
32+
}
33+
34+
table.sf-search-results.sf-row-view > tbody > tr > td,
35+
div.sf-search-results.sf-row-view div.row-container {
3236
cursor: pointer;
3337
}
3438

Signum/React/SearchControl/SearchControlLoaded.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export class SearchControlLoaded extends React.Component<SearchControlLoadedProp
581581
<div ref={d => this.containerDiv = d}
582582
className="sf-scroll-table-container table-responsive"
583583
style={{ maxHeight: this.props.maxResultsHeight }}>
584-
<table className="sf-search-results table table-hover table-sm" onContextMenu={this.props.showContextMenu(this.props.findOptions) != false ? this.handleOnContextMenu : undefined}>
584+
<table className={classes("sf-search-results table table-hover table-sm", this.props.view && "sf-row-view")} onContextMenu={this.props.showContextMenu(this.props.findOptions) != false ? this.handleOnContextMenu : undefined}>
585585
<thead>
586586
{this.renderHeaders()}
587587
</thead>
@@ -603,7 +603,7 @@ export class SearchControlLoaded extends React.Component<SearchControlLoadedProp
603603
<div ref={d => this.containerDiv = d}
604604
className="sf-scroll-table-container"
605605
style={{ maxHeight: this.props.maxResultsHeight }}>
606-
<div className="sf-search-results mobile">
606+
<div className={classes("sf-search-results mobile", this.props.view && "sf-row-view")}>
607607
{this.renderRowsMobile()}
608608
</div>
609609
</div>
@@ -812,7 +812,7 @@ export class SearchControlLoaded extends React.Component<SearchControlLoadedProp
812812

813813
ev.preventDefault();
814814

815-
var findOptions = Finder.toFindOptions(this.props.findOptions, this.props.queryDescription, this.props.defaultIncudeDefaultFilters);
815+
const findOptions = Finder.toFindOptions(this.props.findOptions, this.props.queryDescription, this.props.defaultIncudeDefaultFilters || this.props.findOptions.filterOptions.some(a => a.pinned != null));
816816

817817
const path = Finder.findOptionsPath(findOptions, this.extraUrlParams);
818818

Signum/React/SearchControl/SearchMobile.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.row-container {
22
border: 1px solid silver;
3+
margin-bottom: 4px;
34
}
45

56
.row-data {
67
padding: 4px 8px;
8+
background-color: #fff;
79
}
810

911
.row-title {
@@ -15,7 +17,7 @@
1517
margin-right: 5px;
1618
}
1719

18-
.row-header {
20+
.row-data.row-header {
1921
background-color: #eee;
2022
}
2123

0 commit comments

Comments
 (0)