mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	chore(react/ribbon): port include archived notes
This commit is contained in:
		
							parent
							
								
									68cba8d3b2
								
							
						
					
					
						commit
						2fd3a875b6
					
				@ -77,7 +77,8 @@ const SEARCH_OPTIONS: SearchOption[] = [
 | 
				
			|||||||
    attributeType: "label",
 | 
					    attributeType: "label",
 | 
				
			||||||
    icon: "bx bx-archive",
 | 
					    icon: "bx bx-archive",
 | 
				
			||||||
    label: t("search_definition.include_archived"),
 | 
					    label: t("search_definition.include_archived"),
 | 
				
			||||||
    tooltip: t("search_definition.include_archived_notes_description")
 | 
					    tooltip: t("search_definition.include_archived_notes_description"),
 | 
				
			||||||
 | 
					    component: IncludeArchivedNotesOption
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    attributeName: "orderBy",
 | 
					    attributeName: "orderBy",
 | 
				
			||||||
@ -429,3 +430,10 @@ function DebugOption({ ...restProps }: SearchOptionProps) {
 | 
				
			|||||||
    {...restProps}
 | 
					    {...restProps}
 | 
				
			||||||
  />
 | 
					  />
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function IncludeArchivedNotesOption({ ...restProps }: SearchOptionProps) {
 | 
				
			||||||
 | 
					  return <SearchOption
 | 
				
			||||||
 | 
					    titleIcon="bx bx-archive" title={t("include_archived_notes.include_archived_notes")}
 | 
				
			||||||
 | 
					    {...restProps}
 | 
				
			||||||
 | 
					  />
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -1,24 +0,0 @@
 | 
				
			|||||||
import AbstractSearchOption from "./abstract_search_option.js";
 | 
					 | 
				
			||||||
import { t } from "../../services/i18n.js";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const TPL = /*html*/`
 | 
					 | 
				
			||||||
<tr data-search-option-conf="includeArchivedNotes">
 | 
					 | 
				
			||||||
    <td colspan="2">
 | 
					 | 
				
			||||||
        <span class="bx bx-archive"></span>
 | 
					 | 
				
			||||||
        ${t("include_archived_notes.include_archived_notes")}
 | 
					 | 
				
			||||||
    </td>
 | 
					 | 
				
			||||||
    <td class="button-column">
 | 
					 | 
				
			||||||
        <span class="bx bx-x icon-action search-option-del"></span>
 | 
					 | 
				
			||||||
    </td>
 | 
					 | 
				
			||||||
</tr>`;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export default class IncludeArchivedNotes extends AbstractSearchOption {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    static async create(noteId: string) {
 | 
					 | 
				
			||||||
        await AbstractSearchOption.setAttribute(noteId, "label", "includeArchivedNotes");
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    doRender() {
 | 
					 | 
				
			||||||
        return $(TPL);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user