Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete button not working on Schema item #468

Open
gsambrotta opened this issue Apr 16, 2024 · 0 comments
Open

Delete button not working on Schema item #468

gsambrotta opened this issue Apr 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gsambrotta
Copy link
Collaborator

Bug description
User cannot delete an item from the list of items belonging to certain Kendraio Schema.

1_ list of items in schema
image
2_ Open "item1" and click "Delete button"
image
3_ Check list of Schema again, "item1" is still there
image

Reproduction steps

  1. Go to https://app.kendra.io/schemas/list
  2. Click on "Items" button of anyone of your already present Schema. If no schema is present in the list, you will need to create a test schema first.
  3. Now click on "Edit" of any item in the items list
  4. Click on "Delete" button
  5. Go back to schema's Items list and you will see that the deleted item is still there.

Expected behaviour

Flow Configuration

{ "title": "Edit Item", "blocks": [ { "type": "init" }, { "type": "db", "operation": "fetch", "adapterName": "schemas", "schema": "schemas", "uuidGetter": "context.queryParams.schemaId", "blockComment": "Get schema from DB ( schemaId from page URL)" }, { "type": "mapping", "mapping": "data && data[0]", "blockComment": "Get main data, strips metadata" }, { "type": "context-save", "contextKey": "schema", "blockComment": "Saves to context.schema" }, { "type": "db", "operation": "fetch", "adapterName": "schemas", "uuidGetter": "context.queryParams.id", "blockComment": "Get record from DB if exists" }, { "type": "mapping", "mapping": "data && data[0]", "blockComment": "Get record data (strip metadata)" }, { "type": "context-save", "contextKey": "saved", "blockComment": "Saves existing record as \"context.saved\"" }, { "type": "mapping", "mapping": "data || { uuid: context.queryParams.id }", "blockComment": "If no record exists, makes new empty object with UUID from URL" }, { "type": "context-save", "key": "state.local.uuid", "valueGetter": "data.uuid", "blockComment": "Saves record UUID to state.local.uuid" }, { "type": "context-save", "key": "state.local.update", "valueGetter": "length([context.saved][?uuid==$.data.uuid])>0", "blockComment": "set update flag" }, { "type": "debug", "open": 2, "showContext": false, "showState": false, "blockComment": "Show existing record, or empty new record" }, { "type": "form", "label": "Save", "hasSubmit": false, "schemaGetter": { "blocks": [ { "type": "load-schema", "adapterName": "schemas", "schemaGetter": "context.schema && context.schema.name" } ] }, "injectContext": false, "blockComment": "Form populated by load-schema and existing record data if exists" }, { "type": "context-save", "key": "state.global.record", "valueGetter": "data", "blockComment": "Saves latest record to state.global.record" }, { "type": "debug", "open": 1, "showData": true, "showContext": false, "showState": false, "blockComment": "See form record output" }, { "type": "actions", "buttons": [ { "label": "Back to item list", "color": "default", "blocks": [ { "type": "launch", "adapter": "schemas", "workflowId": "itemsFromSchemaId", "context": { "schemaId": "context.queryParams.schemaId" } } ], "enabled": true }, { "enabledGetter": "!(state.local.update)", "label": "Add new entry", "color": "primary", "blocks": [ { "type": "db", "operation": "add", "adapterName": "schemas", "schemaGetter": "context.schema.name" } ], "enabled": false }, { "label": "Update entry", "color": "primary", "enabledGetter": "state.local.update", "blocks": [ { "type": "mapping", "mapping": "merge(data, { uuid: $.state.local.uuid })" }, { "type": "db", "operation": "update", "adapterName": "schemas", "schemaGetter": "context.schema.name" } ], "enabled": true }, { "label": "Delete", "color": "warn", "blocks": [ { "type": "db", "operation": "delete", "adapterName": "schemas", "uuidGetter": "context.queryParams.id" }, { "type": "launch", "adapter": "schemas", "workflowId": "itemsFromSchemaId", "context": { "schemaId": "context.queryParams.schemaId" } } ], "enabled": true } ], "blockComment": "Action buttons for item (adding/updating/deletion)" }, { "type": "mapping", "mapping": "state.global.record", "blockComment": "Load state.global.record back" }, { "type": "load-schema", "templateToSchema": { "convertables": { "websitemodel": "website-content", "pagemodel": "page-content", "blockmodel": "block-content" }, "blockTypeDefaults": { "c2d03aa9-7f2e-4c3c-b66a-024c5656bb21": { "type": "object", "properties": { "name": { "type": "string", "default": "Image", "readOnly": true, "title": "Image" }, "src": { "type": "string", "title": "Image URL" } } }, "b3566261-654b-4743-b219-86bf05d595f5": { "type": "object", "properties": { "name": { "type": "string", "default": "Text", "readOnly": true, "title": "Text" }, "content": { "type": "string", "title": "Text content" } } }, "c35dc4d1-aad2-4506-a003-2a1ecd445183": { "type": "object", "properties": { "name": { "type": "string", "default": "Video", "readOnly": true, "title": "Video" }, "src": { "type": "string", "title": "Video URL" } } } } }, "blockComment": "Transforms content-management-system template data to input content" }, { "type": "debug", "open": 1, "showData": true, "showContext": false, "showState": true, "blockComment": "See meta-schema output" }, { "type": "context-save", "key": "state.global.metaschema", "blockComment": "" }, { "type": "actions", "buttons": [ { "label": "Save metaschema", "color": "default", "blocks": [ { "type": "mapping", "mapping": "{ uuid: uuid(json(data)), schema: data, parentSchemaId: context.queryParams.schemaId, parentRecordId: context.queryParams.id, parentSchema:context.schema }" }, { "type": "db", "operation": "upsert", "adapterName": "schemas", "schema": "metaschemas" } ], "enabled": true }, { "label": "List Meta-Schemas", "color": "default", "blocks": [ { "type": "launch", "adapter": "schemas", "workflowId": "metaschemaList" } ], "enabled": true } ], "blockComment": "metaschema save and list buttons" }, { "type": "mapping", "mapping": "json(state.global.metaschema)", "blockComment": "Makes meta-schema output a JSON string" }, { "type": "template", "template": "{{{data}}}", "blockComment": "See meta-schema output as a copy-pasteable string" } ], "id": "editItem", "adapterName": "schemas" }

Runtime environment

  • OS: Ubuntu 24.4
  • Browser: Firefox
  • App version:
  • Angular Version: 15 and 16

Additional context

@gsambrotta gsambrotta added the bug Something isn't working label Apr 16, 2024
@gsambrotta gsambrotta self-assigned this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant