Skip to content

Commit

Permalink
RANGER-4643 : Upgrade react-bootstrap library for GDS UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhavaljrajpara committed May 8, 2024
1 parent ad51170 commit bf114e6
Show file tree
Hide file tree
Showing 17 changed files with 845 additions and 1,094 deletions.
27 changes: 5 additions & 22 deletions security-admin/src/main/webapp/react-webapp/src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2669,13 +2669,15 @@ li.list-group-item:hover {
}

.gds-request-content {
width: 920px;
margin: 0 auto;
width: 1020px;
margin-left: 120px;
margin-top: 40px;
}

.gds-access-content {
max-width: 1140px;
margin: 0 auto;
margin-left: 120px;
margin-top: 40px;
}

.gds-content-margin {
Expand Down Expand Up @@ -2923,25 +2925,6 @@ textarea.gds-placeholder::placeholder,
display: none; /* Hide the down arrow */
}

.gds-requested-status {
background: #ffc107;
}

.gds-granted-status {
background: #28a745;
color: #ffffff;
}

.gds-active-status {
background: #007bff;
color: #ffffff;
}

.gds-denied-status {
background: #dc3545;
color: #ffffff;
}

.w-50 {
width: 50% !important;
}
Expand Down
19 changes: 13 additions & 6 deletions security-admin/src/main/webapp/react-webapp/src/utils/XAEnums.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,8 @@ export const pluginStatusColumnInfoMsg = {
title: "Policy (Time details)",
lastUpdated: "Last update time of policies",
downloadTime: "Last policies download time (sync-up with Ranger).",
activeTime: "Last time the downloaded policies became active for enforcement.",
activeTime:
"Last time the downloaded policies became active for enforcement.",
downloadTimeDelayMsg:
"Latest update in policies are not yet downloaded (sync-up with Ranger).",
activationTimeDelayMsg:
Expand All @@ -918,9 +919,9 @@ export const pluginStatusColumnInfoMsg = {
GDS: {
title: "GDS (Time details)",
lastUpdated: "Last update time of GDS info.",
downloadTime:
"Last GDS info download time (sync-up with Ranger).",
activeTime: "Last time the downloaded GDS info became active for enforcement.",
downloadTime: "Last GDS info download time (sync-up with Ranger).",
activeTime:
"Last time the downloaded GDS info became active for enforcement.",
downloadTimeDelayMsg:
"Latest update in GDS info is not yet downloaded (sync-up with Ranger).",
activationTimeDelayMsg:
Expand All @@ -929,12 +930,18 @@ export const pluginStatusColumnInfoMsg = {
Role: {
title: "Role (Time details)",
lastUpdated: "Last updated time of roles.",
downloadTime:
"Last roles download time (sync-up with Ranger).",
downloadTime: "Last roles download time (sync-up with Ranger).",
activeTime: "Last time the downloaded roles became active for enforcement.",
downloadTimeDelayMsg:
"Latest update in roles are not yet downloaded (sync-up with Ranger).",
activationTimeDelayMsg:
"Latest update in roles are not yet active for enforcement."
}
};

export const statusClassMap = {
REQUESTED: "badge bg-warning",
GRANTED: "badge bg-success",
ACTIVE: "badge bg-primary",
DENIED: "badge bg-danger"
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
{val && val.previousValue && !isEmpty(val.previousValue) ? (
isEmpty(val.newValue) ? (
<h6>
<Badge className="d-inline mr-1" variant="danger">
<Badge className="d-inline me-1" bg="danger">
{getfilteredoldval(val.previousValue)}
</Badge>
</h6>
Expand All @@ -66,7 +66,7 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
{val && val.newValue && !isEmpty(val.newValue) ? (
isEmpty(val.previousValue) ? (
<h6>
<Badge className="d-inline mr-1" variant="success">
<Badge className="d-inline me-1" bg="success">
{getfilterednewval(val.newValue)}
</Badge>
</h6>
Expand All @@ -91,17 +91,20 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
<div>
{/* CREATE */}
{action == "create" &&
objectClassType == ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
objectClassType ==
ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
<div>
<div className="font-weight-bolder">Name : {objectName}</div>
<div className="font-weight-bolder">
Date: {dateFormat(createDate, "mm/dd/yyyy hh:MM:ss TT ")}
India Standard Time
</div>
<div className="font-weight-bolder">Created By: {owner}</div>
<h5 className="bold wrap-header m-t-sm">DataShareInDataset Detail:</h5>
<h5 className="bold wrap-header m-t-sm">
DataShareInDataset Detail:
</h5>

<Table className="table table-striped table-bordered w-50">
<Table className="table table-bordered w-50">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -114,10 +117,14 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
return (
<tbody>
<tr key={dataShareInDataset.id}>
<td className="table-warning">{dataShareInDataset.attributeName}</td>
<td className="table-warning">
{dataShareInDataset.attributeName}
</td>

<td className="table-warning">
{!isEmpty(dataShareInDataset.newValue) ? dataShareInDataset.newValue : "--"}
{!isEmpty(dataShareInDataset.newValue)
? dataShareInDataset.newValue
: "--"}
</td>
</tr>
</tbody>
Expand All @@ -130,7 +137,8 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
{/* UPDATE */}

{action == "update" &&
objectClassType == ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
objectClassType ==
ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
<div>
<div className="row">
<div className="col-md-6">
Expand All @@ -141,15 +149,17 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
</div>
<div className="font-weight-bolder">Updated By: {owner}</div>
</div>
<div className="col-md-6 text-right">
<div className="col-md-6 text-end">
<div className="bg-success legend"></div> {" Added "}
<div className="bg-danger legend"></div> {" Deleted "}
</div>
</div>
<br />
<h5 className="bold wrap-header m-t-sm">DataShareInDataset Detail:</h5>
<h5 className="bold wrap-header m-t-sm">
DataShareInDataset Detail:
</h5>

<Table className="table table-bordered table-striped w-75 ">
<Table className="table table-bordered w-75 ">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -164,7 +174,8 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
)}
{/* DELETE */}
{action == "delete" &&
objectClassType == ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
objectClassType ==
ClassTypes.CLASS_TYPE_RANGER_DATA_SHARE_IN_DATASET.value && (
<div>
<div className="font-weight-bolder">Name : {objectName}</div>
<div className="font-weight-bolder">
Expand All @@ -174,9 +185,11 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
<div className="font-weight-bolder">Created By: {owner} </div>
<div className="font-weight-bolder">Deleted By: {owner} </div>
<br />
<h5 className="bold wrap-header m-t-sm">DataShareInDataset Details:</h5>
<h5 className="bold wrap-header m-t-sm">
DataShareInDataset Details:
</h5>

<Table className="table table-striped table-bordered w-50">
<Table className="table table-bordered w-50">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -187,9 +200,13 @@ export const DataShareInDatasetLogs = ({ data, reportdata }) => {
return (
<tbody>
<tr>
<td className="table-warning">{dataShareInDataset.attributeName}</td>
<td className="table-warning">
{!isEmpty(dataShareInDataset.previousValue) ? dataShareInDataset.previousValue : "--"}
{dataShareInDataset.attributeName}
</td>
<td className="table-warning">
{!isEmpty(dataShareInDataset.previousValue)
? dataShareInDataset.previousValue
: "--"}
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DataShareLogs = ({ data, reportdata }) => {
{val && val.previousValue && !isEmpty(val.previousValue) ? (
isEmpty(val.newValue) ? (
<h6>
<Badge className="d-inline mr-1" variant="danger">
<Badge className="d-inline me-1" bg="danger">
{getfilteredoldval(val.previousValue)}
</Badge>
</h6>
Expand All @@ -66,7 +66,7 @@ export const DataShareLogs = ({ data, reportdata }) => {
{val && val.newValue && !isEmpty(val.newValue) ? (
isEmpty(val.previousValue) ? (
<h6>
<Badge className="d-inline mr-1" variant="success">
<Badge className="d-inline me-1" bg="success">
{getfilterednewval(val.newValue)}
</Badge>
</h6>
Expand Down Expand Up @@ -101,7 +101,7 @@ export const DataShareLogs = ({ data, reportdata }) => {
<div className="font-weight-bolder">Created By: {owner}</div>
<h5 className="bold wrap-header m-t-sm">DataShare Detail:</h5>

<Table className="table table-striped table-bordered w-50">
<Table className="table table-bordered w-50">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -114,10 +114,14 @@ export const DataShareLogs = ({ data, reportdata }) => {
return (
<tbody>
<tr key={dataShare.id}>
<td className="table-warning">{dataShare.attributeName}</td>
<td className="table-warning">
{dataShare.attributeName}
</td>

<td className="table-warning">
{!isEmpty(dataShare.newValue) ? dataShare.newValue : "--"}
{!isEmpty(dataShare.newValue)
? dataShare.newValue
: "--"}
</td>
</tr>
</tbody>
Expand All @@ -141,15 +145,15 @@ export const DataShareLogs = ({ data, reportdata }) => {
</div>
<div className="font-weight-bolder">Updated By: {owner}</div>
</div>
<div className="col-md-6 text-right">
<div className="col-md-6 text-end">
<div className="bg-success legend"></div> {" Added "}
<div className="bg-danger legend"></div> {" Deleted "}
</div>
</div>
<br />
<h5 className="bold wrap-header m-t-sm">DataShare Detail:</h5>

<Table className="table table-bordered table-striped w-75 ">
<Table className="table table-bordered w-75 ">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -176,7 +180,7 @@ export const DataShareLogs = ({ data, reportdata }) => {
<br />
<h5 className="bold wrap-header m-t-sm">DataShare Details:</h5>

<Table className="table table-striped table-bordered w-50">
<Table className="table table-bordered w-50">
<thead className="thead-light">
<tr>
<th>Fields</th>
Expand All @@ -187,9 +191,13 @@ export const DataShareLogs = ({ data, reportdata }) => {
return (
<tbody>
<tr>
<td className="table-warning">{dataShare.attributeName}</td>
<td className="table-warning">
{!isEmpty(dataShare.previousValue) ? dataShare.previousValue : "--"}
{dataShare.attributeName}
</td>
<td className="table-warning">
{!isEmpty(dataShare.previousValue)
? dataShare.previousValue
: "--"}
</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit bf114e6

Please sign in to comment.