diff --git a/backend/src/app/rpc/commands/audit.clj b/backend/src/app/rpc/commands/audit.clj index 5db758b464..6af5f5b62a 100644 --- a/backend/src/app/rpc/commands/audit.clj +++ b/backend/src/app/rpc/commands/audit.clj @@ -77,10 +77,19 @@ (when (seq events) (db/insert-many! pool :audit-log event-columns events)))) +(def valid-event-types + #{"action" "identify"}) + (def schema:event [:map {:title "Event"} - [:name [:string {:max 250}]] - [:type [:string {:max 250}]] + [:name + [:and {:gen/elements ["update-file", "get-profile"]} + [:string {:max 250}] + [:re #"[\d\w-]{1,50}"]]] + [:type + [:and {:gen/elements valid-event-types} + [:string {:max 250}] + [::sm/one-of {:format "string"} valid-event-types]]] [:props [:map-of :keyword :any]] [:context {:optional true} diff --git a/common/src/app/common/logic/libraries.cljc b/common/src/app/common/logic/libraries.cljc index ccc2f5d340..595ed57261 100644 --- a/common/src/app/common/logic/libraries.cljc +++ b/common/src/app/common/logic/libraries.cljc @@ -265,6 +265,10 @@ ; If the initial shape was component-root, first level subinstances are converted in top instances (pcb/update-shapes [shape-id] #(assoc % :component-root true)) + :always + ; First level subinstances of a detached component can't have swap-slot + (pcb/update-shapes [shape-id] ctk/remove-swap-slot) + :always ; Near shape-refs need to be advanced one level (generate-advance-nesting-level nil container libraries (:id shape)))