Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aura/mobilePanelList/mobilePanelList.cmp-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
2 changes: 1 addition & 1 deletion classes/ContentVersionFieldsPicklist.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion classes/ContentVersionFieldsPicklistTest.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<status>Active</status>
</ApexClass>
22 changes: 9 additions & 13 deletions classes/FilesListController.cls
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
public with sharing class FilesListController {

@AuraEnabled(cacheable=true)
public static List<ContentVersion> getRelatedFilesByRecordId(String recordId, String fieldsParameter, Integer queryLimit, String searchTerm){
searchTerm = searchTerm.trim();
if (searchTerm == '') {
//Get all the related files as expected
getAllRelatedList(recordId, fieldsParameter, queryLimit);
return getAllRelatedList(recordId, fieldsParameter, queryLimit);
}
searchTerm = '%'+ searchTerm +'%';
//return query via searchTerm

if(Schema.sObjectType.ContentDocumentLink.isAccessible()){
List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId WITH SECURITY_ENFORCED ];
List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId WITH USER_MODE ];
List<ID>fileIDs = new List<ID>();
for (ContentDocumentLink fileLink : files){
fileIDs.add(fileLink.ContentDocumentId);
}
if(Schema.sObjectType.ContentVersion.isAccessible()){
String queryContentVersion = 'SELECT Id, ContentDocumentId, ContentSize,' + String.escapeSingleQuotes(fieldsParameter) + ' FROM ContentVersion';
System.debug(queryContentVersion);
List<ContentVersion> filesList = Database.query(String.escapeSingleQuotes(queryContentVersion) + ' WHERE ContentDocumentId IN :fileIds AND Title LIKE :searchTerm WITH SECURITY_ENFORCED ORDER BY LastModifiedDate DESC LIMIT :queryLimit');
String queryContentVersion = 'SELECT Id, ContentDocumentId, ContentSize,' + String.escapeSingleQuotes(fieldsParameter) + ' FROM ContentVersion';
List<ContentVersion> filesList = Database.query(String.escapeSingleQuotes(queryContentVersion) + ' WHERE ContentDocumentId IN :fileIds AND Title LIKE :searchTerm WITH USER_MODE ORDER BY LastModifiedDate DESC LIMIT :queryLimit');
return filesList;
}
else {
Expand All @@ -33,15 +30,14 @@ public with sharing class FilesListController {

@AuraEnabled(Cacheable=true)
public static List<ContentVersion> getAllRelatedList(String recordId, String fieldsParameter, Integer queryLimit) {
List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId ];
List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId WITH USER_MODE ];
List<ID>fileIDs = new List<ID>();
for (ContentDocumentLink fileLink : files){
fileIDs.add(fileLink.ContentDocumentId);
}
String queryContentVersion = 'SELECT Id, ContentDocumentId, ' + String.escapeSingleQuotes(fieldsParameter) + ' FROM ContentVersion';
System.debug(queryContentVersion);
String queryContentVersion = 'SELECT Id, ContentDocumentId, ' + String.escapeSingleQuotes(fieldsParameter) + ' FROM ContentVersion';
if(Schema.sObjectType.ContentVersion.isAccessible()){
List<ContentVersion> filesList = Database.query(String.escapeSingleQuotes(queryContentVersion) + ' WHERE ContentDocumentId IN :fileIds WITH SECURITY_ENFORCED ORDER BY LastModifiedDate DESC LIMIT :queryLimit');
List<ContentVersion> filesList = Database.query(String.escapeSingleQuotes(queryContentVersion) + ' WHERE ContentDocumentId IN :fileIds WITH USER_MODE ORDER BY LastModifiedDate DESC LIMIT :queryLimit');
return filesList;
}
else {
Expand All @@ -52,7 +48,7 @@ public with sharing class FilesListController {
@AuraEnabled(cacheable=true)
public static Integer getTotalCount(String recordId){
if(Schema.sObjectType.ContentDocumentLink.isAccessible()){
AggregateResult totalAggregateCount = [SELECT count(ContentDocumentId) total FROM ContentDocumentLink WHERE LinkedEntityId = :recordId WITH SECURITY_ENFORCED ];
AggregateResult totalAggregateCount = [SELECT count(ContentDocumentId) total FROM ContentDocumentLink WHERE LinkedEntityId = :recordId WITH USER_MODE ];
Integer count = (Integer)totalAggregateCount.get('total');
return count;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/FilesListController.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion classes/FilesListControllerTest.cls-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<status>Active</status>
</ApexClass>
2 changes: 1 addition & 1 deletion lwc/downloadFilesModal/downloadFilesModal.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/emptyIllustration/emptyIllustration.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
4 changes: 2 additions & 2 deletions lwc/fileCard/fileCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class ContactDataTable extends NavigationMixin(
this.filesData = undefined;
this.filesError = result.error;
}
if (this.filesData && this.objectInfoData.apiName === "ContentVersion") {
if (this.filesData && this.objectInfoData && this.objectInfoData.apiName === "ContentVersion") {
this.createDataTableColumns();
}
}
Expand Down Expand Up @@ -200,7 +200,7 @@ export default class ContactDataTable extends NavigationMixin(
this.objectInfoData = undefined;
this.objectInfoError = result.error;
}
if (this.filesData && this.objectInfoData.apiName === "ContentVersion") {
if (this.filesData && this.objectInfoData && this.objectInfoData.apiName === "ContentVersion") {
this.createDataTableColumns();
}
}
Expand Down
2 changes: 1 addition & 1 deletion lwc/fileCard/fileCard.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<masterLabel>Enhanced Files List</masterLabel>
<isExposed>true</isExposed>
<targets>
Expand Down
2 changes: 1 addition & 1 deletion lwc/mobileDataTable/mobileDataTable.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/mobilePanel/mobilePanel.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/mobileSortButtonMenu/mobileSortButtonMenu.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/noFilesView/noFilesView.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/paginator/paginator.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/photo/photo.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/photoModal/photoModal.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/pubsub/pubsub.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
2 changes: 1 addition & 1 deletion lwc/uploadFilesModal/uploadFilesModal.js-meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>48.0</apiVersion>
<apiVersion>63.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>