<commit_before>﻿import * as React from 'react'
import { UserQueryEntity, UserQueryMessage, QueryFilterEmbedded, QueryOrderEmbedded, QueryColumnEmbedded } from '../Signum.Entities.UserQueries'
import { FormGroup, FormControlStatic, ValueLine, ValueLineType, EntityLine, EntityCombo, EntityList, EntityRepeater, EntityTable } from '../../../../Framework/Signum.React/Scripts/Lines'
import * as Finder from '../../../../Framework/Signum.React/Scripts/Finder'
import { QueryDescription, SubTokensOptions } from '../../../../Framework/Signum.React/Scripts/FindOptions'
import { getQueryNiceName } from '../../../../Framework/Signum.React/Scripts/Reflection'
import { TypeContext, FormGroupStyle } from '../../../../Framework/Signum.React/Scripts/TypeContext'
import QueryTokenEntityBuilder from '../../UserAssets/Templates/QueryTokenEntityBuilder'

const CurrentEntityKey = "[CurrentEntity]";
export default class UserQuery extends React.Component<{ ctx: TypeContext<UserQueryEntity> }> {

    render() {

        const query = this.props.ctx.value.query;
        const ctx = this.props.ctx;

        return (
            <div>
                <EntityLine ctx={ctx.subCtx(e => e.owner)} />
                <ValueLine ctx={ctx.subCtx(e => e.displayName)} />
                <FormGroup ctx={ctx.subCtx(e => e.query)}>
                    {
                        query && (
                            Finder.isFindable(query.key, true) ?
                                <a className="form-control-static" href={Finder.findOptionsPath({ queryName: query.key })}>{getQueryNiceName(query.key)}</a> :
                                <span>{getQueryNiceName(query.key)}</span>)
                    }
                </FormGroup>

                {query &&
                    <div>
                        <EntityLine ctx={ctx.subCtx(e => e.entityType)} onChange={() => this.forceUpdate()} />
                        {
                            this.props.ctx.value.entityType &&
                            <p className="messageEntity col-sm-offset-2">
                                {UserQueryMessage.Use0ToFilterCurrentEntity.niceToString(CurrentEntityKey)}
                            </p>
                        }
                        <ValueLine ctx={ctx.subCtx(e => e.withoutFilters)} />
                        <div className="form-xs">
                            <EntityTable ctx={ctx.subCtx(e => e.filters)} columns={EntityTable.typedColumns<QueryFilterEmbedded>([
                                {
                                    property: a => a.token, template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "None" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />,
                                    headerHtmlAttributes: { style: { width: "40%" } },
                                },
                                { property: a => a.operation },
                                { property: a => a.valueString, headerHtmlAttributes: { style: { width: "40%" } } }
                            ])} />
                            <ValueLine ctx={ctx.subCtx(e => e.columnsMode)} />
                            <EntityTable ctx={ctx.subCtx(e => e.columns)} columns={EntityTable.typedColumns<QueryColumnEmbedded>([
                                {
                                    property: a => a.token, template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "None" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />
                                },
                                { property: a => a.displayName }
                            ])} />
                            <EntityTable ctx={ctx.subCtx(e => e.orders)} columns={EntityTable.typedColumns<QueryOrderEmbedded>([
                                {
                                    property: a => a.token, template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "None" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />
                                },
                                { property: a => a.orderType }
                            ])} />
                        </div>
                        <div className="row">
                            <div className="col-sm-6">
                                <ValueLine ctx={ctx.subCtx(e => e.paginationMode, { labelColumns: { sm: 4 } })} />
                            </div>
                            <div className="col-sm-6">
                                <ValueLine ctx={ctx.subCtx(e => e.elementsPerPage, { labelColumns: { sm: 4 } })} />
                            </div>
                        </div>
                    </div>
                }
            </div>
        );
    }
}

