mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	feat(views/table): hide multiplicity when adding a new column
This commit is contained in:
		| @@ -296,6 +296,7 @@ interface AttributeDetailOpts { | |||||||
|     y: number; |     y: number; | ||||||
|     focus?: "name"; |     focus?: "name"; | ||||||
|     parent?: HTMLElement; |     parent?: HTMLElement; | ||||||
|  |     hideMultiplicity?: boolean; | ||||||
| } | } | ||||||
|  |  | ||||||
| interface SearchRelatedResponse { | 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) { |         if (!attribute) { | ||||||
|             this.hide(); |             this.hide(); | ||||||
|  |  | ||||||
| @@ -529,7 +530,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget { | |||||||
|         this.$rowPromotedAlias.toggle(!!definition.isPromoted); |         this.$rowPromotedAlias.toggle(!!definition.isPromoted); | ||||||
|         this.$inputPromotedAlias.val(definition.promotedAlias || "").attr("disabled", disabledFn); |         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.$inputMultiplicity.val(definition.multiplicity || "").attr("disabled", disabledFn); | ||||||
|  |  | ||||||
|         this.$rowLabelType.toggle(this.attrType === "label-definition"); |         this.$rowLabelType.toggle(this.attrType === "label-definition"); | ||||||
|   | |||||||
| @@ -66,7 +66,8 @@ export default class TableColumnEditing extends Component { | |||||||
|             isOwned: true, |             isOwned: true, | ||||||
|             x: 0, |             x: 0, | ||||||
|             y: 150, |             y: 150, | ||||||
|             focus: "name" |             focus: "name", | ||||||
|  |             hideMultiplicity: true | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user