diff --git a/src/core/js/caosdb.js b/src/core/js/caosdb.js index e5f77ab21d27de1e8a36d6b5ba1d09994934f343..19e4bc95a1aa6e0bceabd40c3882e5c9a35205f3 100644 --- a/src/core/js/caosdb.js +++ b/src/core/js/caosdb.js @@ -1163,6 +1163,8 @@ async function retrieve_dragged_property(id) { * a web page using a specialized XSLT named entity palette. * @return An array of entities. */ +//TODO the name is inaccurate; actually the existing RT/Property panel is +//created; Suggestion: Split it or rename async function retrieve_data_model() { // TODO possibly allow single query let props = await connection.get("Entity/?query=FIND Property"); diff --git a/src/core/js/edit_mode.js b/src/core/js/edit_mode.js index 9da583060ef38cacd28b3a25c171b6c500982fc6..802b118b88b44c66a194de51a76c2577f25e2170 100644 --- a/src/core/js/edit_mode.js +++ b/src/core/js/edit_mode.js @@ -600,7 +600,7 @@ var edit_mode = new function() { * Reload the toolbox, e.g. when new Properties or RecordTypes have been added. */ this.reload_edit_mode_toolbox = async function() { - var model = await edit_mode.retrieve_data_model(); + const model = await edit_mode.retrieve_data_model(); edit_mode.load_tool_box(model); } @@ -634,7 +634,9 @@ var edit_mode = new function() { edit_mode.add_draggable_property_to_model(model); var editPanel = edit_mode.get_edit_panel(); removeAllWaitingNotifications(editPanel); - editPanel.innerHTML = xml2str(model); + // remove previously added model + $(".caosdb-f-edit-mode-existing").remove() + $(editPanel).children()[0].appendChild(model); } diff --git a/src/core/xsl/entity_palette.xsl b/src/core/xsl/entity_palette.xsl index e45364c80a4ba3849d5b9abaf29c5b85c1b76af1..a71f5e7e9ca07a890060ea7fe3ca0be9cbbdaa2d 100644 --- a/src/core/xsl/entity_palette.xsl +++ b/src/core/xsl/entity_palette.xsl @@ -3,11 +3,6 @@ <xsl:output method="html"/> <xsl:template match="/Response"> - <div class="list-group list-group-flush"> - <div class="list-group-item btn-group-vertical caosdb-v-editmode-btngroup caosdb-f-edit-mode-create-buttons"> - <button type="button" class="btn btn-secondary caosdb-f-edit-panel-new-button new-property">Create Property</button> - <button type="button" class="btn btn-secondary caosdb-f-edit-panel-new-button new-recordtype">Create RecordType</button> - </div> <div title="Drag and drop Properties from this panel to the Entities on the left." class="caosdb-v-editmode-existing caosdb-f-edit-mode-existing d-none"> <div class="card-header"> <h6>Existing Properties</h6> @@ -35,7 +30,6 @@ <xsl:apply-templates select="./RecordType"/> </ul> </div> - </div> </div> </xsl:template> diff --git a/src/core/xsl/main.xsl b/src/core/xsl/main.xsl index 238f790fdcd93816d36adf35886e162575df9aa3..8dcaaa0157cd1730c4e14517bcde8f5c44c2a38a 100644 --- a/src/core/xsl/main.xsl +++ b/src/core/xsl/main.xsl @@ -120,7 +120,14 @@ <div class="card-header"> <span class="card-title">Edit Mode Toolbox</span> </div> - <div class="caosdb-f-edit-panel-body"></div> + <div class="caosdb-f-edit-panel-body"> + <div class="list-group list-group-flush"> + <div class="list-group-item btn-group-vertical caosdb-v-editmode-btngroup caosdb-f-edit-mode-create-buttons"> + <button type="button" class="btn btn-secondary caosdb-f-edit-panel-new-button new-property">Create Property</button> + <button type="button" class="btn btn-secondary caosdb-f-edit-panel-new-button new-recordtype">Create RecordType</button> + </div> + </div> + </div> </div> </div> </div>