Added Loader in rewind enable function (#2172)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2022-07-18 15:39:14 -05:00
committed by GitHub
parent ce3293b4e2
commit aea749d82f
8 changed files with 164 additions and 3 deletions

View File

@@ -951,6 +951,85 @@ jobs:
with:
args: '"chrome:headless" portal-ui/tests/permissions-8/ --skip-js-errors'
all-permissions-9:
name: Permissions Tests Part 9
needs:
- lint-job
- no-warnings-and-make-assets
- reuse-golang-dependencies
- vulnerable-dependencies-checks
- semgrep-static-code-analysis
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ 1.18.x ]
os: [ ubuntu-latest ]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
name: Yarn Cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./portal-ui/node_modules/
./portal-ui/build/
key: ${{ runner.os }}-yarn-${{ hashFiles('./portal-ui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v2
id: assets-cache
name: Assets Cache
with:
path: |
./portal-ui/build/
key: ${{ runner.os }}-assets-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-assets-
- uses: actions/cache@v2
name: Go Mod Cache
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ github.run_id }}
- name: Build Console on ${{ matrix.os }}
env:
GO111MODULE: on
GOOS: linux
run: |
make console
- name: Start Console, front-end app and initialize users/policies
run: |
(./console server) & (make initialize-permissions)
- name: Run TestCafe Tests
uses: DevExpress/testcafe-action@latest
with:
args: '"chrome:headless" portal-ui/tests/permissions-9/ --skip-js-errors -c 3'
- name: Clean up users & policies
run: |
make cleanup-permissions
all-operator-tests:
name: Operator UI Tests
needs:

View File

@@ -1416,7 +1416,7 @@ const ListObjects = () => {
}}
disabled={
!isVersioned ||
!hasPermission(bucketName, [IAM_SCOPES.S3_PUT_OBJECT])
!hasPermission(bucketName, [IAM_SCOPES.S3_GET_OBJECT])
}
/>
<RBIconButton

View File

@@ -24,6 +24,7 @@ import FormSwitchWrapper from "../../../../Common/FormComponents/FormSwitchWrapp
import { AppState, useAppDispatch } from "../../../../../../store";
import {
resetRewind,
setLoadingObjectsList,
setRewindEnable,
} from "../../../../ObjectBrowser/objectBrowserSlice";
@@ -71,6 +72,8 @@ const RewindEnable = ({
})
);
}
dispatch(setLoadingObjectsList(true));
closeModalAndRefresh();
};
@@ -114,6 +117,7 @@ const RewindEnable = ({
color="primary"
disabled={rewindEnabling || (!dateSelected && rewindEnableButton)}
onClick={rewindApply}
id={"rewind-apply-button"}
>
{!rewindEnableButton && rewindEnabled
? "Show Current Data"

View File

@@ -779,7 +779,7 @@ const TableWrapper = ({
) : (
<Fragment>
{!isLoading && (
<div>
<div id={"empty-results"}>
{customEmptyMessage !== ""
? customEmptyMessage
: `There are no ${entityName} yet.`}

View File

@@ -1 +1 @@
1653008276
1657924012

View File

@@ -89,7 +89,9 @@ test
await t
.useRole(roles.bucketRead)
.navigateTo("http://localhost:9090/buckets")
.wait(2000)
.click(testBucketBrowseButtonFor("bucketread3"))
.wait(2000)
.expect(elements.table.exists)
.ok();
})

View File

@@ -0,0 +1,57 @@
// This file is part of MinIO Console Server
// Copyright (c) 2022 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import * as roles from "../utils/roles";
import * as elements from "../utils/elements";
import * as functions from "../utils/functions";
import { testBucketBrowseButtonFor } from "../utils/functions";
fixture("Rewind Testing").page("http://localhost:9090");
test
.before(async (t) => {
// Create a bucket
await functions.setUpBucket(t, "abucketrewind");
await functions.setVersioned(t, "abucketrewind");
await t
.useRole(roles.bucketReadWrite)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("abucketrewind"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("abucketrewind"))
// Upload object to bucket
.setFilesToUpload(elements.uploadInput, "../uploads/test.txt")
.wait(1000);
})("Rewind works in bucket", async (t) => {
await t
.useRole(roles.bucketReadWrite)
.navigateTo("http://localhost:9090/buckets")
.click(testBucketBrowseButtonFor("abucketrewind"))
.expect(elements.table.exists)
.ok()
.click(elements.rewindButton)
.expect(elements.rewindToInput.exists)
.ok()
.typeText(elements.rewindToInput, "01/01/2015 00:00")
.click(elements.rewindDataButton);
})
.after(async (t) => {
// Cleanup created bucket and corresponding uploads
await functions.cleanUpBucketAndUploads(t, "abucketrewind");
});

View File

@@ -214,3 +214,22 @@ export const nodeSelector = Selector('[data-test-id="node-selector"]');
// User Details
//----------------------------------------------------
export const userPolicies = Selector(".MuiTab-root").withText("Policies");
//----------------------------------------------------
// Rewind Options
//----------------------------------------------------
export const rewindButton = Selector("button").withAttribute(
"id",
"rewind-objects-list"
);
export const rewindToInput = Selector("input").withAttribute(
"id",
"rewind-selector"
);
export const rewindDataButton = Selector("button").withAttribute(
"id",
"rewind-apply-button"
);
export const locationEmpty = Selector("div").withAttribute(
"id",
"empty-results"
);