Skip to content

Commit

Permalink
Merge pull request #549 from navikt/manageSTONews
Browse files Browse the repository at this point in the history
Manage sto news
  • Loading branch information
mamikals authored Jan 22, 2024
2 parents 00ca35c + f92fede commit a66d34b
Show file tree
Hide file tree
Showing 20 changed files with 515 additions and 25 deletions.
23 changes: 7 additions & 16 deletions force-app/main/default/classes/stoHelperClass.cls
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,13 @@ public with sharing class stoHelperClass {
public static List<News> getCategoryNews(String category, String threadType) {
List<News> news = new List<News>();

if (threadType == 'BTO') {
for (BTO_News__mdt rec : [
SELECT BTO_Body__c, BTO_Header__c
FROM BTO_News__mdt
WHERE BTO_Category__c = :category
]) {
news.add(new News(rec.BTO_Header__c, rec.BTO_Body__c, rec.Id));
}
} else {
for (STO_News__mdt rec : [
SELECT STO_Body__c, STO_Header__c
FROM STO_News__mdt
WHERE STO_Category__c = :category
]) {
news.add(new News(rec.STO_Header__c, rec.STO_Body__c, rec.Id));
}
for (CRM_FAQ__c rec : [
SELECT Id, CRM_Content__c, CRM_Title__c
FROM CRM_FAQ__c
WHERE CRM_Category__c = :category AND CRM_Shown__c INCLUDES (:threadType)
ORDER BY CRM_Ordering__c ASC
]) {
news.add(new News(rec.CRM_Title__c, rec.CRM_Content__c, rec.Id));
}

if (news.size() == 0 && Test.isRunningTest()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Layout xmlns="http://soap.sforce.com/2006/04/metadata">
<excludeButtons>Submit</excludeButtons>
<layoutSections>
<customLabel>false</customLabel>
<detailHeading>false</detailHeading>
<editHeading>true</editHeading>
<label>Information</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>CRM_Title__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>CRM_Content__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>CRM_Ordering__c</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Edit</behavior>
<field>CRM_Shown__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>CRM_Category__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>OwnerId</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>false</customLabel>
<detailHeading>false</detailHeading>
<editHeading>true</editHeading>
<label>System Information</label>
<layoutColumns>
<layoutItems>
<behavior>Readonly</behavior>
<field>CreatedById</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Readonly</behavior>
<field>LastModifiedById</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>true</customLabel>
<detailHeading>false</detailHeading>
<editHeading>true</editHeading>
<label>Custom Links</label>
<layoutColumns/>
<layoutColumns/>
<layoutColumns/>
<style>CustomLinks</style>
</layoutSections>
<showEmailCheckbox>false</showEmailCheckbox>
<showHighlightsPanel>false</showHighlightsPanel>
<showInteractionLogPanel>false</showInteractionLogPanel>
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
<summaryLayout>
<masterLabel>00h7Z000002Eunt</masterLabel>
<sizeX>4</sizeX>
<sizeY>0</sizeY>
<summaryLayoutStyle>Default</summaryLayoutStyle>
</summaryLayout>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Kategori</label>
<name>CRM_Category__c</name>
</CustomFieldTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Innhold</label>
<name>CRM_Content__c</name>
</CustomFieldTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomObjectTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<caseValues>
<article>None</article>
<plural>false</plural>
<value></value>
</caseValues>
<caseValues>
<article>Indefinite</article>
<plural>false</plural>
<value></value>
</caseValues>
<caseValues>
<article>Definite</article>
<plural>false</plural>
<value></value>
</caseValues>
<caseValues>
<article>None</article>
<plural>true</plural>
<value></value>
</caseValues>
<caseValues>
<article>Indefinite</article>
<plural>true</plural>
<value></value>
</caseValues>
<caseValues>
<article>Definite</article>
<plural>true</plural>
<value></value>
</caseValues>
<gender></gender>
<layouts>
<layout>CRM_FAQ Layout</layout>
<sections>
<label></label>
<section>Custom Links</section>
</sections>
</layouts>
<nameFieldLabel></nameFieldLabel>
</CustomObjectTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Rekkefølge</label>
<name>CRM_Ordering__c</name>
</CustomFieldTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Vises på</label>
<name>CRM_Shown__c</name>
<picklistValues>
<masterLabel>BTO</masterLabel>
<translation></translation>
</picklistValues>
<picklistValues>
<masterLabel>STO</masterLabel>
<translation></translation>
</picklistValues>
</CustomFieldTranslation>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Tittel</label>
<name>CRM_Title__c</name>
</CustomFieldTranslation>
166 changes: 166 additions & 0 deletions force-app/main/default/objects/CRM_FAQ__c/CRM_FAQ__c.object-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>Accept</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Accept</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Accept</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>CancelEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>CancelEdit</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>CancelEdit</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Clone</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Clone</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Clone</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<formFactor>Large</formFactor>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<formFactor>Small</formFactor>
<type>Default</type>
</actionOverrides>
<allowInChatterGroups>false</allowInChatterGroups>
<compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
<deploymentStatus>Deployed</deploymentStatus>
<enableActivities>false</enableActivities>
<enableBulkApi>true</enableBulkApi>
<enableFeeds>false</enableFeeds>
<enableHistory>false</enableHistory>
<enableLicensing>false</enableLicensing>
<enableReports>false</enableReports>
<enableSearch>false</enableSearch>
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>Read</externalSharingModel>
<label>FAQ</label>
<nameField>
<displayFormat>FAQ-{0000}</displayFormat>
<label>FAQ Name</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>FAQs</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>Read</sharingModel>
<visibility>Public</visibility>
</CustomObject>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>CRM_Category__c</fullName>
<externalId>false</externalId>
<label>Category</label>
<required>false</required>
<trackTrending>false</trackTrending>
<type>Picklist</type>
<valueSet>
<restricted>true</restricted>
<valueSetName>STO_Category</valueSetName>
</valueSet>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>CRM_Content__c</fullName>
<externalId>false</externalId>
<label>Content</label>
<length>32768</length>
<trackTrending>false</trackTrending>
<type>Html</type>
<visibleLines>25</visibleLines>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>CRM_Ordering__c</fullName>
<externalId>false</externalId>
<label>Ordering</label>
<precision>18</precision>
<required>false</required>
<scale>0</scale>
<trackTrending>false</trackTrending>
<type>Number</type>
<unique>false</unique>
</CustomField>
Loading

0 comments on commit a66d34b

Please sign in to comment.