mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	feat(views/table): hide multiplicity when adding a new column
This commit is contained in:
		
							parent
							
								
									c363be57b7
								
							
						
					
					
						commit
						d7af196a0c
					
				@ -296,6 +296,7 @@ interface AttributeDetailOpts {
 | 
			
		||||
    y: number;
 | 
			
		||||
    focus?: "name";
 | 
			
		||||
    parent?: HTMLElement;
 | 
			
		||||
    hideMultiplicity?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface SearchRelatedResponse {
 | 
			
		||||
@ -478,7 +479,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async showAttributeDetail({ allAttributes, attribute, isOwned, x, y, focus }: AttributeDetailOpts) {
 | 
			
		||||
    async showAttributeDetail({ allAttributes, attribute, isOwned, x, y, focus, hideMultiplicity }: AttributeDetailOpts) {
 | 
			
		||||
        if (!attribute) {
 | 
			
		||||
            this.hide();
 | 
			
		||||
 | 
			
		||||
@ -529,7 +530,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
 | 
			
		||||
        this.$rowPromotedAlias.toggle(!!definition.isPromoted);
 | 
			
		||||
        this.$inputPromotedAlias.val(definition.promotedAlias || "").attr("disabled", disabledFn);
 | 
			
		||||
 | 
			
		||||
        this.$rowMultiplicity.toggle(["label-definition", "relation-definition"].includes(this.attrType || ""));
 | 
			
		||||
        this.$rowMultiplicity.toggle(["label-definition", "relation-definition"].includes(this.attrType || "") && !hideMultiplicity);
 | 
			
		||||
        this.$inputMultiplicity.val(definition.multiplicity || "").attr("disabled", disabledFn);
 | 
			
		||||
 | 
			
		||||
        this.$rowLabelType.toggle(this.attrType === "label-definition");
 | 
			
		||||
 | 
			
		||||
@ -66,7 +66,8 @@ export default class TableColumnEditing extends Component {
 | 
			
		||||
            isOwned: true,
 | 
			
		||||
            x: 0,
 | 
			
		||||
            y: 150,
 | 
			
		||||
            focus: "name"
 | 
			
		||||
            focus: "name",
 | 
			
		||||
            hideMultiplicity: true
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user