+68
-12
lines changedFilter options
+68
-12
lines changed Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ public class PanelPartEmbedded : EmbeddedEntity, IGridEntity
34
34
[NumberBetweenValidator(1, 12)]
35
35
public int Columns { get; set; }
36
36
37
+
public InteractionGroup? InteractionGroup { get; set; }
38
+
37
39
public BootstrapStyle Style { get; set; }
38
40
39
41
[ImplementedBy(
@@ -91,6 +93,7 @@ internal XElement ToXml(IToXmlContext ctx)
91
93
Title == null ? null! : new XAttribute("Title", Title),
92
94
IconName == null ? null! : new XAttribute("IconName", IconName),
93
95
IconColor == null ? null! : new XAttribute("IconColor", IconColor),
96
+
InteractionGroup == null ? null! : new XAttribute("InteractionGroup", InteractionGroup),
94
97
new XAttribute("Style", Style),
95
98
Content.ToXml(ctx));
96
99
}
@@ -103,7 +106,8 @@ internal void FromXml(XElement x, IFromXmlContext ctx)
103
106
Title = x.Attribute("Title")?.Value;
104
107
IconName = x.Attribute("IconName")?.Value;
105
108
IconColor = x.Attribute("IconColor")?.Value;
106
-
Style = (BootstrapStyle)(x.Attribute("Style")?.Let(a => Enum.Parse(typeof(BootstrapStyle), a.Value)) ?? BootstrapStyle.Light);
109
+
Style = x.Attribute("Style")?.Value.TryToEnum<BootstrapStyle>() ?? BootstrapStyle.Light;
110
+
InteractionGroup = x.Attribute("InteractionGroup")?.Value.ToEnum<InteractionGroup>();
107
111
Content = ctx.GetPart(Content, x.Elements().Single());
108
112
}
109
113
@@ -113,8 +117,6 @@ internal Interval<int> ColumnInterval()
113
117
}
114
118
}
115
119
116
-
117
-
118
120
public interface IGridEntity
119
121
{
120
122
int Row { get; set; }
@@ -185,6 +187,17 @@ public void FromXml(XElement element, IFromXmlContext ctx)
185
187
}
186
188
}
187
189
190
+
public enum InteractionGroup
191
+
{
192
+
Group1,
193
+
Group2,
194
+
Group3,
195
+
Group4,
196
+
Group5,
197
+
Group6,
198
+
Group7,
199
+
Group8,
200
+
}
188
201
public enum UserQueryPartRenderMode
189
202
{
190
203
SearchControl,
Original file line number Diff line number Diff line change
@@ -28,7 +28,8 @@ export function ColorTypeaheadLine(p : { ctx: TypeContext<string | null | undefi
28
28
<FormGroup ctx={ctx} labelText={ctx.niceName()} >
29
29
<ColorTypeahead color={ctx.value}
30
30
formControlClass={ctx.formControlClass}
31
-
onChange={handleOnChange} />
31
+
onChange={handleOnChange}
32
+
placeholder={p.ctx.placeholderLabels ? p.ctx.niceName() : undefined} />
32
33
</FormGroup>
33
34
);
34
35
}
@@ -37,6 +38,7 @@ interface ColorTypeaheadProps {
37
38
color: string | null | undefined;
38
39
onChange: (newColor: string | null | undefined) => void;
39
40
formControlClass: string | undefined;
41
+
placeholder?: string;
40
42
}
41
43
42
44
export function ColorTypeahead(p : ColorTypeaheadProps){
@@ -79,7 +81,7 @@ export function ColorTypeahead(p : ColorTypeaheadProps){
79
81
return (
80
82
<Typeahead
81
83
value={p.color ?? ""}
82
-
inputAttrs={{ className: classes(p.formControlClass, "sf-entity-autocomplete") }}
84
+
inputAttrs={{ className: classes(p.formControlClass, "sf-entity-autocomplete"), placeholder: p.placeholder }}
83
85
getItems={handleGetItems}
84
86
onSelect={handleSelect}
85
87
onChange={handleSelect}
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ export function IconTypeaheadLine(p : IconTypeaheadLineProps){
30
30
return (
31
31
<FormGroup ctx={ctx} labelText={ctx.niceName()} >
32
32
<IconTypeahead icon={ctx.value}
33
+
placeholder={p.ctx.placeholderLabels ? p.ctx.niceName() : undefined}
33
34
extraIcons={p.extraIcons}
34
35
formControlClass={ctx.formControlClass}
35
36
onChange={handleChange} />
@@ -42,6 +43,7 @@ export interface IconTypeaheadProps {
42
43
onChange: (newIcon: string | null | undefined) => void;
43
44
extraIcons?: string[];
44
45
formControlClass: string | undefined;
46
+
placeholder?: string;
45
47
}
46
48
47
49
export function IconTypeahead(p: IconTypeaheadProps) {
@@ -90,7 +92,7 @@ export function IconTypeahead(p: IconTypeaheadProps) {
90
92
return (
91
93
<Typeahead
92
94
value={(p.icon ?? "")}
93
-
inputAttrs={{ className: classes(p.formControlClass, "sf-entity-autocomplete") }}
95
+
inputAttrs={{ className: classes(p.formControlClass, "sf-entity-autocomplete"), placeholder: p.placeholder }}
94
96
getItems={handleGetItems}
95
97
onSelect={handleSelect}
96
98
onChange={handleSelect}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1
1
2
2
import * as React from 'react'
3
3
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
4
-
import { ValueLine, EntityLine, RenderEntity } from '@framework/Lines'
4
+
import { ValueLine, EntityLine, RenderEntity, OptionItem } from '@framework/Lines'
5
5
import { tryGetTypeInfos, New, getTypeInfos } from '@framework/Reflection'
6
6
import SelectorModal from '@framework/SelectorModal'
7
7
import { TypeContext } from '@framework/TypeContext'
@@ -13,6 +13,7 @@ import { ColorTypeaheadLine } from "../../Basics/Templates/ColorTypeahead";
13
13
import "../Dashboard.css"
14
14
import { getToString } from '@framework/Signum.Entities';
15
15
import { useForceUpdate } from '@framework/Hooks'
16
+
import { softCast } from '../../../Signum.React/Scripts/Globals';
16
17
17
18
export default function Dashboard(p : { ctx: TypeContext<DashboardEntity> }){
18
19
const forceUpdate = useForceUpdate();
@@ -45,6 +46,7 @@ export default function Dashboard(p : { ctx: TypeContext<DashboardEntity> }){
45
46
});
46
47
}
47
48
49
+
var colors = ["#DFFF00", "#FFBF00", "#FF7F50", "#DE3163", "#9FE2BF", "#40E0D0", "#6495ED", "#CCCCFF"]
48
50
49
51
function renderPart(tc: TypeContext<PanelPartEmbedded>) {
50
52
const tcs = tc.subCtx({ formGroupStyle: "SrOnly", formSize: "ExtraSmall", placeholderLabels: true });
@@ -56,7 +58,17 @@ export default function Dashboard(p : { ctx: TypeContext<DashboardEntity> }){
56
58
<div className="d-flex">
57
59
{icon && <div className="mx-2"><FontAwesomeIcon icon={icon} style={{ color: tc.value.iconColor ?? undefined, fontSize: "25px", marginTop: "17px" }} /> </div>}
58
60
<div style={{ flexGrow: 1 }} className="mr-2">
59
-
<ValueLine ctx={tcs.subCtx(pp => pp.title)} labelText={getToString(tcs.value.content) ?? tcs.niceName(pp => pp.title)} />
61
+
62
+
<div className="row">
63
+
<div className="col-sm-8">
64
+
<ValueLine ctx={tcs.subCtx(pp => pp.title)} labelText={getToString(tcs.value.content) ?? tcs.niceName(pp => pp.title)} />
65
+
</div>
66
+
<div className="col-sm-4">
67
+
<ValueLine ctx={tcs.subCtx(pp => pp.interactionGroup)}
68
+
optionItems={colors.map((c, i) => ({ label: "Group " + (i + 1), value: "Group" + (i + 1), color: c }))} onRenderDropDownListItem={(io) => <span><span className="sf-dot" style={{ backgroundColor: (io as any).color }} />{io.label}</span>} />
69
+
</div>
70
+
</div>
71
+
60
72
<div className="row">
61
73
<div className="col-sm-4">
62
74
<ValueLine ctx={tcs.subCtx(pp => pp.style)} onChange={() => forceUpdate()} />
Original file line number Diff line number Diff line change
@@ -99,3 +99,11 @@ div.row-control-panel {
99
99
font-size: 1rem;
100
100
margin-left: 2px;
101
101
}
102
+
103
+
.sf-dot {
104
+
height: 15px;
105
+
width: 15px;
106
+
border-radius: 50%;
107
+
display: inline-block;
108
+
margin-right: 5px;
109
+
}
Original file line number Diff line number Diff line change
@@ -65,6 +65,17 @@ export module DashboardPermission {
65
65
export const ViewDashboard : Authorization.PermissionSymbol = registerSymbol("Permission", "DashboardPermission.ViewDashboard");
66
66
}
67
67
68
+
export const InteractionGroup = new EnumType<InteractionGroup>("InteractionGroup");
69
+
export type InteractionGroup =
70
+
"Group1" |
71
+
"Group2" |
72
+
"Group3" |
73
+
"Group4" |
74
+
"Group5" |
75
+
"Group6" |
76
+
"Group7" |
77
+
"Group8";
78
+
68
79
export interface IPartEntity extends Entities.Entity {
69
80
requiresTitle: boolean;
70
81
}
@@ -92,6 +103,7 @@ export interface PanelPartEmbedded extends Entities.EmbeddedEntity {
92
103
row: number;
93
104
startColumn: number;
94
105
columns: number;
106
+
interactionGroup: InteractionGroup | null;
95
107
style: Signum.BootstrapStyle;
96
108
content: IPartEntity;
97
109
}
Original file line number Diff line number Diff line change
@@ -35,7 +35,11 @@ export class DashboardFilterController {
35
35
}
36
36
37
37
getFilterOptions(partEmbedded: PanelPartEmbedded, queryKey: string): FilterOptionParsed[] {
38
-
var otherFilters = Array.from(this.filters.values()).filter(f => f.partEmbedded != partEmbedded && f.rows?.length);
38
+
39
+
if (partEmbedded.interactionGroup == null)
40
+
return [];
41
+
42
+
var otherFilters = Array.from(this.filters.values()).filter(f => f.partEmbedded != partEmbedded && f.partEmbedded.interactionGroup == partEmbedded.interactionGroup && f.rows?.length);
39
43
40
44
var result = otherFilters.filter(a => a.queryKey == queryKey).map(
41
45
df => groupFilter("Or", df.rows.map(
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ export default function UserChartPart(p: PanelPartContentProps<UserChartPartEnti
119
119
dashboardFilter={p.filterController.filters.get(p.partEmbedded)}
120
120
onDrillDown={(row, e) => {
121
121
e.stopPropagation();
122
-
if (e.altKey)
122
+
if (e.altKey || p.partEmbedded.interactionGroup == null)
123
123
handleDrillDown(row, e, chartRequest, handleReload);
124
124
else {
125
125
const dashboardFilter = p.filterController.filters.get(p.partEmbedded);
Original file line number Diff line number Diff line change
@@ -326,10 +326,12 @@ input[type=checkbox].form-control-xs {
326
326
margin-bottom: 0px;
327
327
}
328
328
329
+
.form-control-xs .rw-widget-input,
329
330
.rw-widget-xs .rw-widget-input {
330
331
min-height: 24px;
331
332
}
332
333
334
+
.form-control-xs .rw-dropdown-list-input,
333
335
.rw-widget-xs .rw-dropdown-list-input,
334
336
.rw-widget-xs .rw-combobox-input {
335
337
padding: 0 0.4em;
@@ -339,6 +341,7 @@ input[type=checkbox].form-control-xs {
339
341
padding: 0px;
340
342
}
341
343
344
+
.form-control-xs .rw-widget-picker,
342
345
.rw-widget-xs .rw-widget-picker {
343
346
min-height: 24px;
344
347
}
Original file line number Diff line number Diff line change
@@ -314,7 +314,7 @@ function internalDropDownList(vl: ValueLineController) {
314
314
}
315
315
316
316
return (
317
-
<FormGroup ctx={s.ctx} labelText={s.labelText} helpText={s.helpText} htmlAttributes={{ ...vl.baseHtmlAttributes(), ...s.formGroupHtmlAttributes }} labelHtmlAttributes={s.labelHtmlAttributes}>
317
+
<FormGroup ctx={s.ctx} labelText={s.labelText} helpText={s.helpText} htmlAttributes={{ ...vl.baseHtmlAttributes(), ...s.formGroupHtmlAttributes}} labelHtmlAttributes={s.labelHtmlAttributes}>
318
318
{vl.withItemGroup(
319
319
<FormControlReadonly htmlAttributes={{
320
320
...vl.props.valueHtmlAttributes,
@@ -343,7 +343,7 @@ function internalDropDownList(vl: ValueLineController) {
343
343
return (
344
344
<FormGroup ctx={s.ctx} labelText={s.labelText} helpText={s.helpText} htmlAttributes={{ ...vl.baseHtmlAttributes(), ...s.formGroupHtmlAttributes }} labelHtmlAttributes={s.labelHtmlAttributes}>
345
345
{vl.withItemGroup(
346
-
<DropdownList className={addClass(vl.props.valueHtmlAttributes, classes(s.ctx.formControlClass, vl.mandatoryClass))} data={optionItems} onChange={handleOptionItem} value={oi}
346
+
<DropdownList className={addClass(vl.props.valueHtmlAttributes, classes(s.ctx.formControlClass, vl.mandatoryClass, "p-0"))} data={optionItems} onChange={handleOptionItem} value={oi}
347
347
filter={false}
348
348
autoComplete="off"
349
349
dataKey="value"
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4