Skip to content

Commit

Permalink
Merge pull request #560 from digitalgreenorg/fs_eth_test
Browse files Browse the repository at this point in the history
Fs eth test
  • Loading branch information
i-am-waseem authored Mar 31, 2023
2 parents b44d60e + 3a13f78 commit d3d26d8
Show file tree
Hide file tree
Showing 23 changed files with 547 additions and 282 deletions.
19 changes: 17 additions & 2 deletions src/Assets/CSS/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ button.disbalesubmitbtndept {
margin-top: 0px !important;
}

.dataset_selector_in_integration .ant-segmented-item-selected {
margin-bottom: 0px !important;
}

.dataset_selector_in_integration .MuiCollapse-entered {
background: #FFFFFF !important;
box-shadow: 0px 20px 40px -4px rgb(145 158 171 / 16%) !important;
Expand Down Expand Up @@ -1055,6 +1059,8 @@ button.disbalesubmitbtndept {
color: red !important;
}



.deleteicon:hover .mainBoxInIntegration {
border: 1px solid red !important;
}
Expand Down Expand Up @@ -1110,12 +1116,17 @@ html {
width: 368px;
height: 178px;
margin: 30px 15px 15px 15px;
border: 1px solid #C0C7D1;
border: 1px solid #FFDB64;
outline: none;

}

.connectorCard:hover {
border: 1px solid #c09507;
box-shadow: 0px 4px 20px rgba(216, 175, 40, 0.28);
/* border: 1px solid red; */
border: 1px solid #FFDB64;
cursor: pointer;

}

.dataset_selector_in_integration .backButtonMainDiv .MuiSvgIcon-root {
Expand All @@ -1124,4 +1135,8 @@ html {

.dataset_selector_in_integration .Mui-focused {
/* border: 1px solid #ab8405 !important; */
}

.ant-segmented-group label {
margin-bottom: 0px !important;
}
Binary file added src/Assets/Img/analytics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/Img/dashboard-growth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/Components/AdminDatasetConnection/AddDataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ const AddDataset = (props) => {
}, [])



return (
<Container id='admin_add_dataset_main_container'>
{isLoading ? <Loader /> : ""}
Expand Down Expand Up @@ -1097,6 +1098,7 @@ const AddDataset = (props) => {
{
activeStep == 2 ?
<DataStandardizationInAddDataset
isaccesstoken={isaccesstoken}
allStandardisedFile={allStandardisedFile}
setAllStandardisedFile={setAllStandardisedFile}
standardisedFileLink={standardisedFileLink}
Expand Down Expand Up @@ -1186,7 +1188,7 @@ const AddDataset = (props) => {
Finish Later
</Button> : " "}
<Box sx={{ flex: '1 1 auto' }} />
{activeStep != 0 && !isSubmitted ? <Button id='cancel_button' className='cancel_btn' onClick={handleResetForm}>Cancel</Button> : ""}
{!onBoardingPage && activeStep != 0 && !isSubmitted ? <Button id='cancel_button' className='cancel_btn' onClick={handleResetForm}>Cancel</Button> : ""}
<Box sx={{ flex: '1 1 auto' }} />
{/* {(isStepOptional(activeStep) && (localUploaded.length > 0 || mysqlFileList.length > 0 || postgresFileList.length > 0)) && (
<Button color="inherit" onClick={handleSkip} sx={{ mr: 1 }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { GetErrorHandlingRoute } from "../../Utils/Common";
import { message, Space } from "antd";

const DataStandardizationInAddDataset = (props) => {
const { datasetname, setAllStandardisedFile, allStandardisedFile, standardisedFileLink, setStandardisedFileLink, listOfFilesExistInDbForEdit, isDatasetEditModeOn } = props;
const { datasetname, setAllStandardisedFile, allStandardisedFile, standardisedFileLink, setStandardisedFileLink, listOfFilesExistInDbForEdit, isDatasetEditModeOn, isaccesstoken} = props;

console.log("type of ", typeof(listOfFilesExistInDbForEdit))

Expand Down Expand Up @@ -108,7 +108,9 @@ const DataStandardizationInAddDataset = (props) => {
UrlConstant.standardization_get_all_file_name +
datasetname;
setIsLoading(true);
HTTPService("GET", url, false, false, true)
let checkforAccess = isaccesstoken ? isaccesstoken : false;

HTTPService("GET", url, false, false, true, checkforAccess)
.then((response) => {
// console.log("filename in getAllFileNames api call 2",allFileNames)
setIsLoading(false);
Expand Down Expand Up @@ -145,9 +147,11 @@ const DataStandardizationInAddDataset = (props) => {

const getStandardiziedTemplate = () => {
let url = UrlConstant.base_url + UrlConstant.standardization_get_data;
let checkforAccess = isaccesstoken ? isaccesstoken : false;
console.log("checkforAccess",checkforAccess)

setIsLoading(true);
HTTPService("GET", url, false, false, true)
HTTPService("GET", url, false, false, true, checkforAccess)
.then((response) => {
setIsLoading(false);
console.log("response", response);
Expand Down Expand Up @@ -217,11 +221,12 @@ const DataStandardizationInAddDataset = (props) => {
file_path: fileName,
// is_standardised: true,
};
let checkforAccess = isaccesstoken ? isaccesstoken : false;
if(alreadyStanddardizedFiles.includes(fileName)) payload['is_standardised'] = true

console.log("filename", fileName);
setIsLoading(true);
HTTPService("POST", url, payload, false, true)
HTTPService("POST", url, payload, false, true, checkforAccess)
.then((response) => {
setIsLoading(false);
console.log("response", response);
Expand Down Expand Up @@ -255,6 +260,8 @@ const DataStandardizationInAddDataset = (props) => {
// saving standardised config

let tmpAllStandardisedFile = {...allStandardisedFile}
console.log('tmpAllStandardisedFile without update',tmpAllStandardisedFile)

tmpAllStandardisedFile[fileName] = {
standardised_templete_category: standardisedTempleteCategory,
standardised_column: standardisedColum,
Expand All @@ -281,10 +288,11 @@ const DataStandardizationInAddDataset = (props) => {
}

if(alreadyStanddardizedFiles.includes(fileName)) payload['is_standardised'] = true

let url = UrlConstant.base_url + UrlConstant.standardise_file
setIsLoading(true)
HTTPService("POST", url, payload, false, true)
let checkforAccess = isaccesstoken ? isaccesstoken : false;
HTTPService("POST", url, payload, false, true, checkforAccess)
.then((response) => {
setIsLoading(false);
console.log("response", response);
Expand Down Expand Up @@ -329,11 +337,14 @@ const DataStandardizationInAddDataset = (props) => {
// console.log("tmpAllFileName in handleExistingStandardizedFiles", tmpAllFileName)
if(Object.keys(dataset.standardisation_config).length){
tmpAlreadyStanddardizedFiles.push(dataset.file)
tmpStandardized[dataset.file] = dataset.standardisation_config

// if tmpStandardized[dataset.file] donsn't exist then create
if(!tmpStandardized[dataset.file]) tmpStandardized[dataset.file] = dataset.standardisation_config
}
// console.log("tmpStandardized in handleExistingStandardizedFiles",tmpStandardized)
})
setAllStandardisedFile(tmpStandardized)
console.log("tmpStandardized1",tmpStandardized)
setAllFileNames(tmpAllFileName);
setAlreadyStanddardizedFiles(tmpAlreadyStanddardizedFiles)
}
Expand Down Expand Up @@ -362,7 +373,7 @@ const DataStandardizationInAddDataset = (props) => {
setMaskedColumns(allStandardisedFile[fileName]?.masked_columns)

// Chnage object reference
if(isDatasetEditModeOn){
// if(isDatasetEditModeOn){
let tmpArr = [...allStandardisedFile[fileName]?.standardised_templete_category];
tmpArr.forEach((attribute,index)=>{
allStandardisedTempleteCategory.forEach(((tmpAttribute)=>{
Expand All @@ -384,9 +395,9 @@ const DataStandardizationInAddDataset = (props) => {
tmpColumn[index] = Object.keys(attribute.datapoint_attributes);
});
setStandardisedTempleteAttribute(tmpColumn);
}
// }

if(!isDatasetEditModeOn) setStandardisedColumn(allStandardisedFile[fileName]?.standardised_column)
// if(!isDatasetEditModeOn) setStandardisedColumn(allStandardisedFile[fileName]?.standardised_column)

}

Expand All @@ -398,7 +409,8 @@ const DataStandardizationInAddDataset = (props) => {
standardisedTempleteAttribute,
allFileNames
);


console.log("allStandardisedFile",allStandardisedFile)
console.log('all data',keysInUploadedDataset, standardisedTempleteCategory, standardisedColum,maskedColumns)
console.log("listOfFilesExistInDbForEdit", listOfFilesExistInDbForEdit)
return (
Expand All @@ -417,7 +429,7 @@ const DataStandardizationInAddDataset = (props) => {
<Select
labelId="demo-select-small"
id="select-file-name-small"
// value={age}
label="Select file name"
value={fileName}
error={fileNameError ? fileNameError : null}
onChange={(e) => {
Expand Down Expand Up @@ -457,7 +469,7 @@ const DataStandardizationInAddDataset = (props) => {
<span>Uploaded Data Column Name</span>
</Col>
<Col xs={3} sm={3} md={3} lg={3}>
<span>Standard Data Calegory</span>
<span>Standard Data Category</span>
</Col>
<Col xs={3} sm={3} md={3} lg={3}>
<span>Standard Data Attribute</span>
Expand All @@ -466,8 +478,8 @@ const DataStandardizationInAddDataset = (props) => {
<span>Mask</span>
</Col>

{/* </div> */}
</Row>
{/* </div> */}
</Row>
) : null}
<div className="data_standardization_column">
{keysInUploadedDataset?.map((keyNames, index) => {
Expand Down Expand Up @@ -496,6 +508,7 @@ const DataStandardizationInAddDataset = (props) => {
<Select
labelId="demo-select-small"
id="demo-select-small"
label="Select datapoint category"
value={
standardisedTempleteCategory?.[index]
? standardisedTempleteCategory?.[index] :
Expand All @@ -504,10 +517,10 @@ const DataStandardizationInAddDataset = (props) => {
onChange={(e) =>
datapointCategoryChange(e.target.value, index)
}
>
><MenuItem value=""><em>None</em></MenuItem>
{/* { console.log(standardisedTempleteCategory?.[index],allStandardisedTempleteCategory, "THIS IS THE VVALUENBASBAHUSB")} */}
{allStandardisedTempleteCategory?.map((item) => {
// console.log("This is to check value of object reff",standardisedTempleteCategory?.[index]===item,standardisedTempleteCategory?.[index],item)
console.log("This is to check value of object reff",standardisedTempleteCategory?.[index]===item,standardisedTempleteCategory?.[index],item)
return (
<MenuItem key={item.datapoint_category} value={item}>
{item.datapoint_category}
Expand All @@ -529,6 +542,7 @@ const DataStandardizationInAddDataset = (props) => {
<Select
labelId="demo-select-small"
id="demo-select-small"
label="Select column/key"
value={standardisedColum[index] ? standardisedColum[index] : ""}
onChange={(e) => {
let tmpArr = [...standardisedColum];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function ViewMetaDatasetDetails(props) {
const [success, setisSuccess] = useState(false);
const fileTypes = ["XLS", "xlsx", "CSV", "PDF", "JPEG", "JPG", "PNG", "TIFF"];
const [previewImage, setPreviewImage] = useState("");
const [datasetName, setDatasetName] = useState("")
const location = useLocation();

console.log(location.state, "location")
Expand Down Expand Up @@ -90,6 +91,7 @@ export default function ViewMetaDatasetDetails(props) {
setOrgDetail(response.data.organization)
setorgdes(response.data.organization.org_description)
setUserDetails(response.data.user)
setDatasetName(response?.data?.name)
}).catch((e) => {
setLoader(false);
console.log('error while loading dataset', e)
Expand Down Expand Up @@ -177,7 +179,7 @@ export default function ViewMetaDatasetDetails(props) {
"paddingLeft": "98px",
"margin-top": "50px"
}}>
<span>Agricultural Practices Video Dissemintion Data</span>
<span>{datasetName}</span>
</Col>
</Row>
<Row style={{ "marginLeft": "96px", "margin-right": "73px" }}>
Expand Down
18 changes: 12 additions & 6 deletions src/Components/Datasets/DataSetCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ const useStyles = {
"font-weight": "400",
"font-size": "14px",
"line-height": "19px",
display: "-webkit-box",
"display": "-webkit-box",
"-webkit-line-clamp": "2",
"-webkit-box-orient": "vertical",
"text-align": "left",
overflow: "hidden",
"max-height": "60px"
"overflow": "hidden",
"max-height": "60px",
"text-overflow": "ellipsis",
"overflow": "hidden",
"display": "inline-block",
"width": "300px",
},
};
export default function DataSetCard(props) {
Expand Down Expand Up @@ -129,11 +133,13 @@ export default function DataSetCard(props) {
<CardContent>
<Row style={useStyles.datasetdescription}>
{/* <Tooltip TransitionComponent={Zoom} title={props.description}> */}
<span
style={{ maxWidth: "300px", height: "40px", display: "block" }}
<p
className="dataset-description-in-dataset-details"

style={{ maxWidth: "300px", height: "40px", display: "block", }}
>
{props.description ? parse(props.description) : ""}
</span>
</p>
{/* </Tooltip> */}
</Row>
<Row>
Expand Down
18 changes: 18 additions & 0 deletions src/Components/Datasets/DataSetForm.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,21 @@
width: 100% !important;
float: left !important;
}
.dataset-description-in-dataset-details{
all: unset;
}

.dataset-description-in-dataset-details p{
display: inline-block;
overflow: hidden;
max-height: 60px;
text-overflow: ellipsis;
width: 300px;
}
.cardheaderTitlespecifier span{
display: inline-block;
overflow: hidden;
max-height: 60px;
text-overflow: ellipsis;
width: 250px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
line-height: 24px;
text-align: left;
border-bottom: 1px solid #9AA1A9;

background: #636363 !important;
/* fallback for old browsers */
background: -webkit-linear-gradient(to right, #ab84057f, white) !important;
background: -webkit-linear-gradient(to bottom, #ab84057f, white) !important;
/* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #ab84057f, white) !important;
background: linear-gradient(to bottom, #ab84057f, white);
}

.topRowOfCard div:nth-child(2) {
Expand Down
Loading

0 comments on commit d3d26d8

Please sign in to comment.