diff --git a/lib/action/argmapping/user.py b/lib/action/argmapping/user.py index cf2b8a80fe..94fca35b8f 100644 --- a/lib/action/argmapping/user.py +++ b/lib/action/argmapping/user.py @@ -18,11 +18,14 @@ class FullSearchArgs: name: str any_property_value: str + any_property_value_is_sub: bool posattr_name: str posattr_value: str + posattr_value_is_sub: bool structure_name: str structattr_name: str structattr_value: str + structattr_value_is_sub: bool corpus: str subcorpus: str wl_pat: str diff --git a/lib/plugins/ucnk_query_history/__init__.py b/lib/plugins/ucnk_query_history/__init__.py index e8237849cd..d932663734 100644 --- a/lib/plugins/ucnk_query_history/__init__.py +++ b/lib/plugins/ucnk_query_history/__init__.py @@ -157,7 +157,7 @@ def _generate_query_string( if q_supertype: parts.append(make_bleve_field('query_supertype', q_supertype)) - + if full_search_args.name: parts.append(make_bleve_field('name', full_search_args.name)) @@ -168,18 +168,29 @@ def _generate_query_string( parts.append(make_bleve_field('subcorpus', full_search_args.subcorpus)) if full_search_args.any_property_value: - parts.append(make_bleve_field('_all', full_search_args.any_property_value)) - + parts.append(make_bleve_field( + '_all', + full_search_args.any_property_value, + use_wildcard=full_search_args.any_property_value_is_sub)) else: if q_supertype in ('conc', 'pquery'): if full_search_args.posattr_name: parts.append(make_bleve_field('pos_attr_names', full_search_args.posattr_name)) if full_search_args.posattr_value: - parts.append(make_bleve_field('pos_attr_values', full_search_args.posattr_value)) + parts.append( + make_bleve_field( + 'pos_attr_values', + full_search_args.posattr_value, + use_wildcard=full_search_args.posattr_value_is_sub)) if full_search_args.structattr_name: - parts.append(make_bleve_field('struct_attr_names', full_search_args.structattr_name)) + parts.append( + make_bleve_field('struct_attr_names', full_search_args.structattr_name)) if full_search_args.structattr_value: - parts.append(make_bleve_field('struct_attr_values', full_search_args.structattr_value)) + parts.append( + make_bleve_field( + 'struct_attr_values', + full_search_args.structattr_value, + use_wildcard=full_search_args.structattr_value_is_sub)) elif q_supertype == 'wlist': if full_search_args.wl_pat: diff --git a/lib/views/user.py b/lib/views/user.py index 7be68d5e7c..18b7d5c0d0 100644 --- a/lib/views/user.py +++ b/lib/views/user.py @@ -222,19 +222,22 @@ async def ajax_query_history(amodel: UserActionModel, req: KRequest, resp: KResp extended_search = bool(int(req.args.get('extended_search', '0'))) full_search_args = FullSearchArgs( - req.args.get('fsArchivedAs', None), - req.args.get('fsAnyPropertyValue', None), - req.args.get('fsPosattrName', None), - req.args.get('fsPosattrValue', None), - req.args.get('fsStructureName', None), - req.args.get('fsStructattrName', None), - req.args.get('fsStructattrValue', None), - req.args.get('fsCorpus', None), - req.args.get('fsSubcorpus', None), - req.args.get('fsWlpat', None), - req.args.get('fsWattr', None), - req.args.get('fsWlPfilter', None), - req.args.get('fsWlNfilter', None), + name=req.args.get('fsArchivedAs', None), + any_property_value=req.args.get('fsAnyPropertyValue', None), + any_property_value_is_sub=req.args.get('fsAnyPropertyValueIsSub', '0') == '1', + posattr_name=req.args.get('fsPosattrName', None), + posattr_value=req.args.get('fsPosattrValue', None), + posattr_value_is_sub=req.args.get('fsPosattrValueIsSub', '0' == '1'), + structure_name=req.args.get('fsStructureName', None), + structattr_name=req.args.get('fsStructattrName', None), + structattr_value=req.args.get('fsStructattrValue', None), + structattr_value_is_sub=req.args.get('fsStructattrValueIsSub', '0') == '1', + corpus=req.args.get('fsCorpus', None), + subcorpus=req.args.get('fsSubcorpus', None), + wl_pat=req.args.get('fsWlpat', None), + wl_attr=req.args.get('fsWattr', None), + wl_pfilter=req.args.get('fsWlPfilter', None), + wl_nfilter=req.args.get('fsWlNfilter', None), ) rows = await _load_query_history( diff --git a/public/files/img/back-button.svg b/public/files/img/back-button.svg new file mode 100644 index 0000000000..2fe58b552f --- /dev/null +++ b/public/files/img/back-button.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/files/img/back-button_s.svg b/public/files/img/back-button_s.svg new file mode 100644 index 0000000000..3a1bd46446 --- /dev/null +++ b/public/files/img/back-button_s.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/files/img/fs_help.svg b/public/files/img/fs_help.svg new file mode 100644 index 0000000000..2f41a7d754 --- /dev/null +++ b/public/files/img/fs_help.svg @@ -0,0 +1,212 @@ + + + + + + + + + + [word="de.*" & tag="N.*"] within <doc txtype_group="FIC: beletrie" /> + + + + + + + + + A + C + D + A + B + B + E + + diff --git a/public/files/js/models/searchHistory/actions.ts b/public/files/js/models/searchHistory/actions.ts index fef717b1f8..8d8112d0b7 100644 --- a/public/files/js/models/searchHistory/actions.ts +++ b/public/files/js/models/searchHistory/actions.ts @@ -141,6 +141,12 @@ export class Actions { name: 'QUERY_HISTORY_SET_FS_POSATTR_VALUE' }; + static SetFsPosattrValueIsSub:Action<{ + value:boolean; + }> = { + name: 'QUERY_HISTORY_SET_FS_POSATTR_VALUE_IS_SUB' + }; + static SetFsStructureName:Action<{ value:string; }> = { @@ -159,12 +165,24 @@ export class Actions { name: 'QUERY_HISTORY_SET_FS_STRUCTATTR_VALUE' }; + static SetFsStructattrValueIsSub:Action<{ + value:boolean; + }> = { + name: 'QUERY_HISTORY_SET_FS_STRUCTATTR_VALUE_IS_SUB' + }; + static SetFsAnyPropertyValue:Action<{ value:string; }> = { name: 'QUERY_HISTORY_SET_FS_ANY_PROPERTY_VALUE' }; + static SetFsAnyPropertyValueIsSub:Action<{ + value:boolean; + }> = { + name: 'QUERY_HISTORY_SET_FS_ANY_PROPERTY_VALUE_IS_SUB' + }; + static SetFsAdvancedQuery:Action<{ value:boolean; }> = { @@ -212,4 +230,9 @@ export class Actions { name: 'QUERY_HISTORY_SUBMIT_EXTENDED_SEARCH' }; + static ToggleHelpView:Action<{ + }> = { + name: 'QUERY_HISTORY_TOGGLE_HELP_VIEW' + }; + } diff --git a/public/files/js/models/searchHistory/common.ts b/public/files/js/models/searchHistory/common.ts index 4b5a65b733..327bafaed0 100644 --- a/public/files/js/models/searchHistory/common.ts +++ b/public/files/js/models/searchHistory/common.ts @@ -142,9 +142,11 @@ export interface GetHistoryArgs { extended_search:boolean; fsPosattrName?:string; fsPosattrValue?:string; + fsPosattrValueIsSub?:boolean; fsStructureName?:string; fsStructattrName?:string; fsStructattrValue?:string; + fsStructattrValueIsSub?:boolean; fsCorpus?:string; fsSubcorpus?:string; fsArchivedAs?:string; @@ -153,6 +155,7 @@ export interface GetHistoryArgs { fsWlPfilter?:string; fsWlNfilter?:string; fsAnyPropertyValue?:string; + fsAnyPropertyValueIsSub?:boolean; } export interface GetHistoryResponse extends Kontext.AjaxResponse { @@ -192,10 +195,13 @@ export interface SearchHistoryModelState { fsQueryCQLProps:boolean; fsPosattrName:string; fsPosattrValue:string; + fsPosattrValueIsSub:boolean; fsStructureName:string; fsStructattrName:string; fsStructattrValue:string; + fsStructattrValueIsSub:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; fsArchAs:string; @@ -203,5 +209,6 @@ export interface SearchHistoryModelState { fsWlPat:string; fsWlPFilter:string; fsWlNFilter:string; + isHelpVisible:boolean; } diff --git a/public/files/js/models/searchHistory/index.ts b/public/files/js/models/searchHistory/index.ts index b7820b647c..f2d07ac6d3 100644 --- a/public/files/js/models/searchHistory/index.ts +++ b/public/files/js/models/searchHistory/index.ts @@ -90,11 +90,14 @@ export class SearchHistoryModel extends StatefulModel { searchFormView: 'quick', fsPosattrName: 'word', fsPosattrValue: '', + fsPosattrValueIsSub: false, fsStructureName: '', fsStructattrName: '', fsStructattrValue: '', + fsStructattrValueIsSub: false, fsAnyPropertyValue: '', - fsQueryCQLProps: true, + fsAnyPropertyValueIsSub: false, + fsQueryCQLProps: false, fsCorpus: pageModel.getCorpusIdent().id, fsSubcorpus: '', fsArchAs: '', @@ -102,6 +105,7 @@ export class SearchHistoryModel extends StatefulModel { fsWlPat: '', fsWlNFilter: '', fsWlPFilter: '', + isHelpVisible: false } ); this.pageModel = pageModel; @@ -337,6 +341,17 @@ export class SearchHistoryModel extends StatefulModel { } ); + this.addActionHandler( + Actions.SetFsPosattrValueIsSub, + action => { + this.changeState( + state => { + state.fsPosattrValueIsSub = action.payload.value; + } + ); + } + ) + this.addActionHandler( Actions.SetFsStructureName, action => { @@ -370,6 +385,17 @@ export class SearchHistoryModel extends StatefulModel { } ); + this.addActionHandler( + Actions.SetFsStructattrValueIsSub, + action => { + this.changeState( + state => { + state.fsStructattrValueIsSub = action.payload.value; + } + ); + } + ); + this.addActionHandler( Actions.SetFsAnyPropertyValue, action => { @@ -381,6 +407,17 @@ export class SearchHistoryModel extends StatefulModel { } ); + this.addActionHandler( + Actions.SetFsAnyPropertyValueIsSub, + action => { + this.changeState( + state => { + state.fsAnyPropertyValueIsSub = action.payload.value + } + ); + } + ); + this.addActionHandler( Actions.SetFsAdvancedQuery, action => { @@ -466,7 +503,29 @@ export class SearchHistoryModel extends StatefulModel { }); this.performLoadAction(); } - ) + ); + + this.addActionHandler( + Actions.ToggleHelpView, + action => { + this.changeState( + state => { + state.isHelpVisible = !state.isHelpVisible; + } + ); + } + ); + + this.addActionHandler( + MainMenuActions.ClearActiveItem, + action => { + this.changeState( + state => { + state.isHelpVisible = false; + } + ); + } + ); } private isToggleWidgetAction(action:Action): action is typeof Actions.ToggleQueryHistoryWidget { @@ -523,8 +582,10 @@ export class SearchHistoryModel extends StatefulModel { if (this.state.fsQueryCQLProps) { args.fsPosattrName = this.state.fsPosattrName; args.fsPosattrValue = this.state.fsPosattrValue; + args.fsPosattrValueIsSub = this.state.fsPosattrValueIsSub; args.fsStructattrName = this.state.fsStructattrName; args.fsStructattrValue = this.state.fsStructattrValue; + args.fsStructattrValueIsSub = this.state.fsStructattrValueIsSub; args.fsStructureName = this.state.fsStructureName; args.fsCorpus = this.state.fsCorpus; args.fsSubcorpus = this.state.fsSubcorpus; @@ -535,6 +596,7 @@ export class SearchHistoryModel extends StatefulModel { args.fsSubcorpus = this.state.fsSubcorpus; args.fsArchivedAs = this.state.fsArchAs; args.fsAnyPropertyValue = this.state.fsAnyPropertyValue; + args.fsAnyPropertyValueIsSub = this.state.fsAnyPropertyValueIsSub; } break; case 'wlist': @@ -552,6 +614,7 @@ export class SearchHistoryModel extends StatefulModel { args.fsSubcorpus = this.state.fsSubcorpus; args.fsArchivedAs = this.state.fsArchAs; args.fsAnyPropertyValue = this.state.fsAnyPropertyValue; + args.fsAnyPropertyValueIsSub = this.state.fsAnyPropertyValueIsSub; } break; case 'kwords': @@ -566,6 +629,7 @@ export class SearchHistoryModel extends StatefulModel { args.fsSubcorpus = this.state.fsSubcorpus; args.fsArchivedAs = this.state.fsArchAs; args.fsAnyPropertyValue = this.state.fsAnyPropertyValue; + args.fsAnyPropertyValueIsSub = this.state.fsAnyPropertyValueIsSub; } break; default: @@ -573,6 +637,7 @@ export class SearchHistoryModel extends StatefulModel { args.fsSubcorpus = this.state.fsSubcorpus; args.fsArchivedAs = this.state.fsArchAs; args.fsAnyPropertyValue = this.state.fsAnyPropertyValue; + args.fsAnyPropertyValueIsSub = this.state.fsAnyPropertyValueIsSub; break; } } diff --git a/public/files/js/translations/messages.cs.json b/public/files/js/translations/messages.cs.json index a42b1c8dce..f2c2ec4a06 100644 --- a/public/files/js/translations/messages.cs.json +++ b/public/files/js/translations/messages.cs.json @@ -244,6 +244,7 @@ "global__save_form_line_to": "do", "global__advanced_options": "Pokročilé možnosti", "global__menu_waiting_item": "čekám na dokončení výpočtu", + "global__back": "zpět", "linesel__remove_selected_lines": "Odstranit vybrané řádky", "linesel__remove_all_but_selected_lines": "Ponechat pouze vybrané řádky", "linesel__clear_the_selection": "Zrušit označení řádků", @@ -488,14 +489,16 @@ "qhistory__quick_search": "Rychlé hledání", "qhistory__extended_search": "Rozšířené hledání", "qhistory__used_posattrs_label": "Název pozičního atributu", - "qhistory__used_posattr_value": "Hodnota pozičního atributu", + "qhistory__used_posattr_value": "Token/pozice (přesná shoda)", + "qhistory__used_posattr_value_contains": "Token/pozice (podřetězec)", "qhistory__used_structattrs_label": "Název strukturního atributu", - "qhistory__used_structattrs_value": "Hodnota strukturního atributu", - "qhistory__used_structattrs_text_type": "typ textu", + "qhistory__used_structattrs_value": "Typ textu (přesná shoda)", + "qhistory__used_structattrs_value_contains": "Typ textu (podřetězec)", "qhistory__used_structures_label": "Název struktury", - "qhistory__query_contains": "Dotaz obsahuje", + "qhistory__query_contains": "Libovolná část dotazu (přesná shoda)", + "qhistory__query_part_contains": "Libovolná část dotazu (podřetězec)", "qhistory__search_button": "Hledat", - "qhistory__srch_by_query_props": "Hledat podle vlastností dotazu", + "qhistory__srch_by_query_props": "Podrobné hledání", "qhistory__used_subcorpus": "Subkorpus", "qhistory__used_wlattr": "Atribut", "qhistory__used_wlpat": "Výraz", @@ -503,6 +506,7 @@ "qhistory__used_nfilter": "Slova negativního filtru", "qhistory__any_search_note": "Pro podrobnější výběr parametrů zvolte ve filtru konkrétní typ dotazu.", "qhistory__archived_as_label": "Archivováno jako", + "qhistory__help_button": "Nápověda k vyhledávání", "concview__invalid_page_num_err": "Neplatné číslo stránky", "concview__click_for_details": "Klikněte pro zobrazení detailů", "concview__sort_jump_to": "Přejít na", diff --git a/public/files/js/translations/messages.en.json b/public/files/js/translations/messages.en.json index 0d2b22cb08..738e7bf81f 100644 --- a/public/files/js/translations/messages.en.json +++ b/public/files/js/translations/messages.en.json @@ -244,6 +244,7 @@ "global__save_form_line_to": "To", "global__advanced_options": "Advanced options", "global__menu_waiting_item": "waiting for complete calculation", + "global__back": "back", "linesel__remove_selected_lines": "Remove selected lines", "linesel__remove_all_but_selected_lines": "Keep only selected lines", "linesel__clear_the_selection": "Clear the selection", @@ -489,14 +490,16 @@ "qhistory__quick_search": "Quick search", "qhistory__extended_search": "Extended search", "qhistory__used_posattrs_label": "Positional attribute name", - "qhistory__used_posattr_value": "Positional attribute value", + "qhistory__used_posattr_value": "Token/position (exact match)", + "qhistory__used_posattr_value_contains": "Token/position (substring)", "qhistory__used_structattrs_label": "Structural attribute name", - "qhistory__used_structattrs_value": "Structural attribute value", - "qhistory__used_structattrs_text_type": "text type", + "qhistory__used_structattrs_value": "Text type (exact match)", + "qhistory__used_structattrs_value_contains": "Text type (substring)", "qhistory__used_structures_label": "Structure name", - "qhistory__query_contains": "Query contains", + "qhistory__query_contains": "Any part of a query (exact match)", + "qhistory__query_part_contains": "Any part of a query (substring)", "qhistory__search_button": "Search", - "qhistory__srch_by_query_props": "Search by query properties", + "qhistory__srch_by_query_props": "Detailed search", "qhistory__used_subcorpus": "Subcorpus", "qhistory__used_wlattr": "Attribute", "qhistory__used_wlpat": "Pattern", @@ -504,6 +507,7 @@ "qhistory__used_nfilter": "Negative filter words", "qhistory__any_search_note": "For a more detailed selection of parameters, select a specific query type in the filter.", "qhistory__archived_as_label": "Archived as", + "qhistory__help_button": "Search help", "concview__invalid_page_num_err": "Invalid page number", "concview__click_for_details": "Click to see details", "concview__sort_jump_to": "Jump to", diff --git a/public/files/js/translations/messages.sl.json b/public/files/js/translations/messages.sl.json index d528da3709..44cae3a220 100644 --- a/public/files/js/translations/messages.sl.json +++ b/public/files/js/translations/messages.sl.json @@ -244,6 +244,7 @@ "global__save_form_line_to": "Do", "global__advanced_options": "Advanced options UNTRANSLATED", "global__menu_waiting_item": "waiting for complete calculation UNTRANSLATED", + "global__back": "back UNTRANSLATED", "linesel__remove_selected_lines": "Odstrani izbrane vrstice", "linesel__remove_all_but_selected_lines": "Obdrži samo izbrane vrstice", "linesel__clear_the_selection": "Počisti izbor", @@ -939,20 +940,23 @@ "qhistory__quick_search": "Quick search UNTRANSLATED", "qhistory__extended_search": "Extended search UNTRANSLATED", "qhistory__used_posattrs_label": "Positional attribute name UNTRANSLATED", - "qhistory__used_posattr_value": "Positional attribute value UNTRANSLATED", + "qhistory__used_posattr_value": "Token/position (exact match) UNTRANSLATED", + "qhistory__used_posattr_value_contains": "Token/position (substring) UNTRANSLATED", "qhistory__used_structattrs_label": "Structural attribute name UNTRANSLATED", - "qhistory__used_structattrs_value": "Structural attribute value UNTRANSLATED", - "qhistory__used_structattrs_text_type": "text type UNTRANSLATED", + "qhistory__used_structattrs_value": "Text type (exact match) UNTRANSLATED", + "qhistory__used_structattrs_value_contains": "Text type (substring) UNTRANSLATED", "qhistory__used_structures_label": "Structure name UNTRANSLATED", - "qhistory__query_contains": "Query contains UNTRANSLATED", + "qhistory__query_contains": "Any part of a query (exact match) UNTRANSLATED", + "qhistory__query_part_contains": "Any part of a query (substring) UNTRANSLATED", "qhistory__search_button": "Search UNTRANSLATED", - "qhistory__srch_by_query_props": "Search by query properties UNTRANSLATED", + "qhistory__srch_by_query_props": "Detailed search UNTRANSLATED", "qhistory__used_subcorpus": "Subcorpus UNTRANSLATED", "qhistory__used_wlattr": "Attribute UNTRANSLATED", "qhistory__used_wlpat": "Pattern UNTRANSLATED", "qhistory__used_pfilter": "Positive filter words UNTRANSLATED", "qhistory__used_nfilter": "Negative filter words UNTRANSLATED", "qhistory__any_search_note": "For a more detailed selection of parameters, select a specific query type in the filter. UNTRANSLATED", + "qhistory__help_button": "Search help UNTRANSLATED", "wordlist__pfilter_label": "Positive filter words UNTRANSLATED", "wordlist__nfilter_label": "Negative filter words UNTRANSLATED", "wordlist__positive_{pcount}": "positive {pcount, plural, one{# word} other{# words}} UNTRANSLATED", diff --git a/public/files/js/translations/messages.szl.json b/public/files/js/translations/messages.szl.json index e467d0e413..d5edbcff90 100644 --- a/public/files/js/translations/messages.szl.json +++ b/public/files/js/translations/messages.szl.json @@ -244,6 +244,7 @@ "global__save_form_line_to": "do", "global__advanced_options": "Advanced options UNTRANSLATED", "global__menu_waiting_item": "waiting for complete calculation UNTRANSLATED", + "global__back": "back UNTRANSLATED", "linesel__remove_selected_lines": "Skasuj ôznaczōne linije", "linesel__remove_all_but_selected_lines": "Ôstŏw ino ôznaczōne linije", "linesel__clear_the_selection": "Wysnŏż wybōr", @@ -487,14 +488,16 @@ "qhistory__quick_search": "Quick search UNTRANSLATED", "qhistory__extended_search": "Extended search UNTRANSLATED", "qhistory__used_posattrs_label": "Positional attribute name UNTRANSLATED", - "qhistory__used_posattr_value": "Positional attribute value UNTRANSLATED", + "qhistory__used_posattr_value": "Token/position (exact match) UNTRANSLATED", + "qhistory__used_posattr_value_contains": "Token/position (substring) UNTRANSLATED", "qhistory__used_structattrs_label": "Structural attribute name UNTRANSLATED", - "qhistory__used_structattrs_value": "Structural attribute value UNTRANSLATED", - "qhistory__used_structattrs_text_type": "text type UNTRANSLATED", + "qhistory__used_structattrs_value": "Text type (exact match) UNTRANSLATED", + "qhistory__used_structattrs_value_contains": "Text type (substring) UNTRANSLATED", "qhistory__used_structures_label": "Structure name UNTRANSLATED", "qhistory__search_button": "Search UNTRANSLATED", - "qhistory__query_contains": "Query contains UNTRANSLATED", - "qhistory__srch_by_query_props": "Search by query properties UNTRANSLATED", + "qhistory__query_contains": "Any part of a query (exact match) UNTRANSLATED", + "qhistory__query_part_contains": "Any part of a query (substring) UNTRANSLATED", + "qhistory__srch_by_query_props": "Detailed search UNTRANSLATED", "qhistory__used_subcorpus": "Subcorpus UNTRANSLATED", "qhistory__used_wlattr": "Attribute UNTRANSLATED", "qhistory__used_wlpat": "Pattern UNTRANSLATED", @@ -502,6 +505,7 @@ "qhistory__used_nfilter": "Negative filter words UNTRANSLATED", "qhistory__any_search_note": "For a more detailed selection of parameters, select a specific query type in the filter. UNTRANSLATED", "qhistory__archived_as_label": "Archived as UNTRANSLATED", + "qhistory__help_button": "Search help UNTRANSLATED", "concview__invalid_page_num_err": "Niynŏleżyn numer strōny", "concview__click_for_details": "Kliknij, żeby ôbejzdrzeć szczegōły", "concview__sort_jump_to": "Skocz do", diff --git a/public/files/js/types/coreViews/closeableFrame.ts b/public/files/js/types/coreViews/closeableFrame.ts index b586a5a091..47b35f5c14 100644 --- a/public/files/js/types/coreViews/closeableFrame.ts +++ b/public/files/js/types/coreViews/closeableFrame.ts @@ -26,6 +26,7 @@ export interface Props { onReady?:(elm:HTMLElement)=>void; customClass?:string; scrollable?:boolean; + customControls?:React.ReactNode; autoWidth?:AutoWidth; fixedTop?:string; icon?:React.ReactNode; diff --git a/public/files/js/views/document/index.tsx b/public/files/js/views/document/index.tsx index 8275e38be0..5e99d5d123 100644 --- a/public/files/js/views/document/index.tsx +++ b/public/files/js/views/document/index.tsx @@ -370,6 +370,15 @@ export function init( alt={he.translate('global__close_the_window')} /> + {this.props.customControls ? + + + {this.props.customControls} + + + : + null + } {this.props.children} diff --git a/public/files/js/views/document/style.tsx b/public/files/js/views/document/style.tsx index dacfac8c97..f5d9fa99d9 100644 --- a/public/files/js/views/document/style.tsx +++ b/public/files/js/views/document/style.tsx @@ -106,6 +106,25 @@ export const CloseableFrame = styled.section<{fixedTop?: string}>` } } + .custom-controls { + padding-top: 0.2em; + padding-bottom: 0.2em; + + .buttons { + display: flex; + align-items: center; + } + + hr { + margin: 0; + padding: 0; + } + + a img { + width: 2em; + } + } + .contents { flex-grow: 1; diff --git a/public/files/js/views/searchHistory/full/fulltextForms.tsx b/public/files/js/views/searchHistory/full/fulltextForms.tsx index 7096017de9..cb5f46183f 100644 --- a/public/files/js/views/searchHistory/full/fulltextForms.tsx +++ b/public/files/js/views/searchHistory/full/fulltextForms.tsx @@ -29,10 +29,13 @@ export interface ExtendedSearchForms { fsQueryCQLProps:boolean; fsPosattrName:string; fsPosattrValue:string; + fsPosattrValueIsSub:boolean; fsStructureName:string; fsStructattrName:string; fsStructattrValue:string; + fsStructattrValueIsSub:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }>; @@ -40,16 +43,20 @@ export interface ExtendedSearchForms { fsQueryCQLProps:boolean; fsPosattrName:string; fsPosattrValue:string; + fsPosattrValueIsSub:boolean; fsStructureName:string; fsStructattrName:string; fsStructattrValue:string; + fsStructattrValueIsSub:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }>; WListForm:React.FC<{ fsQueryCQLProps:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; wlattr:string; @@ -59,6 +66,7 @@ export interface ExtendedSearchForms { }>; KWordsForm:React.FC<{ fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsQueryCQLProps:boolean; fsCorpus:string; fsSubcorpus:string; @@ -66,6 +74,7 @@ export interface ExtendedSearchForms { }>; AnyForm:React.FC<{ fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }>; @@ -86,6 +95,7 @@ export function init( const AnyPropertyValue:React.FC<{ value:string; + isSubstr:boolean; }> = (props) => { const handleValueChange = (evt:React.ChangeEvent) => { @@ -97,6 +107,15 @@ export function init( ); }; + const handleVariantChange = (evt:React.ChangeEvent) => { + dispatcher.dispatch( + Actions.SetFsAnyPropertyValueIsSub, + { + value: evt.target.value === "1" + } + ); + }; + const inputStyle:React.CSSProperties = { width: '20em', height: '1.8em', @@ -106,7 +125,13 @@ export function init( return ( <> - {he.translate('qhistory__query_contains')}: + + + {he.translate('qhistory__query_contains')} + {he.translate('qhistory__query_part_contains')} + + : + > @@ -118,6 +143,7 @@ export function init( const UsedPosattrs:React.FC<{ attr:string; value:string; + isSubstr:boolean; }> = (props) => { const handleAttrChange = (evt:React.ChangeEvent) => { @@ -138,9 +164,28 @@ export function init( ); }; + const handleSubSelChange = (evt:React.ChangeEvent) => { + dispatcher.dispatch( + Actions.SetFsPosattrValueIsSub, + { + value: evt.target.value === "1" + } + ); + }; + return ( <> - {he.translate('qhistory__used_posattr_value')}: + + + + {he.translate('qhistory__used_posattr_value')} + + + {he.translate('qhistory__used_posattr_value_contains')} + + + : + {he.translate('qhistory__used_posattrs_label')}: @@ -176,6 +221,7 @@ export function init( const UsedStructattrs:React.FC<{ attr:string; value:string; + isSubstr:boolean; }> = (props) => { const handleAttrChange = (evt:React.ChangeEvent) => { @@ -196,15 +242,26 @@ export function init( ); }; + const handleSubSelChange = (evt:React.ChangeEvent) => { + dispatcher.dispatch( + Actions.SetFsStructattrValueIsSub, + { + value: evt.target.value === "1" + } + ); + }; + return ( <> - - {he.translate('qhistory__used_structattrs_value')}: - - ({he.translate('qhistory__used_structattrs_text_type')}) - + + + {he.translate('qhistory__used_structattrs_value')} + {he.translate('qhistory__used_structattrs_value_contains')} + + : + - {he.translate('qhistory__used_structattrs_label')}: + {he.translate('qhistory__used_structattrs_label')} > ); @@ -286,10 +343,13 @@ export function init( fsQueryCQLProps:boolean; fsPosattrName:string; fsPosattrValue:string; + fsPosattrValueIsSub:boolean; fsStructureName:string; fsStructattrName:string; fsStructattrValue:string; + fsStructattrValueIsSub:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }> = (props) => { @@ -300,13 +360,16 @@ export function init( {props.fsQueryCQLProps ? <> - - + + > : <> - + > } > @@ -318,10 +381,13 @@ export function init( fsQueryCQLProps:boolean; fsPosattrName:string; fsPosattrValue:string; + fsPosattrValueIsSub:boolean; fsStructureName:string; fsStructattrName:string; fsStructattrValue:string; + fsStructattrValueIsSub:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }> = (props) => { @@ -332,12 +398,14 @@ export function init( {props.fsQueryCQLProps ? <> - - + + > : <> - + > } > @@ -348,6 +416,7 @@ export function init( const WListForm:React.FC<{ fsQueryCQLProps:boolean; fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; wlattr:string; @@ -408,7 +477,7 @@ export function init( > : <> - + > } > @@ -418,6 +487,7 @@ export function init( const KWordsForm:React.FC<{ fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsQueryCQLProps:boolean; fsCorpus:string; fsSubcorpus:string; @@ -443,7 +513,8 @@ export function init( > : <> - + > } > @@ -453,6 +524,7 @@ export function init( const AnyForm:React.FC<{ fsAnyPropertyValue:string; + fsAnyPropertyValueIsSub:boolean; fsCorpus:string; fsSubcorpus:string; }> = (props) => { @@ -461,7 +533,7 @@ export function init( <> - + > ) } diff --git a/public/files/js/views/searchHistory/full/index.tsx b/public/files/js/views/searchHistory/full/index.tsx index 63178178ad..e1761f0c5b 100644 --- a/public/files/js/views/searchHistory/full/index.tsx +++ b/public/files/js/views/searchHistory/full/index.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; -import { Bound, IActionDispatcher } from 'kombo'; +import { Bound, BoundWithProps, IActionDispatcher } from 'kombo'; import { Keyboard, Dict, pipe, List } from 'cnc-tskit'; import * as Kontext from '../../../types/kontext'; @@ -38,7 +38,7 @@ import * as QS from '../../query/style'; export interface HistoryViews { - RecentQueriesPageList:React.ComponentClass<{}>; + RecentQueriesPageList:React.ComponentClass<{onCloseClick: ()=>void}>; } @@ -100,6 +100,12 @@ export function init( ); }; + const handleHelpClick = () => { + dispatcher.dispatch( + Actions.ToggleHelpView + ); + }; + return ( ({he.translate('qhistory__any_search_note')}) : null } - - {he.translate('qhistory__search_button')} - + + + + + + + {he.translate('qhistory__search_button')} + + @@ -720,33 +733,94 @@ export function init( ); }; + // -------------------- --------------------------------- + + const HelpControls:React.FC<{}> = (props) => { + + const handleBackClick = () => { + dispatcher.dispatch( + Actions.ToggleHelpView + ); + }; + + return ( + + + + + + ); + } + + // -------------------- ------------------------------------- + + + const HelpView:React.FC<{}> = (props) => { + + + + return ( + + + Při hledání dotazů se prohledávají jejich jednotlivé části: + + poziční atributy [A] + hodnoty pozičních atributů [B] + struktury [C] (včetně tech vybraných v sekci "Omezit hledání") + strukturní atributy [D] (včetně tech vybraných v sekci "Omezit hledání") + hodnoty strukturních atributů [E] (včetně tech vybraných v sekci "Omezit hledání") + + + + Help - TODO + + + + + + ); + }; + // -------------------- ------------------------ - const RecentQueriesPageList:React.FC = (props) => { + const RecentQueriesPageList:React.FCvoid}> = (props) => { return ( - - - {props.data.length === 0 && props.isBusy ? - : - + + : null} > + {props.isHelpVisible ? + : + + + {props.data.length === 0 && props.isBusy ? + : + + } + } - + + ); } return { - RecentQueriesPageList: Bound(RecentQueriesPageList, queryHistoryModel) + RecentQueriesPageList: BoundWithProps<{onCloseClick: ()=>void}, SearchHistoryModelState>(RecentQueriesPageList, queryHistoryModel) }; } \ No newline at end of file diff --git a/public/files/js/views/searchHistory/full/srchFields.tsx b/public/files/js/views/searchHistory/full/srchFields.tsx index 2efd7f2380..5c41cfdf81 100644 --- a/public/files/js/views/searchHistory/full/srchFields.tsx +++ b/public/files/js/views/searchHistory/full/srchFields.tsx @@ -171,27 +171,34 @@ export function init( return + fsStructattrValue={props.fsStructattrValue} + fsStructattrValueIsSub={props.fsStructattrValueIsSub} /> case 'pquery': return + fsStructattrValue={props.fsStructattrValue} + fsStructattrValueIsSub={props.fsStructattrValueIsSub} /> case 'wlist': return + fsAnyPropertyValue={props.fsAnyPropertyValue} + fsAnyPropertyValueIsSub={props.fsAnyPropertyValueIsSub} /> } } diff --git a/public/files/js/views/searchHistory/full/style.tsx b/public/files/js/views/searchHistory/full/style.tsx index 9cb05fd299..5ccc6f6074 100644 --- a/public/files/js/views/searchHistory/full/style.tsx +++ b/public/files/js/views/searchHistory/full/style.tsx @@ -341,14 +341,33 @@ export const FilterForm = styled.form` align-items: center; } - .util-button { - margin-top: 1em; - } - label.emph { font-weight: bold; font-size: 1.1em; } + + div.aligned { + display: flex; + align-items: center; + + strong { + padding-left: 0.2em; + padding-right: 1em; + font-size: 1.2em; + } + } + + .button-area { + display: flex; + align-items: center; + margin-top: 1.4em; + + .help img { + display: block; + margin: 0; + padding: 0; + } + } `; // ---------------------- ------------------------------ @@ -399,4 +418,12 @@ export const SearchKindSelector = styled.select` margin: 0; padding: 0; } +`; + +// ---------------------- -------------------------------------- + +export const HelpView = styled.div` + + + `; \ No newline at end of file diff --git a/public/files/js/views/searchHistory/main.tsx b/public/files/js/views/searchHistory/main.tsx index c98e31ec12..c68a6ac869 100644 --- a/public/files/js/views/searchHistory/main.tsx +++ b/public/files/js/views/searchHistory/main.tsx @@ -44,64 +44,33 @@ export function init({dispatcher, helpers, searchHistoryModel, mainMenuModel}:Ma const layoutViews = helpers.getLayoutViews(); const widgetView = fullViewInit(dispatcher, helpers, searchHistoryModel); - class HistoryContainer extends React.PureComponent { + const HistoryContainer:React.FC = (props) => { - _isActiveItem(itemName) { - return this.props.activeItem && this.props.activeItem.actionName === itemName; - } - - _isActive() { - return this._isActiveItem(MainMenuActions.ShowQueryHistory.name); - } + const _isActive = () => { + return props.activeItem && + props.activeItem.actionName === MainMenuActions.ShowQueryHistory.name; + }; - _handleCloseClick() { + const _handleCloseClick = () => { dispatcher.dispatch({ name: MainMenuActions.ClearActiveItem.name }); - } - - _renderForm() { - if (this._isActive()) { - return ; - - } else { - return ; - } - } - - _renderTitle() { - if (this._isActive()) { - return helpers.translate('query__recent_queries_link') - - } else { - return '--'; - } - } - - render() { - if (this._isActive()) { - return - - {this._renderForm()} - - ; - - } else if (this.props.isBusy) { - return - undefined} - customClass="OptionsContainer busy"> - - - ; - - } else { - return null; - } + }; + + if (_isActive()) { + return + + } else if (props.isBusy) { + return + undefined} + customClass="OptionsContainer busy"> + + + ; + + } else { + return null; } } diff --git a/requirements.txt b/requirements.txt index 4ce8eba7dc..c0f2087985 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,7 @@ PyICU >= 1.5 babel >= 2.9.1 jinja2 >= 2.11.3 secure-cookie >= 0.1.0 +setuptools == 59.6.0 sanic >= 22.12.0 pyJWT >= 2.6.0 # please note that lxml package requires the following system packages: @@ -22,7 +23,7 @@ uvloop >= 0.16.0 mysql-connector-python >= 8.4.0, < 9.0.0 aiofiles >= 0.8.0 aiocsv >= 1.2.2 -aiohttp >= 3.8.2 +aiohttp >= 3.10.2 dataclasses-json >= 0.5.7 couchdb >= 1.2 cairosvg >= 2.5.3
+ Při hledání dotazů se prohledávají jejich jednotlivé části: +
+ +