Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In UI namespace
- (defprotocol CRUD
- "Create/read/update/delete operations on katello entities via the UI"
- (create [x] "Create an entity in the UI")
- (read [x] "Get details on an entity from the UI")
- (update* [x new-x] "Change an existing entity in UI, from x to new-x")
- (delete [x] "Delete an existing entity in the UI"))
- In environments namespace.
- (defn- create
- "Creates an environment with the given name, and a map containing
- the organization name to create the environment in, the prior
- environment, and an optional description."
- [{:keys [name label org description prior]}]
- (nav/go-to ::new-page org)
- (sel/fill-ajax-form {::name-text name
- (fn [label] (when label
- (browser fireEvent ::name-text "blur")
- (browser ajaxWait)
- (browser setText ::label-text label))) [label]
- ::description-text description
- ::prior (:name prior)}
- ::create)
- (notification/success-type :env-create))
- (defn only-katello [task]
- (if (rest/is-headpin?)
- task
- ;; how to implement code for no-op??))
- (extend katello.Environment
- ui/CRUD {:create (only-katello #'create)
- :update* edit
- :delete delete}
- Question :- What could I be missing in (only-katello function ?
- Error faced :- IllegalArgumentException No implementation of method: :create of protocol: #'katello.ui/CRUD found for class: katello.Environment clojure.core/-cache-protocol-fn (core_deftype.clj:541)
- While trying the beow.
- => (def env11 (first katello.conf/*environments*))
- #'user/env11
- => env11
- #katello.Environment{:id nil, :name "Development", :label nil, :description nil, :org #katello.Organization{:id nil, :name "ACME_Corporation", :label nil, :description nil, :initial-env nil}, :prior #katello.Environment{:id nil, :name "Library", :label nil, :description nil, :org #katello.Organization{:id nil, :name "ACME_Corporation", :label nil, :description nil, :initial-env nil}, :prior nil, :next nil}, :next nil}
- => (katello.ui/create env11)
- IllegalArgumentException No implementation of method: :create of protocol: #'katello.ui/CRUD found for class: katello.Environment clojure.core/-cache-protocol-fn (core_deftype.clj:541)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement