浏览代码

Fixed Export data error and removed Export options for normal users

master
prahalad 3 年前
父节点
当前提交
25f1be35e9
共有 3 个文件被更改,包括 53 次插入17 次删除
  1. +2
    -1
      src/app/dashboard/partner-details/partner-details.component.html
  2. +27
    -10
      src/app/dashboard/partner-details/partner-details.component.ts
  3. +24
    -6
      src/app/dashboard/table/table.component.ts

+ 2
- 1
src/app/dashboard/partner-details/partner-details.component.html 查看文件

@@ -514,7 +514,8 @@
<ng-container *ngIf="showExportOptions"> <ng-container *ngIf="showExportOptions">
<div class="export-options"> <div class="export-options">


<div class="sub-options">
<div class="sub-options" *ngIf="partnerDetails.surveyCtoData.hiiData.length > 0 || partnerDetails.surveyCtoData.spData.length > 0 || partnerDetails.surveyCtoData.spSchemeData.length > 0">

<header> <header>
<h5>Select Data Type</h5> <h5>Select Data Type</h5>
</header> </header>


+ 27
- 10
src/app/dashboard/partner-details/partner-details.component.ts 查看文件

@@ -65,6 +65,21 @@ export class PartnerDetailsComponent implements OnInit {
let surveyCtoData: Array<any> = []; let surveyCtoData: Array<any> = [];




let areaOfWork: any = [];
let branchLocationCountries: any = [];
let communities: any = [];
let preferredLanguages: any = [];
let primaryAreasOfSupportOffered: any = [];
let primaryAreasOfSupportRequired: any = [];

partnerData.strengthAndCapability.primaryAreasOfSupportOffered.forEach(x => { primaryAreasOfSupportOffered.push(x.name) })
partnerData.strengthAndCapability.primaryAreasOfSupportRequired.forEach(x => { primaryAreasOfSupportRequired.push(x.name) })
partnerData.detailedProfile.preferredLanguages.forEach(x => { preferredLanguages.push(x.name) })
partnerData.detailedProfile.communities.forEach(x => { communities.push(x.name) })
partnerData.detailedProfile.branchLocationCountries.forEach(x => { branchLocationCountries.push(x.name) })
partnerData.organizationBasicInfo.areasOfWork.forEach(x => { areaOfWork.push(x.name) })


exportData = [{ exportData = [{
"PortalID": partnerData.portalId ? partnerData.portalId : '-', "PortalID": partnerData.portalId ? partnerData.portalId : '-',


@@ -77,7 +92,7 @@ export class PartnerDetailsComponent implements OnInit {


// Basic Info // Basic Info


"Areas Of Work": partnerData.organizationBasicInfo.areasOfWork ? partnerData.organizationBasicInfo.areasOfWork.map(option => option.name).join(', ') : '',
"Areas Of Work": areaOfWork.toString(),
"Name": partnerData.organizationBasicInfo.name, "Name": partnerData.organizationBasicInfo.name,
"Reason For Becoming Member": partnerData.organizationBasicInfo.reasonForBecomingMember, "Reason For Becoming Member": partnerData.organizationBasicInfo.reasonForBecomingMember,
"Referral Name": partnerData.organizationBasicInfo.referralName, "Referral Name": partnerData.organizationBasicInfo.referralName,
@@ -96,18 +111,18 @@ export class PartnerDetailsComponent implements OnInit {
// Detailed Profile // Detailed Profile


'Bio': partnerData.detailedProfile.bio, 'Bio': partnerData.detailedProfile.bio,
'Branch Location Countries': partnerData.detailedProfile.branchLocationCountries ? partnerData.detailedProfile.branchLocationCountries.map(option => option.name).join(', ') : '',
"Communities": partnerData.detailedProfile.communities ? partnerData.detailedProfile.communities.map(option => option.name).join(', ') : '',
'Branch Location Countries': branchLocationCountries.toString(),
"Communities": communities.toString(),
"District": partnerData.detailedProfile.district, "District": partnerData.detailedProfile.district,
"Districts": partnerData.detailedProfile.districts ? partnerData.detailedProfile.districts.map(option => option.name).join(', ') : '',
"Districts": partnerData.detailedProfile.districts ? partnerData.detailedProfile.districts.toString() : '',
"Files": partnerData.detailedProfile.files, "Files": partnerData.detailedProfile.files,
"Have Branches In Other Districts": partnerData.detailedProfile.haveBranchesInOtherDistricts, "Have Branches In Other Districts": partnerData.detailedProfile.haveBranchesInOtherDistricts,
"Logo": partnerData.detailedProfile.logo, "Logo": partnerData.detailedProfile.logo,
"partnerData Location": partnerData.detailedProfile.partnerLocation,
"Preferred Languages": partnerData.detailedProfile.preferredLanguages ? partnerData.detailedProfile.preferredLanguages.map(option => option.name).join(', ') : '',
"Preferred Mode Of Communications": partnerData.detailedProfile.preferredModeOfCommunications ? partnerData.detailedProfile.preferredModeOfCommunications.map(option => option.name).join(', ') : '',
"partner Location": partnerData.detailedProfile.partnerLocation,
"Preferred Languages": preferredLanguages.toString(),
"Preferred Mode Of Communications": partnerData.detailedProfile.preferredModeOfCommunications ? partnerData.detailedProfile.preferredModeOfCommunications.toString() : '',
"State": partnerData.detailedProfile.state, "State": partnerData.detailedProfile.state,
"States": partnerData.detailedProfile.states ? partnerData.detailedProfile.states.map(option => option.name).join(', ') : '',
"States": partnerData.detailedProfile.states ? partnerData.detailedProfile.states.toString() : '',
"Total Reach Of Organization": partnerData.detailedProfile.totalReachOfOrganization, "Total Reach Of Organization": partnerData.detailedProfile.totalReachOfOrganization,
"Year Of Establishment": partnerData.detailedProfile.yearOfEstablishment, "Year Of Establishment": partnerData.detailedProfile.yearOfEstablishment,


@@ -115,13 +130,15 @@ export class PartnerDetailsComponent implements OnInit {


"Other Specific Support Required": partnerData.strengthAndCapability.otherSpecificSupportRequired, "Other Specific Support Required": partnerData.strengthAndCapability.otherSpecificSupportRequired,
"Primary Areas Of Support Offered": partnerData.strengthAndCapability.otherSpecificSupportRequired ? partnerData.strengthAndCapability.otherSpecificSupportRequired.toString() : '', "Primary Areas Of Support Offered": partnerData.strengthAndCapability.otherSpecificSupportRequired ? partnerData.strengthAndCapability.otherSpecificSupportRequired.toString() : '',
"Primary Areas Of Support Offered Description": partnerData.strengthAndCapability.primaryAreasOfSupportOffered.map(option => option.name).join(', '),
"Primary Areas Of Support Offered Description": primaryAreasOfSupportOffered.toString(),
"Primary Areas Of Support Offered Other": partnerData.strengthAndCapability.primaryAreasOfSupportOfferedDescription, "Primary Areas Of Support Offered Other": partnerData.strengthAndCapability.primaryAreasOfSupportOfferedDescription,
"Primary Areas Of Support Required": partnerData.strengthAndCapability.primaryAreasOfSupportOfferedOther ? partnerData.strengthAndCapability.primaryAreasOfSupportOfferedOther.toString() : '', "Primary Areas Of Support Required": partnerData.strengthAndCapability.primaryAreasOfSupportOfferedOther ? partnerData.strengthAndCapability.primaryAreasOfSupportOfferedOther.toString() : '',
"Primary Areas Of Support Required Description": partnerData.strengthAndCapability.primaryAreasOfSupportRequired.map(option => option.name).join(', '),
"Primary Areas Of Support Required Description": primaryAreasOfSupportRequired.toString(),
"Primary Areas Of Support Required Other": partnerData.strengthAndCapability.primaryAreasOfSupportRequiredOther, "Primary Areas Of Support Required Other": partnerData.strengthAndCapability.primaryAreasOfSupportRequiredOther,
}] }]




let surveyCtoHIIData = []; let surveyCtoHIIData = [];
for (const hiidata of partnerData.surveyCtoData.hiiData) { for (const hiidata of partnerData.surveyCtoData.hiiData) {
let partnerHiiDetails = { let partnerHiiDetails = {


+ 24
- 6
src/app/dashboard/table/table.component.ts 查看文件

@@ -172,6 +172,22 @@ export class TableComponent implements OnInit {
let surveyCtoData: Array<any> = []; let surveyCtoData: Array<any> = [];


for (const partner of this.selectedPartnerList) { for (const partner of this.selectedPartnerList) {

let areaOfWork: any = [];
let branchLocationCountries: any = [];
let communities: any = [];
let preferredLanguages: any = [];
let primaryAreasOfSupportOffered: any = [];
let primaryAreasOfSupportRequired: any = [];

partner.strengthAndCapability.primaryAreasOfSupportOffered.forEach(x => { primaryAreasOfSupportOffered.push(x.name)})
partner.strengthAndCapability.primaryAreasOfSupportRequired.forEach(x => { primaryAreasOfSupportRequired.push(x.name)})
partner.detailedProfile.preferredLanguages.forEach(x => { preferredLanguages.push(x.name)})
partner.detailedProfile.communities.forEach(x => { communities.push(x.name)})
partner.detailedProfile.branchLocationCountries.forEach(x => { branchLocationCountries.push(x.name)})
partner.organizationBasicInfo.areasOfWork.forEach(x => { areaOfWork.push(x.name)})


let partnerDetails = { let partnerDetails = {
"PortalID": partner.portalId ? partner.portalId : '-', "PortalID": partner.portalId ? partner.portalId : '-',


@@ -184,7 +200,7 @@ export class TableComponent implements OnInit {


// Basic Info // Basic Info


"Areas Of Work": partner.organizationBasicInfo.areasOfWork ? partner.organizationBasicInfo.areasOfWork.toString() : '',
"Areas Of Work": areaOfWork.toString(),
"Name": partner.organizationBasicInfo.name, "Name": partner.organizationBasicInfo.name,
"Reason For Becoming Member": partner.organizationBasicInfo.reasonForBecomingMember, "Reason For Becoming Member": partner.organizationBasicInfo.reasonForBecomingMember,
"Referral Name": partner.organizationBasicInfo.referralName, "Referral Name": partner.organizationBasicInfo.referralName,
@@ -203,15 +219,15 @@ export class TableComponent implements OnInit {
// Detailed Profile // Detailed Profile


'Bio': partner.detailedProfile.bio, 'Bio': partner.detailedProfile.bio,
'Branch Location Countries': partner.detailedProfile.branchLocationCountries ? partner.detailedProfile.branchLocationCountries.toString() : '',
"Communities": partner.detailedProfile.communities ? partner.detailedProfile.communities.toString() : '',
'Branch Location Countries': branchLocationCountries.toString(),
"Communities": communities.toString(),
"District": partner.detailedProfile.district, "District": partner.detailedProfile.district,
"Districts": partner.detailedProfile.districts ? partner.detailedProfile.districts.toString() : '', "Districts": partner.detailedProfile.districts ? partner.detailedProfile.districts.toString() : '',
"Files": partner.detailedProfile.files, "Files": partner.detailedProfile.files,
"Have Branches In Other Districts": partner.detailedProfile.haveBranchesInOtherDistricts, "Have Branches In Other Districts": partner.detailedProfile.haveBranchesInOtherDistricts,
"Logo": partner.detailedProfile.logo, "Logo": partner.detailedProfile.logo,
"partner Location": partner.detailedProfile.partnerLocation, "partner Location": partner.detailedProfile.partnerLocation,
"Preferred Languages": partner.detailedProfile.preferredLanguages ? partner.detailedProfile.preferredLanguages.toString() : '',
"Preferred Languages": preferredLanguages.toString(),
"Preferred Mode Of Communications": partner.detailedProfile.preferredModeOfCommunications ? partner.detailedProfile.preferredModeOfCommunications.toString() : '', "Preferred Mode Of Communications": partner.detailedProfile.preferredModeOfCommunications ? partner.detailedProfile.preferredModeOfCommunications.toString() : '',
"State": partner.detailedProfile.state, "State": partner.detailedProfile.state,
"States": partner.detailedProfile.states ? partner.detailedProfile.states.toString() : '', "States": partner.detailedProfile.states ? partner.detailedProfile.states.toString() : '',
@@ -222,13 +238,15 @@ export class TableComponent implements OnInit {


"Other Specific Support Required": partner.strengthAndCapability.otherSpecificSupportRequired, "Other Specific Support Required": partner.strengthAndCapability.otherSpecificSupportRequired,
"Primary Areas Of Support Offered": partner.strengthAndCapability.otherSpecificSupportRequired ? partner.strengthAndCapability.otherSpecificSupportRequired.toString() : '', "Primary Areas Of Support Offered": partner.strengthAndCapability.otherSpecificSupportRequired ? partner.strengthAndCapability.otherSpecificSupportRequired.toString() : '',
"Primary Areas Of Support Offered Description": partner.strengthAndCapability.primaryAreasOfSupportOffered,
"Primary Areas Of Support Offered Description": primaryAreasOfSupportOffered.toString(),
"Primary Areas Of Support Offered Other": partner.strengthAndCapability.primaryAreasOfSupportOfferedDescription, "Primary Areas Of Support Offered Other": partner.strengthAndCapability.primaryAreasOfSupportOfferedDescription,
"Primary Areas Of Support Required": partner.strengthAndCapability.primaryAreasOfSupportOfferedOther ? partner.strengthAndCapability.primaryAreasOfSupportOfferedOther.toString() : '', "Primary Areas Of Support Required": partner.strengthAndCapability.primaryAreasOfSupportOfferedOther ? partner.strengthAndCapability.primaryAreasOfSupportOfferedOther.toString() : '',
"Primary Areas Of Support Required Description": partner.strengthAndCapability.primaryAreasOfSupportRequired,
"Primary Areas Of Support Required Description": primaryAreasOfSupportRequired.toString(),
"Primary Areas Of Support Required Other": partner.strengthAndCapability.primaryAreasOfSupportRequiredOther, "Primary Areas Of Support Required Other": partner.strengthAndCapability.primaryAreasOfSupportRequiredOther,
} }

exportData.push(partnerDetails); exportData.push(partnerDetails);
console.log(exportData)


let surveyCtoHIIData = []; let surveyCtoHIIData = [];
for (const hiidata of partner.surveyCtoData.hiiData) { for (const hiidata of partner.surveyCtoData.hiiData) {


正在加载...
取消
保存