generated from navikt/crm-shared-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
184 additions
and
12 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
force-app/main/default/lwc/threadExpandedTimeline/threadExpandedTimeline.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.padding-border-bottom { | ||
border-bottom: 1px solid black; | ||
padding-bottom: 1.5rem; | ||
} | ||
|
||
.button-padding { | ||
padding-bottom: 1rem; | ||
padding-top: 1.5rem; | ||
} |
13 changes: 13 additions & 0 deletions
13
force-app/main/default/lwc/threadExpandedTimeline/threadExpandedTimeline.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<section role="log" class="slds-theme_default padding-border-bottom"> | ||
<template if:true={hasMessages}> | ||
<template for:each={messages} for:item="message"> | ||
<c-crm-messaging-message-container message={message} key={message.Id}> | ||
</c-crm-messaging-message-container> | ||
</template> | ||
</template> | ||
</section> | ||
<div class="button-padding"> | ||
<c-nks-button button-label="Behandle henvendelse" onclick={openRecord} is-link standard-length></c-nks-button> | ||
</div> | ||
</template> |
60 changes: 60 additions & 0 deletions
60
force-app/main/default/lwc/threadExpandedTimeline/threadExpandedTimeline.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { LightningElement, api, wire } from 'lwc'; | ||
import { NavigationMixin } from 'lightning/navigation'; | ||
import { getRelatedListRecords } from 'lightning/uiRelatedListApi'; | ||
import { publishToAmplitude } from 'c/amplitude'; | ||
|
||
export default class ThreadExpandedTimeline extends NavigationMixin(LightningElement) { | ||
@api recordId; | ||
@api logEvent; | ||
messages; | ||
hasMessages = false; | ||
error; | ||
|
||
@wire(getRelatedListRecords, { | ||
parentRecordId: '$recordId', | ||
relatedListId: 'Messages__r', | ||
fields: [ | ||
'Message__c.Id', | ||
'Message__c.CRM_Message_Text__c', | ||
'Message__c.CRM_Type__c', | ||
'Message__c.CRM_Event_Type__c', | ||
'Message__c.CRM_Sent_date__c', | ||
'Message__c.CRM_From_User__c', | ||
'Message__c.CRM_From_Contact__c', | ||
'Message__c.CRM_From_First_Name__c', | ||
'Message__c.CRM_External_Message__c', | ||
'Message__c.CRM_From_Label__c' | ||
], | ||
sortBy: ['Message__c.CRM_Sent_date__c'] | ||
}) | ||
wiredMessages(result) { | ||
if (result.error) { | ||
this.error = result.error; | ||
console.log('Error: ' + JSON.stringify(result.error, null, 2)); | ||
} else if (result.data) { | ||
this.messages = result.data.records.map((record) => { | ||
const retObj = {}; | ||
Object.keys(record.fields).forEach((field) => { | ||
retObj[field] = record.fields[field].value; | ||
}); | ||
return retObj; | ||
}); | ||
this.hasMessages = true; | ||
} | ||
} | ||
|
||
openRecord(event) { | ||
event.stopPropagation(); | ||
this[NavigationMixin.Navigate]({ | ||
type: 'standard__recordPage', | ||
attributes: { | ||
recordId: this.recordId, | ||
objectApiName: 'Conversation_note__c', | ||
actionName: 'view' | ||
} | ||
}); | ||
if (this.logEvent) { | ||
publishToAmplitude('Timeline', { type: 'Navigate to record' }); | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
force-app/main/default/lwc/threadExpandedTimeline/threadExpandedTimeline.js-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>62.0</apiVersion> | ||
<isExposed>false</isExposed> | ||
</LightningComponentBundle> |
18 changes: 18 additions & 0 deletions
18
.../main/default/objects/Thread__c/fields/CRM_Journal_Status_Formula_Icons__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>CRM_Journal_Status_Formula_Icons__c</fullName> | ||
<externalId>false</externalId> | ||
<formula>CASE(CRM_Journal_Status__c, | ||
'Journal Completed', IMAGE('/resource/circles/circle_green.svg', 'Journalført', 18,18)+ ' Journalført', | ||
'Journal Error', IMAGE('/resource/circles/circle_red.svg', 'Journalføring feilet', 18,18)+ ' Journalføring feilet', | ||
'Journal Started', IMAGE('/resource/circles/circle_blue.svg', 'Journalføring registrert', 18,18)+ ' Journalføring registrert', | ||
IMAGE('/resource/circles/circle_grey.svg', 'Ikke journalført', 18,18) + ' Ikke journalført' | ||
)</formula> | ||
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs> | ||
<label>Journal Status</label> | ||
<required>false</required> | ||
<trackHistory>false</trackHistory> | ||
<trackTrending>false</trackTrending> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
12 changes: 1 addition & 11 deletions
12
force-app/main/default/objects/Thread__c/fields/CRM_Timeline_Name__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
force-app/main/default/objects/Thread__c/fields/CRM_Timeline_status__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>CRM_Timeline_status__c</fullName> | ||
<externalId>false</externalId> | ||
<formula>IF(CRM_isActive__c == false, | ||
'Lukket', | ||
IF(ISBLANK(CRM_Assignee_NAV_Unit__c), | ||
IF(ISBLANK(CRM_Case__c), | ||
'', | ||
CASE(CRM_Case__r.Status, | ||
'New', 'Åpen', | ||
'Escalated', 'Åpen', | ||
'Forwarded', 'Åpen', | ||
'On Hold', 'Besvart', | ||
'In progress', 'Under Arbeid', | ||
'Reserved', 'Under Arbeid', | ||
'Closed', 'Lukket', | ||
'')), | ||
'Under Arbeid'))</formula> | ||
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs> | ||
<label>Timeline status</label> | ||
<required>false</required> | ||
<trackHistory>false</trackHistory> | ||
<trackTrending>false</trackTrending> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
40 changes: 40 additions & 0 deletions
40
force-app/main/default/objects/Thread__c/fields/STO_Timeline_Name__c.field-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fullName>STO_Timeline_Name__c</fullName> | ||
<externalId>false</externalId> | ||
<formula> | ||
IF(ISPICKVAL(NKS_Experience_Site_Source__c, 'Fedrekvotesaken'), 'Fedrekvotesaken: Kvittering', | ||
IF(ISPICKVAL(CRM_Thread_Type__c,'STO') || ISPICKVAL(CRM_Thread_Type__c,'STB') || ISPICKVAL(CRM_Thread_Type__c,'BTO'), | ||
IF(ISPICKVAL(CRM_Thread_Type__c, 'STO'),'Skriv til oss', IF(ISPICKVAL(CRM_Thread_Type__c, 'BTO'), 'Beskjed til oss', 'Skriv til bruker')) + | ||
IF(ISBLANK(CRM_Theme__c), IF(ISPICKVAL(STO_Category__c, ''), '', ' - ' + TEXT(STO_Category__c)), ' - ' + CRM_Theme__r.Name) + | ||
IF(CRM_Number_of_unread_Messages__c != 0, | ||
' (' + | ||
TEXT(CRM_Number_of_unread_Messages__c) + | ||
IF(CRM_Number_of_unread_Messages__c > 1, | ||
' uleste meldinger', | ||
' ulest melding' | ||
), | ||
' (Lest' | ||
) +')', | ||
CASE(CRM_Thread_Type__c, "CHAT", | ||
'Chat' + | ||
IF( | ||
AND( | ||
NOT(ISBLANK(CRM_Theme_Name__c)), | ||
NOT(ISBLANK(CRM_Theme_Group_Name__c)) | ||
), | ||
' - ' + CRM_Theme_Group_Name__c + ', ' + CRM_Theme_Name__c, | ||
' - ' + CRM_Theme_Group_Name__c | ||
) | ||
, "Tråd") | ||
) | ||
) | ||
</formula> | ||
<formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs> | ||
<label>STO Timeline Name</label> | ||
<required>false</required> | ||
<trackHistory>false</trackHistory> | ||
<trackTrending>false</trackTrending> | ||
<type>Text</type> | ||
<unique>false</unique> | ||
</CustomField> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters