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

remove genomics operation api for security reasons #1524

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/cljs/main/broadfcui/endpoints.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@
{:path (str "/workspaces/" (id-path workspace-id) "/setAttributes")
:method :patch})

(defn get-workspace-genomic-operations [workspace-id job-id]
{:path (str "/workspaces/" (id-path workspace-id) "/genomics/operations/" job-id)
:method :get})

(defn import-entities [workspace-id]
{:path (str "/workspaces/" (id-path workspace-id) "/importEntities")
:method :post})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,37 +207,6 @@
:else elem))
(:data props))}])])})

(react/defc- OperationDialog
{:render
(fn [{:keys [props state]}]
[modals/OKCancelForm
{:header "Operation Details"
:content
(let [server-response (:server-response @state)]
(cond
(nil? server-response)
(spinner "Loading operation details...")
(not (:success? server-response))
(style/create-server-error-message (:response server-response))
:else
[CodeMirror {:text (:raw-response server-response)}]))
:show-cancel? false
:dismiss (:dismiss props)
:ok-button {:text "Done" :onClick #((:dismiss props))}}])

:component-did-mount
(fn [{:keys [props state]}]
(endpoints/call-ajax-orch
{:endpoint
(endpoints/get-workspace-genomic-operations
;; strip out operations/ from the job id
(:workspace-id props) (last (string/split (:job-id props) #"/")))
:on-done (fn [{:keys [success? get-parsed-response status-text raw-response]}]
(swap! state assoc :server-response
{:success? success?
:response (if success? (get-parsed-response false) status-text)
:raw-response raw-response}))}))})

(defn- render-gcs-path [components]
(str moncommon/google-storage-context (string/join "/" components) "/"))

Expand All @@ -257,8 +226,6 @@
workspace-namespace (get-in props [:workspace-id :namespace])
{:keys [label inputs-fn inputs-data outputs-fn outputs-data]} props]
[:div {:style {:marginTop "1em"}}
(when (:show-operation-dialog? @state)
[OperationDialog (:operation-dialog-props @state)])
[:div {:style {:display "inline-block" :marginRight "1em"}}
(moncommon/icons-for-call-statuses all-call-statuses)
(links/create-external {:href (render-gcs-path call-path-components)} (:label props))]
Expand Down Expand Up @@ -294,16 +261,7 @@
"Show"))]
(str "Call #" (inc index) ":"))]
[:div {:style {:paddingLeft "0.5em"}}
(create-field "Operation"
;; Note: using [:a ...] instead of style/create-link to be consistent with FilePreviewLink
[:a {:href "javascript:;"
:onClick (fn [_]
(swap! state assoc
:show-operation-dialog? true
:operation-dialog-props {:workspace-id (:workspace-id props)
:job-id (data "jobId")
:dismiss #(swap! state dissoc :show-operation-dialog?)}))}
(data "jobId")])
(create-field "Operation" (data "jobId"))
(let [status (data "executionStatus")]
(create-field "Status" (moncommon/icon-for-call-status status) status))
(when (and (:use-call-cache props) (some? (get (data "callCaching") "hit")))
Expand Down