Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- smartroomv3
- >>>>>>>>>>>>>>>>>>>
- 4001------- >
- function handleSmartRoomSettingNewUI() {
- $('#popupRoomSettingsSpinner').show();
- $('#srd-popup-RoomSettings-NewUI').show();
- panelData = { "smartRoomId": '{!JSENCODE(workspaceId)}' }
- $Lightning.use(_lightningComponentPrefix + ":leftPanelApp", function ()
- {
- $Lightning.createComponent(_lightningComponentPrefix + ":roomSettings",
- panelData,
- "srd-popup-RoomSettings-NewUI",
- function (cmp)
- {
- console.log('lwc loaded');
- $('#popupRoomSettingsSpinner').hide();
- //closeModalDialog('roomSettingsModal');
- }
- );
- });
- }
- >>>>>>>>>>>>>>>>>>>>>>>
- 4503 --- >
- div style="display:none; min-height: 300px;" class="slds-chat-list slds-border_bottom slds-scrollable_y slds-p-horizontal_large slds-p-bottom_large"
- id="srd-popup-RoomSettings-NewUI">
- <div class="slds-spinner_container" id="popupRoomSettingsSpinner" style="display: none;">
- <div class="slds-spinner--brand slds-spinner slds-spinner--small" aria-hidden="false" role="alert">
- <div class="slds-spinner__dot-a"></div>
- <div class="slds-spinner__dot-b"></div>
- </div>
- </div>
- </div>
- >>>>>>>>>>>>>>>
- smartroomheader
- 189 --
- <a onclick="handleSmartRoomSettingNewUI()" title="Settings"> Settings </a>
- >>>>>>>>>>>>>>>>>>>>
- workspaceservice (last)
- // Harshit Saxena SCB-18639 {This get the intial data for the settings modal for general and community SmartRoom}
- @AuraEnabled
- public static String getInitialRoomSettings(String ajaxData){
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- Map<String,Object> response = new Map<String,Object>();
- System.debug('Testing the request---->'+requestData);
- // Boolean oneToOneDiscussion = CommonUtils.getDataRequestAsBoolean('OneToOneDiscussion',requestData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- //String roomName = CommonUtils.getDataRequestAsString('roomName', requestData);
- Workspace__c workspaceObj=[SELECT Id, Name,IsEnhancedDiscussion__c,Type__c,Discussion_Type__c,Account__c,Account__r.Name, OwnerId,Language__c,CreatedById, Extra_Attribute2__c, Team_Display_Name__c FROM Workspace__c where id =:workspaceId];
- String colType = '';
- String AccountName= '';
- String AccountDisplayname ='';
- Boolean IsAccountMapped ;
- String roomType = '';
- String roomName = '';
- String teamDisplayName = '';
- if(workspaceObj != null )
- {
- roomType = workspaceObj.Type__c ;
- roomName = workspaceObj.Name ;
- if(workspaceObj.type__c == Constants.ROOM_TYPE_SOLUTION )
- {
- colType = workspaceObj.Discussion_Type__c; // value = public, partial , private.
- }
- else
- {
- if(workspaceObj.Account__c !=null & workspaceObj.Account__r.Name !=null )
- {
- IsAccountMapped = true ;
- AccountName = workspaceObj.Account__r.Name ;
- AccountDisplayname = workspaceObj.Extra_Attribute2__c;
- teamDisplayName = workspaceObj.Team_Display_Name__c;
- }
- }
- }
- response.put('roomType',roomType);
- response.put('colType',colType);
- response.put('IsAccountMapped',IsAccountMapped);
- response.put('hasError',false);
- response.put('AccountName', AccountName);
- response.put('AccountDisplayname', AccountDisplayname);
- response.put('roomName', roomName);
- response.put('teamDisplayName', teamDisplayName);
- return JSON.serializePretty(response);
- }
- //! Harshit Saxena SCB-18639 {This method save the community type room settings. It sets the value of the collaboration setting on the basis of the all, none , account }
- @AuraEnabled
- public static string saveCommunityRoomSettings(String ajaxData){
- Map<String,Object> response = new Map<String,Object>();
- try {
- String discussionValue = '' ;
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String colType = CommonUtils.getDataRequestAsString('Type', requestData);
- if(colType !=null)
- {
- if (colType == 'isAccount')
- {
- discussionValue = 'PARTIAL';
- System.debug(discussionValue);
- System.debug(colType);
- }
- else if (colType == 'isAll')
- {
- discussionValue = 'PUBLIC';
- System.debug(discussionValue);
- System.debug(colType);
- }
- else if (colType == 'isNone')
- {
- discussionValue = 'PRIVATE';
- System.debug(discussionValue);
- System.debug(colType);
- }
- else
- {
- discussionValue = colType;
- System.debug(discussionValue);
- System.debug(colType);
- }
- }
- else{
- System.debug('value is null ');
- }
- List<Workspace__c> workspaceObj=[SELECT Id, Discussion_Type__c FROM Workspace__c WHERE Id =: workspaceId ];
- if(workspaceObj.size() > 0 ){
- System.debug(discussionValue);
- System.debug(colType);
- for(Workspace__c wrkObj : workspaceObj){
- wrkObj.Discussion_Type__c = discussionValue ;
- }
- System.debug(workspaceObj);
- UPDATE workspaceObj ;
- }
- System.debug(discussionValue);
- System.debug(colType);
- response.put('hasError',false);
- response.put('discussionValue',discussionValue);
- System.debug(workspaceObj);
- } catch (Exception e) {
- response.put('hasError',true);
- response.put('Message',e.getMessage());
- }
- return JSON.serializePretty(response);
- }
- //! Harshit Saxena SCB-18639 {It Seach the account to be mapped to the specific SmartRoom and it is only visible in general type room}
- @AuraEnabled
- public static String searchMapAccount(String workspaceId, String keyword , String ajaxData)
- {
- Map<String,Object> response = new Map<String,Object>();
- try {
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String searchString = CommonUtils.getDataRequestAsString('keyword', requestData);
- if(searchString != null)
- {
- String str = '%' + searchString + '%';
- List<Workspace__c> workspaceObj = [ SELECT Id,Account__r.name FROM Workspace__c WHERE Account__r.name LIKE: str];
- }
- else
- {
- System.debug('Empty search keyword');
- }
- }
- catch (Exception e)
- {
- response.put('hasError', true);
- response.put('Message',e.getMessage());
- }
- // return new List<mapWrapper>() ;
- return JSON.serializePretty(response);
- }
- //! Harshit Saxena SCB-18639 {It save the genreal room settings }
- @AuraEnabled
- public static String saveGeneralRoomSettings(String ajaxData)
- {
- Map<String,Object> response = new Map<String,Object>();
- try {
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- System.debug('Testing the request---->'+requestData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String mappedAccId = CommonUtils.getDataRequestAsString('accId', requestData);
- String accMapped = CommonUtils.getDataRequestAsString('accMapped', requestData);
- //String colType = CommonUtils.getDataRequestAsString('Type', requestData);
- Workspace__c workspaceObj;
- try
- {
- Workspace__c workspaceObjBase = [SELECT Id,Account__c FROM Workspace__c WHERE id=: workspaceId];
- workspaceObj= (Workspace__c)Utils.filterRecords(workspaceObjBase);
- }
- catch(Exception e)
- {
- response.put('hasError', true);
- response.put('Message', e.getMessage());
- return JSON.serializePretty(response);
- }
- if(accMapped == 'accountMapped')
- {
- workspaceObj.Account__c = mappedAccId;
- try
- {
- DBQueryUtils.updateObjects(workspaceObj);
- response.put('hasError', false);
- response.put('Message', 'Operation successful');
- response.put('accMapped', true);
- //return JSON.serializePretty(response);
- }
- catch(Exception e1)
- {
- response.put('hasError', true);
- response.put('Message', e1.getMessage());
- //return JSON.serializePretty(response);
- }
- }
- else {
- response.put('accMapped', 'noAccountMapped');
- }
- }
- catch(Exception e1)
- {
- response.put('hasError', true);
- response.put('Message', e1.getMessage());
- }
- return JSON.serializePretty(response);
- }
- /* @AuraEnabled
- public static Map<String,Object> getMappedAccountDetails(String workspaceId){
- Map<String,Object> response = new Map<String,Object>();
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- response.put('isMapped', true);
- response.put('Message', );
- }
- @AuraEnabled
- public static String showMappedAccount(String ajaxData){
- Map<String,Object> response = new Map<String,Object>();
- String mappedAcc= '';
- try{
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String mappedAccId = CommonUtils.getDataRequestAsString('accId', requestData);
- Workspace__c workspaceObj;
- workspaceObj = [SELECT Id,Account__c,Account__r.Name FROM Workspace__c where id=: workspaceId];
- if(workspaceObj.size()>0 && Account__c == mappedAccId ){
- System.debug('Account is mapped');
- mappedAcc = Account__r.Name;
- response.put('hasError',false);
- response.put('Account__r.Name', mappedAcc);
- }
- else{
- system.debug('no account is mapped');
- }
- }
- catch(exception e ){
- response.put('hasError', true);
- response.put('messgae',e.getMessage());
- }
- return JOSN.seralizePretty(response);
- */
- @AuraEnabled
- public static String unMappAccount(String ajaxData){
- Map<String,Object> response = new Map<String,Object>();
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String mappedAccId = CommonUtils.getDataRequestAsString('accId', requestData);
- String accMapped = CommonUtils.getDataRequestAsString('accMapped', requestData);
- String colType = CommonUtils.getDataRequestAsString('Type', requestData);
- List<Workspace__c> workspaceObj = new List<Workspace__c> ();
- List<Workspace__c> workspaceObjBase = new List<Workspace__c> ();
- try
- {
- workspaceObjBase = [SELECT Id,Account__c FROM Workspace__c WHERE id=: workspaceId];
- workspaceObj= Utils.filterRecords(workspaceObjBase);
- if(workspaceObj.size()>0 ){
- for( Workspace__c wrkObj : workspaceObj ){
- if( colType == 'delete'){
- wrkObj.Account__c = null ;
- }
- else if (colType == 'edit'){
- wrkObj.Account__c = mappedAccId ;
- }
- }
- update workspaceObj;
- }
- }
- catch(Exception e)
- {
- response.put('hasError', true);
- response.put('Message', e.getMessage());
- return JSON.serializePretty(response);
- }
- response.put('hasError', false);
- if(colType == 'delete'){
- response.put('Message', 'Account deleted successfully');
- }
- else {
- response.put('Message', 'Account updated successfully');
- }
- return JSON.serializePretty(response);
- }
- @AuraEnabled
- public static String editRoomName(String ajaxData){
- Map<String,Object> response = new Map<String,Object>();
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String roomName = CommonUtils.getDataRequestAsString('roomName', requestData);
- try{
- List<Workspace__c> workspaceObj =[SELECT Id ,Name FROM Workspace__c WHERE Id=: workspaceId];
- if(workspaceObj.size()> 0 && roomName != null ){
- for( Workspace__c wrkObj : workspaceObj){
- wrkObj.Name = roomName;
- }
- }
- UPDATE workspaceObj ;
- response.put('roomName', roomName);
- response.put('hasError', false);
- }
- catch(exception e ){
- response.put('hasError', true);
- response.put('message', e.getMessage());
- }
- return JSON.serializePretty(response);
- }
- @AuraEnabled
- public static String editAccountName(String ajaxData){
- Map<String,Object> response = new Map<String,Object>();
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- String accountName = CommonUtils.getDataRequestAsString('accountName', requestData);
- try{
- List<Workspace__c> workspaceObj =[SELECT Id ,Name,Account__r.Name FROM Workspace__c WHERE Id=: workspaceId];
- if(workspaceObj.size()> 0 && accountName != null ){
- for( Workspace__c wrkObj : workspaceObj){
- wrkObj.Account__r.Name = accountName;
- }
- }
- UPDATE workspaceObj ;
- response.put('accountName', accountName);
- response.put('hasError', false);
- }
- catch(exception e ){
- response.put('hasError', true);
- response.put('message', e.getMessage());
- }
- return JSON.serializePretty(response);
- }
- //@AuraEnabled
- /* public static String accountDatatable(String ajaxData)
- {
- Map<String,Object> response = new Map<String,Object>();
- try{
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- //List<Workspace__c> workspaceObj = new List<Workspace__c> () ;
- //String colType = CommonUtils.getDataRequestAsString('Type', requestData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- try
- {
- List<AggregateResult> workspaceObjBase = [ SELECT Contact__r.Account.name, Account_Name__c FROM SR_Member__c where Smart_room__c=: workspaceId and Type__c = 'EXTERNAL' group by Contact__r.Account.name, Account_Name__c];
- // workspaceObj= (Workspace__c)Utils.filterRecords(workspaceObjBase);
- response.put('workspaceObjBase',workspaceObjBase );
- response.put('hasError', false);
- response.put('Message', 'Operation successful');
- } catch (Exception e1 )
- {
- response.put('hasError', true);
- response.put('Message', e1.getMessage());
- }
- return JSON.serializePretty(response);
- }
- catch(Exception e2){
- response.put('hasError', true);
- response.put('Message', e2.getMessage());
- }
- return JSON.serializePretty(response);
- } */
- @AuraEnabled
- public static String getRedirectURL(String ajaxData){
- Map<String,Object> requestData = (Map<String,Object>)JSON.deserializeUntyped(ajaxData);
- String workspaceId = CommonUtils.getDataRequestAsString('workspaceId', requestData);
- string roomUrl = RequestScopeDataUtils.getInstance().getRoomURL();
- String roomurls= roomUrl;//.replace('SmartRoom',''); // GT @ SCB-18832
- String redirectUrl= roomurls+'/'+Utils.getAppPackageName()+'SmartroomLogin?roomId='+workspaceId+'&email=customer_Email';
- return redirectURL;
- }
- @AuraEnabled
- public static Map<String,Object> getAccessURl(String ajaxData)
- {
- Map<String,Object> response=new Map<String,Object>();
- String finalData = SRSmartRoomService.getGuestUserURL(ajaxData);
- response = (Map<String,Object>)JSON.deserializeUntyped(finalData);
- return response;
- }
- } //!Final Brace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement