Skip to content

Commit

Permalink
object-storage: fix rails routes
Browse files Browse the repository at this point in the history
  • Loading branch information
andypf committed May 8, 2024
1 parent 739c8ec commit d1302e9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 35 deletions.
32 changes: 16 additions & 16 deletions e2e/cypress/integration/admin/shared_object_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe("shared object storage", () => {
})

it("open object storage and check create container button", () => {
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/`)
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/swift/`)
cy.contains("[data-test=page-title]", "Object Storage")
cy.contains("a", "Create container").click()
cy.contains(
Expand All @@ -18,7 +18,7 @@ describe("shared object storage", () => {
})

it("open object storage and check capabilities dialog", () => {
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/`)
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/swift/`)
cy.contains("[data-test=page-title]", "Object Storage")
cy.get("i.fa-info-circle").click()
cy.contains("Capabilities")
Expand All @@ -28,7 +28,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/access-control`
)}/admin/object-storage/swift/containers/elektra-test/access-control`
)
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(3000)
Expand All @@ -47,7 +47,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/properties`
)}/admin/object-storage/swift/containers/elektra-test/properties`
)
cy.get('[data-test="metaDataKey_0"]').type("{selectAll}footestkey")
cy.get('[data-test="metaDataValue_0"]').type("{selectAll}footestvalue")
Expand All @@ -57,7 +57,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/properties`
)}/admin/object-storage/swift/containers/elektra-test/properties`
)
// check value and delete
cy.get('[data-test="metaDataValue_0"]')
Expand All @@ -72,7 +72,7 @@ describe("shared object storage", () => {
})

it("open object storage and elektra-test container and check action buttons", () => {
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/`)
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/swift/`)
cy.contains("[data-test=page-title]", "Object Storage")
cy.contains("a", "elektra-test").click()
cy.contains("a", "Create folder").click()
Expand All @@ -87,7 +87,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/show`
)}/admin/object-storage/swift/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/show`
)
cy.get('[data-test="metaDataKey_0"]').type("{selectAll}footestkey")
cy.get('[data-test="metaDataValue_0"]').type("{selectAll}footestvalue")
Expand All @@ -97,7 +97,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/show`
)}/admin/object-storage/swift/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/show`
)
// check value and delete
cy.get('[data-test="metaDataValue_0"]')
Expand All @@ -115,7 +115,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/copy`
)}/admin/object-storage/swift/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/copy`
)
cy.contains("Target container")
cy.contains("Target path")
Expand All @@ -126,7 +126,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/move`
)}/admin/object-storage/swift/containers/elektra-test/objects/X18kPQ%3D%3D/amiga.jpg/move`
)
cy.contains("Target container")
cy.contains("Target path")
Expand All @@ -137,7 +137,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/empty`
)}/admin/object-storage/swift/containers/elektra-test/empty`
)
cy.contains("button", "Empty").should("be.disabled")
cy.contains(
Expand All @@ -153,7 +153,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test-empty/empty`
)}/admin/object-storage/swift/containers/elektra-test-empty/empty`
)
cy.contains("Nothing to do. Container is already empty.").click()
})
Expand All @@ -162,7 +162,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test/delete`
)}/admin/object-storage/swift/containers/elektra-test/delete`
)
cy.contains(
"Cannot delete Container contains objects. Please empty it first."
Expand All @@ -174,7 +174,7 @@ describe("shared object storage", () => {
cy.visit(
`/${Cypress.env(
"TEST_DOMAIN"
)}/admin/object-storage/containers/elektra-test-empty/delete`
)}/admin/object-storage/swift/containers/elektra-test-empty/delete`
)
cy.contains("button", "Delete").should("be.disabled")
cy.contains(
Expand All @@ -190,7 +190,7 @@ describe("shared object storage", () => {
})

it("open object storage and elektra-test container and check download big files dialog", () => {
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/`)
cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/swift/`)
cy.contains("[data-test=page-title]", "Object Storage")
cy.contains("a", "elektra-test").click()
// force: true prevents this error:
Expand All @@ -201,7 +201,7 @@ describe("shared object storage", () => {

// this is not working because popper is not rendering correctly
// it("open object storage and search elektra-test to test dialogs", () => {
// cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/`)
// cy.visit(`/${Cypress.env("TEST_DOMAIN")}/admin/object-storage/swift/`)
// cy.get('[data-test="search"]').type("elektra-test-empty")
// cy.get('[data-test="dropdown"]').click()
// cy.contains("a", "Empty").click()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

module ObjectStorage
class ApplicationController < ::DashboardController
# def swift
# @service_name = "swift"
# byebug
# render :show
# end

# def ceph
# @service_name = "ceph"
# render :show
# end

def show
@service_name = params[:service_name]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,11 @@ const useActions = () => {
[]
)

const getAcls = React.useCallback(
({ read, write }) =>
apiClient
.get("check-acls", { params: { read, write } })
.then((result) => result.data),
[]
)
const getAcls = React.useCallback(({ read, write }) => {
return apiClient
.get(`check-acls`, { params: { read, write } })
.then((result) => result.data)
}, [])
const endpointURL = React.useCallback(
(containerName, name, params = {}) => {
return apiClient
Expand Down
2 changes: 1 addition & 1 deletion plugins/object_storage/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# root to: "application#swift", as: :widget

# get "check-acls" => "application#check_acls"
get "check-acls" => "application#check_acls"

# # catch all other paths and point them to root
# get "swift/*path", to: "application#swift"
Expand Down

0 comments on commit d1302e9

Please sign in to comment.