diff --git a/public/files/js/models/freqs/regular/freqForms.ts b/public/files/js/models/freqs/regular/freqForms.ts index b276997707..b7ff276748 100644 --- a/public/files/js/models/freqs/regular/freqForms.ts +++ b/public/files/js/models/freqs/regular/freqForms.ts @@ -265,6 +265,7 @@ export interface TTFreqFormModelState { fttattr:Array; flimit:Kontext.FormValue; freqSort:string; + isSubcorpusSelected:boolean; } export class TTFreqFormModel extends StatelessModel { @@ -279,6 +280,7 @@ export class TTFreqFormModel extends StatelessModel { fttattr: props.fttattr, flimit: {value: props.flimit, isInvalid: false, isRequired: true}, freqSort: props.freq_sort, + isSubcorpusSelected: !!pageModel.getCorpusIdent().usesubcorp } ); this.pageModel = pageModel; diff --git a/public/files/js/translations/messages.cs.json b/public/files/js/translations/messages.cs.json index 378f096899..012118037c 100644 --- a/public/files/js/translations/messages.cs.json +++ b/public/files/js/translations/messages.cs.json @@ -765,6 +765,7 @@ "freq__align_type_right": "slova KWIC nejvíce vpravo", "freq__move_level_up": "Posunout nahoru", "freq__move_level_down": "Posunout dolů", + "freq__warn_about_zero_freq_vs_subc": "Je-li používán subkorpus, při nulovém limitu se zobrazí všechny dostupné hodnoty z celého korpusu.", "freq__ml_th_level": "Úroveň", "freq__ml_th_attribute": "Atribut", "freq__ml_th_icase": "Nerozlišovat velikost", diff --git a/public/files/js/translations/messages.en.json b/public/files/js/translations/messages.en.json index 905a1bf5ef..4dc720b020 100644 --- a/public/files/js/translations/messages.en.json +++ b/public/files/js/translations/messages.en.json @@ -766,6 +766,7 @@ "freq__align_type_right": "rightmost KWIC word", "freq__move_level_up": "Move upwards", "freq__move_level_down": "Move downwards", + "freq__warn_about_zero_freq_vs_subc": "If a subcorpus is used, all available values from the entire corpus are displayed when the limit is zero.", "freq__ml_th_level": "Level", "freq__ml_th_attribute": "Attribute", "freq__ml_th_icase": "Ignore case", diff --git a/public/files/js/translations/messages.sl.json b/public/files/js/translations/messages.sl.json index 16878ff43b..c53e9b40ba 100644 --- a/public/files/js/translations/messages.sl.json +++ b/public/files/js/translations/messages.sl.json @@ -750,6 +750,7 @@ "freq__align_type_right": "skrajna desna beseda KWIC", "freq__move_level_up": "Premakni navzgor", "freq__move_level_down": "Premakni navzdol", + "freq__warn_about_zero_freq_vs_subc": "If a subcorpus is used, all available values from the entire corpus are displayed when the limit is zero. UNTRANSLATED", "freq__ml_th_level": "Stopnja", "freq__ml_th_attribute": "Atribut", "freq__ml_th_icase": "Ne ločuj malih/velikih črk", diff --git a/public/files/js/translations/messages.szl.json b/public/files/js/translations/messages.szl.json index 3bae5c53fb..cadd8d9073 100644 --- a/public/files/js/translations/messages.szl.json +++ b/public/files/js/translations/messages.szl.json @@ -764,6 +764,7 @@ "freq__align_type_right": "słowo KWIC nojdalsze w prawo", "freq__move_level_up": "Przeniyś wyżyj", "freq__move_level_down": "Przeniyś niżyj", + "freq__warn_about_zero_freq_vs_subc": "If a subcorpus is used, all available values from the entire corpus are displayed when the limit is zero. UNTRANSLATED", "freq__ml_th_level": "Poziōm", "freq__ml_th_attribute": "Atrybut", "freq__ml_th_icase": "Wielkośc liter bez znaczyniŏ", diff --git a/public/files/js/views/freqs/regular/freqForms.tsx b/public/files/js/views/freqs/regular/freqForms.tsx index 5f93134614..44e916d93e 100644 --- a/public/files/js/views/freqs/regular/freqForms.tsx +++ b/public/files/js/views/freqs/regular/freqForms.tsx @@ -184,6 +184,18 @@ export function init( + { + props.isSubcorpusSelected && props.flimit.value === '0' ? + + +
+ +

{he.translate('freq__warn_about_zero_freq_vs_subc')}

+
+ + : + null + } @@ -423,87 +435,80 @@ export function init( // ---------------------- --------------------- - class MLFreqForm extends React.Component { + const MLFreqForm:React.FC = (props) => { - constructor(props) { - super(props); - this._handleAddLevelClick = this._handleAddLevelClick.bind(this); - } - - _handleAddLevelClick() { + const _handleAddLevelClick = () => { dispatcher.dispatch({ name: Actions.MLAddLevel.name, payload: {} }); } - render() { - const levels = List.map((_, i) => i, this.props.mlxattr); - return ( - - - - - - - - - - - ); - } + const levels = List.map((_, i) => i, props.mlxattr); + return ( + + + + + + + + + + + ); } return { diff --git a/public/files/js/views/freqs/regular/style.tsx b/public/files/js/views/freqs/regular/style.tsx index cb9d8d5821..9a4ce99530 100644 --- a/public/files/js/views/freqs/regular/style.tsx +++ b/public/files/js/views/freqs/regular/style.tsx @@ -311,6 +311,17 @@ export const TTFreqForm = styled.div` } } + + .zero-val-note { + display: flex; + align-items: center; + + p { + flex-grow: 1; + color: ${theme.colorLightText}; + padding-left: 1em; + } + } } `;
- - -
- - - - - - - - - - {levels.map(item => { - return 0 || levels.length > 1} - numLevels={levels.length} - levelIdx={item} - attrList={this.props.attrList} - mlxAttrValue={this.props.mlxattr[item]} - mlxicaseValue={this.props.mlxicase[item]} - positionRangeLabels={mlFreqFormModel.getPositionRangeLabels()} - mlxctxIndex={this.props.mlxctxIndices[item]} - alignType={this.props.alignType[item]} />; - })} - {levels.length < this.props.maxNumLevels ? - ( - - ) - : null} - -
- {he.translate('freq__ml_th_level')} - - {he.translate('freq__ml_th_attribute')} - - {he.translate('freq__ml_th_icase')} - - {he.translate('freq__ml_th_position')} - - {he.translate('freq__ml_th_node_start_at')} - - -
- - -
-
+ + +
+ + + + + + + + + + {levels.map(item => { + return 0 || levels.length > 1} + numLevels={levels.length} + levelIdx={item} + attrList={props.attrList} + mlxAttrValue={props.mlxattr[item]} + mlxicaseValue={props.mlxicase[item]} + positionRangeLabels={mlFreqFormModel.getPositionRangeLabels()} + mlxctxIndex={props.mlxctxIndices[item]} + alignType={props.alignType[item]} />; + })} + {levels.length < props.maxNumLevels ? + ( + + ) + : null} + +
+ {he.translate('freq__ml_th_level')} + + {he.translate('freq__ml_th_attribute')} + + {he.translate('freq__ml_th_icase')} + + {he.translate('freq__ml_th_position')} + + {he.translate('freq__ml_th_node_start_at')} + + +
+ + +
+