Securizing bucket tags (#1249)
This commit is contained in:
@@ -617,43 +617,63 @@ const BucketSummary = ({
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</SecureComponent>
|
</SecureComponent>
|
||||||
<tr>
|
<SecureComponent
|
||||||
<td className={classes.titleCol}>Tags:</td>
|
scopes={[IAM_SCOPES.S3_GET_BUCKET_TAGGING]}
|
||||||
<td>
|
resource={bucketName}
|
||||||
{tagKeys &&
|
>
|
||||||
tagKeys.map((tagKey: any, index: any) => {
|
<tr>
|
||||||
const tag = get(tags, `${tagKey}`, "");
|
<td className={classes.titleCol}>Tags:</td>
|
||||||
if (tag !== "") {
|
<td>
|
||||||
return (
|
{tagKeys &&
|
||||||
<Chip
|
tagKeys.map((tagKey: any, index: any) => {
|
||||||
key={`chip-${index}`}
|
const tag = get(tags, `${tagKey}`, "");
|
||||||
className={classes.tag}
|
if (tag !== "") {
|
||||||
size="small"
|
return (
|
||||||
label={`${tagKey} : ${tag}`}
|
<SecureComponent
|
||||||
color="primary"
|
key={`chip-${index}`}
|
||||||
deleteIcon={<CloseIcon />}
|
scopes={[IAM_SCOPES.S3_PUT_BUCKET_TAGGING]}
|
||||||
onDelete={() => {
|
resource={bucketName}
|
||||||
deleteTag(tagKey, tag);
|
matchAll
|
||||||
}}
|
errorProps={{
|
||||||
/>
|
deleteIcon: null,
|
||||||
);
|
onDelete: null,
|
||||||
}
|
}}
|
||||||
return null;
|
>
|
||||||
})}
|
<Chip
|
||||||
<Chip
|
className={classes.tag}
|
||||||
className={classes.tag}
|
size="small"
|
||||||
icon={<AddIcon />}
|
label={`${tagKey} : ${tag}`}
|
||||||
clickable
|
color="primary"
|
||||||
size="small"
|
deleteIcon={<CloseIcon />}
|
||||||
label="Add tag"
|
onDelete={() => {
|
||||||
color="primary"
|
deleteTag(tagKey, tag);
|
||||||
variant="outlined"
|
}}
|
||||||
onClick={() => {
|
/>
|
||||||
setTagModalOpen(true);
|
</SecureComponent>
|
||||||
}}
|
);
|
||||||
/>
|
}
|
||||||
</td>
|
return null;
|
||||||
</tr>
|
})}
|
||||||
|
<SecureComponent
|
||||||
|
scopes={[IAM_SCOPES.S3_PUT_BUCKET_TAGGING]}
|
||||||
|
resource={bucketName}
|
||||||
|
>
|
||||||
|
<Chip
|
||||||
|
className={classes.tag}
|
||||||
|
icon={<AddIcon />}
|
||||||
|
clickable
|
||||||
|
size="small"
|
||||||
|
label="Add tag"
|
||||||
|
color="primary"
|
||||||
|
variant="outlined"
|
||||||
|
onClick={() => {
|
||||||
|
setTagModalOpen(true);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</SecureComponent>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</SecureComponent>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
Reference in New Issue
Block a user