--- last_review: "2025-01-01" last_reviewer: "-" documented_code: [ ] --- ```{tags} user, tutorial, webinterface, edit-mode ``` # The Edit Mode :::{note} This page has been migrated from the old documentation, and has not yet been fully revised. There might be inconsistencies or errors when using with current LinkAhead versions. ::: % TODO: Issue: https://gitlab.indiscale.com/caosdb/src/linkahead-docs/-/work_items/112 % TODO: Rewrite the tutorials using a concrete soil-sample schema as the running example. % TODO: Rewrite the how-to sections (Make a property into a list, Add/Remove properties to a % TODO: RecordType) into proper tutorials with the same running example. Entities in LinkAhead can be changed, created, and deleted using the `Edit Mode`. In the following sections, you'll learn how. You should be familiar with the concepts of Records, RecordTypes, and properties in LinkAhead — if not, see the [data model documentation](/tutorial/introduction/datamodel_and_schema.md) first. For background on the Edit Mode's design and concepts, see [Understanding the Edit Mode](/explanation/webinterface/edit_mode.md). ## Getting started :::{admonition} Learnings :class: tip - How to activate and deactivate the Edit Mode - What the Edit Mode toolbox is and where to find it ::: In usual setups of LinkAhead, you have to log in to use the edit mode. Afterwards, you can access it by clicking on the button in the top menu as shown below: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/edit-mode-button.png :alt: Edit mode button :width: 480 ::: After entering the edit mode, the button changes its text to `Leave Edit Mode`. Clicking here terminates the edit mode. When you have entered the edit mode, you'll see the edit mode toolbox appearing on the right-hand side of your screen: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/edit-mode-toolbox.png :alt: Edit mode toolbox :width: 240 ::: You'll learn more about its contents in the following sections. Right now it only contains the options for creating a new RecordType or property which we'll explain in {ref}`new-recordtypes-properties`. (change-existing)= ## Changing an existing entity :::{admonition} Learnings :class: tip - How to edit property values on an existing entity - How to add and remove properties and parent RecordTypes on a Record ::: We'll start by changing and updating existing entities. First, find the entity you want to change and enter the edit mode. You'll see an edit button in the top right of the entity card: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/edit-entity-button.png :alt: Edit entity button :width: 240 ::: After clicking on this button, the edit menu for this entity is opened as shown below for a guitar Record from the [demo](https://demo.indiscale.com). You'll also note that the edit mode toolbox changes its contents: It now harbors two lists of the existing properties and RecordTypes. :::{figure} /.assets/images/tutorials/webinterface/edit_mode/change-entity.png :alt: Changing an existing Record :width: 720 ::: Property values can be changed in the entity card directly; additional parents can be added by dragging them from the list of RecordTypes to the corresponding area at the top of the Record. Similarly, properties can be added by dragging properties (or RecordTypes) from the list in the edit mode toolbox to the corresponding area at the bottom of the Record. Properties and parents can be removed from the entity by clicking on the trash-can symbol. To edit the value of a reference property, click the pencil symbol to the right of the property. The dropdown with valid values is then loaded on demand: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/edit-lazy-load-dropdown.png :alt: Clicking on the pencil symbol enables the editing of thereference property. :width: 720 ::: When many Entities are valid candidates for a reference property, not all may appear in the dropdown. In that case a warning is shown and an additional pencil button lets you enter an ID manually (click the pencil button, type the ID, press Enter). You can look up the ID of any entity via the bar code icon in the upper right corner of its entity card. Changes will be applied after clicking on `Save` or can be discarded entirely by clicking `Cancel`. Existing properties and RecordTypes can be edited in the same way. See [Understanding the Edit Mode](/explanation/webinterface/edit_mode.md) for key differences between editing Records and RecordTypes. ## Creating a new Record :::{admonition} Learnings :class: tip - How to create a new Record of a given RecordType - How to assign property values and additional parents when creating a Record ::: If you want to create a new Record of a given RecordType, visit that RecordType and enter the edit mode (if your new Record will have more than one parent, visit any one of them - you can add the others later). A new Record is then created by clicking on the `+Record` button in the top right of the RecordType: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/new-record.png :alt: New record button :width: 240 ::: Clicking here opens an entity card with an edit menu for the new Record similar to the one discussed in {ref}`change-existing`. In here, you can enter the name and the description of your new Record, assign values to its properties, and add further parents or properties from the corresponding lists in the edit mode toolbox. The new Record is inserted by clicking `Save`. (new-recordtypes-properties)= ## Extend your schema: Add RecordTypes and properties :::{admonition} Learnings :class: tip - How to use the Edit Mode toolbox to create new RecordTypes and properties ::: You can extend the schema of your LinkAhead instance by creating new RecordTypes and properties directly from the WebUI. This is done by clicking on the "Create Property" and "Create RecordType" buttons in the edit mode toolbox: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/edit-mode-toolbox.png :alt: Edit mode toolbox :width: 240 ::: ## New RecordType :::{admonition} Learnings :class: tip - How to create a new RecordType with a name, description, and parent RecordTypes - How to add properties to a new RecordType ::: When creating a new RecordType, a RecordType card is added to the entity panel, similar to the "New Record" explained above: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/new-recordtype.png :alt: Create a new RecordType :width: 720 ::: 1. As above, you can enter a name and a description. Don't reuse existing names, if it can be avoided. 2. You can add parent RecordTypes by dragging existing RecordTypes on the "parents" zone above the "name" field. :::{figure} /.assets/images/tutorials/webinterface/edit_mode/dnd_parent.png :alt: A screenshot of the drag&drop source and target zones in the RecordType edit mode dialog :width: 720 ::: :::{note} Adding parents does not automatically add the parents' properties yet. You will have to do this manually. ::: 3. Add properties as described above by selecting them from the lists in the edit mode toolbox and dragging them to the property area in the new RecordType. 4. Click "Save" to save your newly created RecordType, or abort with the "Cancel" button. ## New property :::{admonition} Learnings :class: tip How to create a new property with a chosen name and datatype ::: When creating a new property, a property card shows up: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/screenshot_new_property.png :alt: Create a new property :width: 720 ::: 1. As above, you can enter a name and a description. Don't reuse existing names, if it can be avoided. 2. Set the datatype. See [Understanding the Edit Mode](/explanation/webinterface/edit_mode.md) for a description of each available datatype. 3. If you want the new property to be a list, check the checkbox. 4. Click "Save" to save your newly created property, or abort with the "Cancel" button. :::{note} When creating a property with datatype `INTEGER` or `DOUBLE`, an optional unit field appears (for example `kg` or `mm`). ::: :::{note} After having created a new RecordType or property, you may have to leave and re-enter the edit mode for the new entity to appear in the lists of properties or RecordTypes in the edit mode toolbox. ::: (delete-an-entity)= ## Delete an entity (Record, property, RecordType) :::{admonition} Learnings :class: tip - How to delete an entity using the Edit Mode ::: Entities can also be deleted by clicking on the delete button in the top right of the entity, once the Edit Mode has been activated: :::{figure} /.assets/images/tutorials/webinterface/edit_mode/delete-entity-button.png :alt: Delete entity button :width: 240 ::: After clicking on `delete` you'll be asked for confirmation. ```{note} Entities cannot be deleted if they are needed by other entities, for example as a reference. See [Understanding the Edit Mode](/explanation/webinterface/edit_mode.md) for details on how to check whether an entity is in use before deleting it. ``` ## Make a property into a list % TODO: Rewrite into a proper tutorial with a concrete scenario and visible results :::{admonition} Learnings :class: tip - How to change a property to hold multiple values (list Property) ::: To change whether a property is a list or not, follow these steps: 1. Find the property you want to change. 2. Activate the Edit Mode in the top menu. A clickable "Edit" button appears on the property. 3. Click the "Edit" button. A dialog for editing the property shows up. 4. Click the "list" checkbox to change the status. 5. Click "Save" to save your changes, or abort with the "Cancel" button. ## Add properties to an existing RecordType % TODO: Rewrite into a proper tutorial with a concrete scenario and visible results :::{admonition} Learnings :class: tip - How to add properties to an existing RecordType using drag and drop ::: 1. Find the RecordType you want to change. 2. Activate the Edit Mode in the top menu. A clickable "Edit" button appears on the RecordType. 3. Click the "Edit" button. A dialog for editing the RecordType shows up. 4. Drag and drop existing properties and RecordTypes from the toolbox onto the RecordType's target area. 5. Click "Save" to save your changes, or abort with the "Cancel" button. ## Remove properties from an existing RecordType % TODO: Rewrite into a proper tutorial with a concrete scenario and visible results :::{admonition} Learnings :class: tip - How to remove a property from a RecordType ::: 1. Find the RecordType you want to change. 2. Activate the Edit Mode in the top menu. A clickable "Edit" button appears on the RecordType. 3. Click the "Edit" button. A dialog for editing the RecordType shows up. 4. Click on the "Trash" icon to remove a property. 5. Click "Save" to save your changes, or abort with the "Cancel" button.