зеркало из https://github.com/wadewegner/GIFter.git
Minor fixes and updates for chatter
This commit is contained in:
Родитель
ea441bbe8e
Коммит
d448cdcc6c
|
@ -1,2 +1,3 @@
|
||||||
.sfdx
|
.sfdx
|
||||||
.vscode
|
.vscode
|
||||||
|
scripts
|
|
@ -2,7 +2,7 @@
|
||||||
"orgName": "wade.wegner Company",
|
"orgName": "wade.wegner Company",
|
||||||
"edition": "Developer",
|
"edition": "Developer",
|
||||||
"orgPreferences" : {
|
"orgPreferences" : {
|
||||||
"enabled": ["S1DesktopEnabled"],
|
"enabled": ["S1DesktopEnabled", "ChatterEnabled"],
|
||||||
"disabled": ["S1EncryptedStoragePref2"]
|
"disabled": ["S1EncryptedStoragePref2"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
<aura:documentation>
|
|
||||||
<aura:description>Documentation</aura:description>
|
|
||||||
<aura:example name="ExampleName" ref="exampleComponentName" label="Label">
|
|
||||||
Example Description
|
|
||||||
</aura:example>
|
|
||||||
</aura:documentation>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
|
|
||||||
|
|
||||||
Post GIF to Chatter
|
|
||||||
|
|
||||||
</aura:component>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<AuraDefinitionBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="PostGIFToChatter">
|
|
||||||
<apiVersion>42.0</apiVersion>
|
|
||||||
<description>A Lightning Component Bundle</description>
|
|
||||||
</AuraDefinitionBundle>
|
|
|
@ -1,2 +0,0 @@
|
||||||
.THIS {
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
<design:component >
|
|
||||||
|
|
||||||
</design:component>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
||||||
<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/>
|
|
||||||
<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
До Ширина: | Высота: | Размер: 661 B |
|
@ -1,5 +0,0 @@
|
||||||
({
|
|
||||||
myAction : function(component, event, helper) {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,5 +0,0 @@
|
||||||
({
|
|
||||||
helperMethod : function() {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -1,5 +0,0 @@
|
||||||
({
|
|
||||||
|
|
||||||
// Your renderer method overrides go here
|
|
||||||
|
|
||||||
})
|
|
|
@ -1,4 +1,6 @@
|
||||||
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
|
<aura:component
|
||||||
|
implements="force:appHostable,flexipage:availableForAllPageTypes"
|
||||||
|
controller="ChatterHelper">
|
||||||
|
|
||||||
<aura:attribute name="searchTerms" type="String" />
|
<aura:attribute name="searchTerms" type="String" />
|
||||||
<aura:attribute name="results" type="Map" />
|
<aura:attribute name="results" type="Map" />
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
({
|
({
|
||||||
|
|
||||||
afterScriptsLoaded: function (component, event, helper) {
|
afterScriptsLoaded: function (component, event, helper) {
|
||||||
|
@ -7,6 +6,19 @@
|
||||||
|
|
||||||
doInit: function (component, event, helper) {
|
doInit: function (component, event, helper) {
|
||||||
console.log('doInit called successfully');
|
console.log('doInit called successfully');
|
||||||
|
|
||||||
|
var action = component.get("c.getChatterGroups");
|
||||||
|
$A.enqueueAction(action);
|
||||||
|
|
||||||
|
console.log('about to set callback');
|
||||||
|
|
||||||
|
action.setCallback(this, function (response) {
|
||||||
|
console.log('i am back');
|
||||||
|
// var groups = JSON.parse(response.getReturnValue());
|
||||||
|
var output = response.getReturnValue();
|
||||||
|
// console.log('groups');
|
||||||
|
console.log(output);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
keyCheck: function (component, event, helper) {
|
keyCheck: function (component, event, helper) {
|
||||||
|
@ -54,7 +66,7 @@
|
||||||
console.log(results);
|
console.log(results);
|
||||||
|
|
||||||
|
|
||||||
var selectedGif=results.data.find(item => item.id === id)
|
var selectedGif = results.data.find(item => item.id === id)
|
||||||
console.log(selectedGif);
|
console.log(selectedGif);
|
||||||
|
|
||||||
var width = selectedGif.images.original.width;
|
var width = selectedGif.images.original.width;
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
public with sharing class ChatterHelper {
|
||||||
|
|
||||||
|
@AuraEnabled
|
||||||
|
public static String getChatterGroups() {
|
||||||
|
|
||||||
|
// System.debug('getChatterGroups');
|
||||||
|
|
||||||
|
// ConnectApi.ContentHubRepositoryCollection repositoryCollection = ConnectApi.ContentHub.getRepositories();
|
||||||
|
|
||||||
|
// System.debug('repository');
|
||||||
|
|
||||||
|
// for(ConnectApi.ContentHubRepository repository : repositoryCollection.repositories){
|
||||||
|
|
||||||
|
// System.debug(repository);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// String userId = UserInfo.getUserId();
|
||||||
|
// System.debug('userId: ' + userId);
|
||||||
|
|
||||||
|
// String communityId = null;
|
||||||
|
// String imageId = '069D00000001INA'; // need to replace
|
||||||
|
// // String mentionedUserId = '005D0000001QNpr';
|
||||||
|
// String targetUserOrGroupOrRecordId = 'me'; // is this right?
|
||||||
|
|
||||||
|
// ConnectApi.FeedItemInput input = new ConnectApi.FeedItemInput();
|
||||||
|
// input.subjectId = targetUserOrGroupOrRecordId;
|
||||||
|
// input.feedElementType = ConnectApi.FeedElementType.FeedItem;
|
||||||
|
|
||||||
|
// ConnectApi.MessageBodyInput messageInput = new ConnectApi.MessageBodyInput();
|
||||||
|
// ConnectApi.TextSegmentInput textSegment;
|
||||||
|
// ConnectApi.MentionSegmentInput mentionSegment;
|
||||||
|
// ConnectApi.MarkupBeginSegmentInput markupBeginSegment;
|
||||||
|
// ConnectApi.MarkupEndSegmentInput markupEndSegment;
|
||||||
|
// ConnectApi.InlineImageSegmentInput inlineImageSegment;
|
||||||
|
|
||||||
|
// System.debug('here 1');
|
||||||
|
|
||||||
|
// messageInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
|
||||||
|
|
||||||
|
// markupBeginSegment = new ConnectApi.MarkupBeginSegmentInput();
|
||||||
|
// markupBeginSegment.markupType = ConnectApi.MarkupType.Bold;
|
||||||
|
// messageInput.messageSegments.add(markupBeginSegment);
|
||||||
|
|
||||||
|
// System.debug('here 2');
|
||||||
|
|
||||||
|
// textSegment = new ConnectApi.TextSegmentInput();
|
||||||
|
// textSegment.text = 'Hello ';
|
||||||
|
// messageInput.messageSegments.add(textSegment);
|
||||||
|
|
||||||
|
// System.debug('here 3');
|
||||||
|
|
||||||
|
// // mentionSegment = new ConnectApi.MentionSegmentInput();
|
||||||
|
// // mentionSegment.id = mentionedUserId;
|
||||||
|
// // messageInput.messageSegments.add(mentionSegment);
|
||||||
|
|
||||||
|
// System.debug('here 4');
|
||||||
|
|
||||||
|
// textSegment = new ConnectApi.TextSegmentInput();
|
||||||
|
// textSegment.text = '!';
|
||||||
|
// messageInput.messageSegments.add(textSegment);
|
||||||
|
|
||||||
|
// System.debug('here 5');
|
||||||
|
|
||||||
|
// markupEndSegment = new ConnectApi.MarkupEndSegmentInput();
|
||||||
|
// markupEndSegment.markupType = ConnectApi.MarkupType.Bold;
|
||||||
|
// messageInput.messageSegments.add(markupEndSegment);
|
||||||
|
|
||||||
|
// System.debug('here 6');
|
||||||
|
|
||||||
|
// inlineImageSegment = new ConnectApi.InlineImageSegmentInput();
|
||||||
|
// inlineImageSegment.altText = 'image one';
|
||||||
|
// inlineImageSegment.fileId = imageId;
|
||||||
|
// messageInput.messageSegments.add(inlineImageSegment);
|
||||||
|
|
||||||
|
// input.body = messageInput;
|
||||||
|
|
||||||
|
// System.debug('here 7');
|
||||||
|
|
||||||
|
// ConnectApi.ChatterFeeds.postFeedElement(communityId, input, null);
|
||||||
|
|
||||||
|
// System.debug('here 8');
|
||||||
|
|
||||||
|
return 'finished';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com" fqn="ChatterHelper">
|
||||||
|
<apiVersion>35.0</apiVersion>
|
||||||
|
<status>Active</status>
|
||||||
|
</ApexClass>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<RemoteSiteSetting xmlns="http://soap.sforce.com/2006/04/metadata">
|
||||||
|
<disableProtocolSecurity>false</disableProtocolSecurity>
|
||||||
|
<isActive>true</isActive>
|
||||||
|
<url>https://media1.giphy.com</url>
|
||||||
|
</RemoteSiteSetting>
|
Загрузка…
Ссылка в новой задаче