Remove yarn warnings from portal-ui (#1207)
Signed-off-by: Lenin Alevski <alevsk.8772@gmail.com>
This commit is contained in:
@@ -78,4 +78,5 @@ var BucketAdminRole = iampolicy.NewActionSet(
|
||||
iampolicy.ReplicateTagsAction,
|
||||
iampolicy.GetObjectVersionForReplicationAction,
|
||||
iampolicy.AllActions,
|
||||
iampolicy.AllAdminActions,
|
||||
)
|
||||
|
||||
@@ -136,7 +136,7 @@ const AccessDetails = ({
|
||||
setLoadingUsers(false);
|
||||
}
|
||||
}
|
||||
}, [loadingUsers, setErrorSnackMessage, bucketName]);
|
||||
}, [loadingUsers, setErrorSnackMessage, bucketName, displayUsersList]);
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingPolicies) {
|
||||
@@ -156,7 +156,7 @@ const AccessDetails = ({
|
||||
setLoadingPolicies(false);
|
||||
}
|
||||
}
|
||||
}, [loadingPolicies, setErrorSnackMessage, bucketName]);
|
||||
}, [loadingPolicies, setErrorSnackMessage, bucketName, displayPoliciesList]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
||||
@@ -81,7 +81,6 @@ const AddReplicationModal = ({
|
||||
const [useTLS, setUseTLS] = useState<boolean>(true);
|
||||
const [repDeleteMarker, setRepDeleteMarker] = useState<boolean>(true);
|
||||
const [repDelete, setRepDelete] = useState<boolean>(true);
|
||||
const [repMetadata, setRepMetadata] = useState<boolean>(true);
|
||||
const [tags, setTags] = useState<string>("");
|
||||
const [replicationMode, setReplicationMode] = useState<string>("async");
|
||||
const [bandwidthScalar, setBandwidthScalar] = useState<string>("100");
|
||||
@@ -116,7 +115,6 @@ const AddReplicationModal = ({
|
||||
tags: tags,
|
||||
replicateDeleteMarkers: repDeleteMarker,
|
||||
replicateDeletes: repDelete,
|
||||
replicateMetadata: repMetadata,
|
||||
};
|
||||
|
||||
api
|
||||
@@ -365,20 +363,6 @@ const AddReplicationModal = ({
|
||||
description={"Replicate versioned deletes"}
|
||||
/>
|
||||
</Grid>
|
||||
{/*TODO: This will be enabled later on when we update the dependency on mc*/}
|
||||
{/*<Grid item xs={12}>*/}
|
||||
{/* <FormSwitchWrapper*/}
|
||||
{/* checked={repMetadata}*/}
|
||||
{/* id="repMetadata"*/}
|
||||
{/* name="repMeta"*/}
|
||||
{/* label="Replicate Metadata"*/}
|
||||
{/* onChange={(e) => {*/}
|
||||
{/* setRepMetadata(e.target.checked);*/}
|
||||
{/* }}*/}
|
||||
{/* value={repMetadata}*/}
|
||||
{/* description={"Replicate object metadata"}*/}
|
||||
{/* />*/}
|
||||
{/*</Grid>*/}
|
||||
</Grid>
|
||||
<Grid item xs={12} className={classes.buttonContainer}>
|
||||
<Button
|
||||
|
||||
@@ -113,7 +113,7 @@ const BucketEventsPanel = ({
|
||||
setLoadingEvents(false);
|
||||
}
|
||||
}
|
||||
}, [loadingEvents, setErrorSnackMessage, bucketName]);
|
||||
}, [loadingEvents, setErrorSnackMessage, bucketName, displayEvents]);
|
||||
|
||||
const eventsDisplay = (events: string[]) => {
|
||||
return <Fragment>{events.join(", ")}</Fragment>;
|
||||
|
||||
@@ -111,7 +111,12 @@ const BucketLifecyclePanel = ({
|
||||
setLoadingLifecycle(false);
|
||||
}
|
||||
}
|
||||
}, [loadingLifecycle, setLoadingLifecycle, bucketName]);
|
||||
}, [
|
||||
loadingLifecycle,
|
||||
setLoadingLifecycle,
|
||||
bucketName,
|
||||
displayLifeCycleRules,
|
||||
]);
|
||||
|
||||
const closeEditLCAndRefresh = (refresh: boolean) => {
|
||||
setEditLifecycleOpen(false);
|
||||
|
||||
@@ -116,7 +116,12 @@ const BucketReplicationPanel = ({
|
||||
setLoadingReplication(false);
|
||||
}
|
||||
}
|
||||
}, [loadingReplication, setErrorSnackMessage, bucketName]);
|
||||
}, [
|
||||
loadingReplication,
|
||||
setErrorSnackMessage,
|
||||
bucketName,
|
||||
displayReplicationRules,
|
||||
]);
|
||||
|
||||
const closeAddReplication = () => {
|
||||
setOpenReplicationOpen(false);
|
||||
|
||||
@@ -261,7 +261,7 @@ const BucketSummary = ({
|
||||
setLoadingEncryption(false);
|
||||
}
|
||||
}
|
||||
}, [loadingEncryption, bucketName]);
|
||||
}, [loadingEncryption, bucketName, displayGetBucketEncryptionConfiguration]);
|
||||
|
||||
useEffect(() => {
|
||||
if (loadingVersioning && distributedSetup) {
|
||||
@@ -308,6 +308,7 @@ const BucketSummary = ({
|
||||
setErrorSnackMessage,
|
||||
bucketName,
|
||||
distributedSetup,
|
||||
displayGetBucketQuota,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -333,6 +334,7 @@ const BucketSummary = ({
|
||||
bucketName,
|
||||
loadingVersioning,
|
||||
distributedSetup,
|
||||
displayGetBucketObjectLockConfiguration,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -97,7 +97,6 @@ import ShareFile from "../ObjectDetails/ShareFile";
|
||||
import { displayComponent } from "../../../../../../utils/permissions";
|
||||
import {
|
||||
S3_DELETE_OBJECT,
|
||||
S3_GET_OBJECT,
|
||||
S3_LIST_BUCKET,
|
||||
S3_PUT_OBJECT,
|
||||
} from "../../../../../../types";
|
||||
@@ -295,10 +294,6 @@ const ListObjects = ({
|
||||
S3_PUT_OBJECT,
|
||||
]);
|
||||
|
||||
const displayGetObject = displayComponent(bucketInfo?.allowedActions, [
|
||||
S3_GET_OBJECT,
|
||||
]);
|
||||
|
||||
const displayDeleteObject = displayComponent(bucketInfo?.allowedActions, [
|
||||
S3_DELETE_OBJECT,
|
||||
]);
|
||||
@@ -363,7 +358,14 @@ const ListObjects = ({
|
||||
setLoadingVersioning(false);
|
||||
}
|
||||
}
|
||||
}, [bucketName, loadingVersioning, setErrorSnackMessage]);
|
||||
}, [
|
||||
bucketName,
|
||||
loadingVersioning,
|
||||
setErrorSnackMessage,
|
||||
bucketInfo?.allowedActions,
|
||||
bucketInfo?.name,
|
||||
displayListObjects,
|
||||
]);
|
||||
|
||||
// Rewind
|
||||
useEffect(() => {
|
||||
@@ -555,6 +557,7 @@ const ListObjects = ({
|
||||
internalPaths,
|
||||
setFileModeEnabled,
|
||||
bucketInfo,
|
||||
displayListObjects,
|
||||
]);
|
||||
|
||||
// bucket info
|
||||
|
||||
@@ -110,6 +110,15 @@ const styles = (theme: Theme) =>
|
||||
textDecoration: "underline !important",
|
||||
color: theme.palette.info.main,
|
||||
},
|
||||
linkButton: {
|
||||
fontFamily: '"Lato", sans-serif',
|
||||
fontWeight: "normal",
|
||||
textTransform: "none",
|
||||
fontSize: "inherit",
|
||||
height: 0,
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
},
|
||||
tableContainer: {
|
||||
marginLeft: 28,
|
||||
},
|
||||
@@ -579,12 +588,15 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
||||
sure it remains free software for all its users.
|
||||
</Typography>
|
||||
<div className={classes.linkMore}>
|
||||
<a
|
||||
className={clsx(classes.link)}
|
||||
<Button
|
||||
variant="text"
|
||||
color="primary"
|
||||
size="small"
|
||||
className={clsx(classes.link, classes.linkButton)}
|
||||
onClick={() => setLicenseModal(true)}
|
||||
>
|
||||
Read more
|
||||
</a>
|
||||
</Button>
|
||||
</div>
|
||||
</Grid>
|
||||
</Fragment>
|
||||
@@ -797,12 +809,18 @@ const License = ({ classes, operatorMode }: ILicenseProps) => {
|
||||
<Fragment>
|
||||
{item.communityLink !== undefined &&
|
||||
item.communityLink ? (
|
||||
<a
|
||||
className={classes.link}
|
||||
<Button
|
||||
variant="text"
|
||||
color="primary"
|
||||
size="small"
|
||||
className={clsx(
|
||||
classes.link,
|
||||
classes.linkButton
|
||||
)}
|
||||
onClick={() => setLicenseModal(true)}
|
||||
>
|
||||
{item.community}
|
||||
</a>
|
||||
</Button>
|
||||
) : (
|
||||
item.community
|
||||
)}
|
||||
|
||||
@@ -551,7 +551,6 @@ func getPolicyActionSetForBucket(bucketName string, statement []minioIAMPolicy.S
|
||||
bucketNameARN := fmt.Sprintf("arn:aws:s3:::%s/*", bucketName)
|
||||
for _, st := range statement {
|
||||
if st.Effect == "Allow" {
|
||||
|
||||
if len(st.Resources.ToSlice()) == 0 {
|
||||
mergedActions := append(bucketActions.ToSlice(), st.Actions.ToSlice()...)
|
||||
bucketActions = minioIAMPolicy.NewActionSet(mergedActions...)
|
||||
|
||||
@@ -85,17 +85,6 @@ func getSessionResponse(session *models.Principal) (*models.SessionResponse, *mo
|
||||
return nil, prepareError(err, errorGenericInvalidSession)
|
||||
}
|
||||
userAdminClient := AdminClient{Client: mAdminClient}
|
||||
// Policy used by the current user
|
||||
accountInfo, err := userAdminClient.AccountInfo(ctx)
|
||||
if err != nil {
|
||||
return nil, prepareError(err)
|
||||
}
|
||||
|
||||
var sessionPolicy *models.IamPolicy
|
||||
err = json.Unmarshal(accountInfo.Policy, &sessionPolicy)
|
||||
if err != nil {
|
||||
return nil, prepareError(err)
|
||||
}
|
||||
// Obtain the current policy assigned to this user
|
||||
// necessary for generating the list of allowed endpoints
|
||||
policy, err := getAccountPolicy(ctx, userAdminClient)
|
||||
@@ -110,7 +99,15 @@ func getSessionResponse(session *models.Principal) (*models.SessionResponse, *mo
|
||||
if policy != nil {
|
||||
actions = acl.GetActionsStringFromPolicy(policy)
|
||||
}
|
||||
|
||||
rawPolicy, err := json.Marshal(policy)
|
||||
if err != nil {
|
||||
return nil, prepareError(err, errorGenericInvalidSession)
|
||||
}
|
||||
var sessionPolicy *models.IamPolicy
|
||||
err = json.Unmarshal(rawPolicy, &sessionPolicy)
|
||||
if err != nil {
|
||||
return nil, prepareError(err)
|
||||
}
|
||||
sessionResp := &models.SessionResponse{
|
||||
Pages: acl.GetAuthorizedEndpoints(actions),
|
||||
Features: getListOfEnabledFeatures(),
|
||||
|
||||
Reference in New Issue
Block a user