<commit_msg>use extra small size group size in user query.<commit_after>﻿import * as React from 'react'
import { UserQueryEntity, UserQueryMessage, QueryFilterEmbedded, QueryOrderEmbedded, QueryColumnEmbedded } from '../Signum.Entities.UserQueries'
import { FormGroup, FormControlStatic, ValueLine, ValueLineType, EntityLine, EntityCombo, EntityList, EntityRepeater, EntityTable } from '../../../../Framework/Signum.React/Scripts/Lines'
import * as Finder from '../../../../Framework/Signum.React/Scripts/Finder'
import { QueryDescription, SubTokensOptions } from '../../../../Framework/Signum.React/Scripts/FindOptions'
import { getQueryNiceName } from '../../../../Framework/Signum.React/Scripts/Reflection'
import { TypeContext, FormGroupStyle } from '../../../../Framework/Signum.React/Scripts/TypeContext'
import QueryTokenEntityBuilder from '../../UserAssets/Templates/QueryTokenEntityBuilder'

const CurrentEntityKey = "[CurrentEntity]";
export default class UserQuery extends React.Component<{ ctx: TypeContext<UserQueryEntity> }> {

    render() {

        const query = this.props.ctx.value.query;
        const ctx = this.props.ctx;
        const ctxxs = ctx.subCtx({ formGroupSize: "ExtraSmall" });

        return (
            <div>
                <EntityLine ctx={ctx.subCtx(e => e.owner)} />
                <ValueLine ctx={ctx.subCtx(e => e.displayName)} />
                <FormGroup ctx={ctx.subCtx(e => e.query)}>
                    {
                        query && (
                            Finder.isFindable(query.key, true) ?
                                <a className="form-control-static" href={Finder.findOptionsPath({ queryName: query.key })}>{getQueryNiceName(query.key)}</a> :
                                <span>{getQueryNiceName(query.key)}</span>)
                    }
                </FormGroup>

                {query &&
                    (<div>
                        <EntityLine ctx={ctx.subCtx(e => e.entityType)} onChange={() => this.forceUpdate()} />
                        {
                            this.props.ctx.value.entityType &&
                            <p className="messageEntity col-sm-offset-2">
                                {UserQueryMessage.Use0ToFilterCurrentEntity.niceToString(CurrentEntityKey)}
                            </p>
                        }
                        <ValueLine ctx={ctx.subCtx(e => e.withoutFilters)} />
                        <div>
                            <EntityTable ctx={ctxxs.subCtx(e => e.filters)} columns={EntityTable.typedColumns<QueryFilterEmbedded>([
                                {
                                    property: a => a.token,
                                    template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "SrOnly" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />,
                                    headerHtmlAttributes: { style: { width: "40%" } },
                                },
                                { property: a => a.operation },
                                { property: a => a.valueString, headerHtmlAttributes: { style: { width: "40%" } } }
                            ])} />
                            <ValueLine ctx={ctxxs.subCtx(e => e.columnsMode)} />
                            <EntityTable ctx={ctxxs.subCtx(e => e.columns)} columns={EntityTable.typedColumns<QueryColumnEmbedded>([
                                {
                                    property: a => a.token,
                                    template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "SrOnly" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />
                                },
                                { property: a => a.displayName }
                            ])} />
                            <EntityTable ctx={ctxxs.subCtx(e => e.orders)} columns={EntityTable.typedColumns<QueryOrderEmbedded>([
                                {
                                    property: a => a.token,
                                    template: ctx => <QueryTokenEntityBuilder
                                        ctx={ctx.subCtx(a => a.token, { formGroupStyle: "SrOnly" })}
                                        queryKey={this.props.ctx.value.query!.key}
                                        subTokenOptions={SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement} />
                                },
                                { property: a => a.orderType }
                            ])} />
                        </div>
                        <div className="row">
                            <div className="col-sm-6">
                                <ValueLine ctx={ctxxs.subCtx(e => e.paginationMode, { labelColumns: { sm: 4 } })} />
                            </div>
                            <div className="col-sm-6">
                                <ValueLine ctx={ctxxs.subCtx(e => e.elementsPerPage, { labelColumns: { sm: 4 } })} />
                            </div>
                        </div>
                    </div>)
                }
            </div>
        );
    }
}


{'fraction_non_alphanumeric': 0.12082053135731068, 'fraction_numerical': 0.0018073377914332189, 'mean_word_length': 1.1759732599292174, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 39, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '934701', 'n_tokens_mistral': 2674, 'n_tokens_neox': 2586, 'n_words': 420}