Skip to content

Commit

Permalink
feat: packaging updates for self-service (#50)
Browse files Browse the repository at this point in the history
* feat: move flows to base package

* fix: remove flows from service package

* feat: customize packaging for self-service installation

* fix: remove Route_To_Agent flow from base package

* fix: re-add flow back to employee package

* fix: update flow for self-service package

* fix: update GitHub actions for changed base-app setup

* fix: remove flow field metadata from base-app flow

* fix: flow and ci changes for base package
  • Loading branch information
muenzpraeger authored Dec 3, 2024
1 parent 3162968 commit 55d6595
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ jobs:
if: ${{ !env.IS_PRERELEASE }}
run: sf org create scratch -f config/cc-base-project-scratch-def.json -a scratch-org -d -y 1

# Modify local metadata for packaging
- name: 'Modify local metadata for packaging'
run: |
sed '/<actionCalls>/,/<\/actionCalls>/d' cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml > cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml && mv cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml
# Deploy source to scratch org
- name: 'Push source to scratch org'
run: sf project deploy start -d cc-base-app
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ jobs:
- name: 'Create scratch org'
run: sf org create scratch -f config/cc-base-project-scratch-def.json -a scratch-org -d -y 1

# Modify local metadata for packaging
- name: 'Modify local metadata for packaging'
run: |
sed '/<actionCalls>/,/<\/actionCalls>/d' cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml > cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml && mv cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml
# Deploy source to scratch org
- name: 'Push source to scratch org'
run: sf project deploy start -d cc-base-app
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/packaging-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ jobs:
- name: 'Remove auth file'
run: rm -f ./DEVHUB_SFDX_URL.txt

# Modify local metadata for packaging
- name: 'Modify local metadata for packaging'
run: |
cp -rpv cc-service-app/main/default/corsWhitelistOrigins cc-base-app/main/default/
cp -rpv cc-service-app/main/default/cspTrustedSites cc-base-app/main/default/
cp -rpv cc-service-app/main/default/digitalExperienceConfigs/coral* cc-base-app/main/default/digitalExperienceConfigs/
cp -rpv cc-service-app/main/default/digitalExperiences/site/coral* cc-base-app/main/default/digitalExperiences/site/
cp -rpv cc-service-app/main/default/flows/* cc-base-app/main/default/flows/
cp -rpv cc-service-app/main/default/navigationMenus/*coral* cc-base-app/main/default/navigationMenus/
cp -rpv cc-service-app/main/default/networks/coral* cc-base-app/main/default/networks/
cp -rpv cc-service-app/main/default/sites/coral* cc-base-app/main/default/sites/
cp -rpv cc-service-app/main/default/staticresources/*coral* cc-base-app/main/default/staticresources/
rm -f cc-base-app/main/default/flows/Route_to_Agent.flow-meta.xml
jq 'walk(if type == "object" and .id == "e78ba173-4372-48d8-86bf-6e4ffbc14926" then empty else . end)' cc-base-app/main/default/digitalExperiences/site/coral_cloud1/sfdc_cms__view/home/content.json > cc-base-app/main/default/digitalExperiences/site/coral_cloud1/sfdc_cms__view/home/content.json
sed '/<actionCalls>/,/<\/actionCalls>/d' cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml > cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml && mv cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml
# Create package version and extract its id
- name: 'Create package version'
id: createPackageVersion
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ jobs:
- name: 'Remove auth file'
run: rm -f ./DEVHUB_SFDX_URL.txt

# Modify local metadata for packaging
- name: 'Modify local metadata for packaging'
run: |
cp -rpv cc-service-app/main/default/corsWhitelistOrigins cc-base-app/main/default/
cp -rpv cc-service-app/main/default/cspTrustedSites cc-base-app/main/default/
cp -rpv cc-service-app/main/default/digitalExperienceConfigs/coral* cc-base-app/main/default/digitalExperienceConfigs/
cp -rpv cc-service-app/main/default/digitalExperiences/site/coral* cc-base-app/main/default/digitalExperiences/site/
cp -rpv cc-service-app/main/default/flows/* cc-base-app/main/default/flows/
cp -rpv cc-service-app/main/default/navigationMenus/*coral* cc-base-app/main/default/navigationMenus/
cp -rpv cc-service-app/main/default/networks/coral* cc-base-app/main/default/networks/
cp -rpv cc-service-app/main/default/sites/coral* cc-base-app/main/default/sites/
cp -rpv cc-service-app/main/default/staticresources/*coral* cc-base-app/main/default/staticresources/
rm -f cc-base-app/main/default/flows/Route_to_Agent.flow-meta.xml
jq 'walk(if type == "object" and .id == "e78ba173-4372-48d8-86bf-6e4ffbc14926" then empty else . end)' cc-base-app/main/default/digitalExperiences/site/coral_cloud1/sfdc_cms__view/home/content.json > cc-base-app/main/default/digitalExperiences/site/coral_cloud1/sfdc_cms__view/home/content.json
sed '/<actionCalls>/,/<\/actionCalls>/d' cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml > cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml && mv cc-base-app/main/default/flows/PersonalizedSchedule_Temp.flow-meta.xml cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml
# Bump package minor version
- name: 'Bump package minor version'
run: node bin/bump-package-minor-version.js
Expand Down
84 changes: 84 additions & 0 deletions cc-base-app/main/default/flows/PersonalizedSchedule.flow-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">

<apiVersion>62.0</apiVersion>
<description
>This flow is used to take a contacts interests and generate a report of the
available Experiences that they can enroll in today.</description>
<environments>Default</environments>
<interviewLabel
>Personalize Schedule {!$Flow.CurrentDateTime}</interviewLabel>
<label>Personalized Schedule</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>Flow</processType>
<recordLookups>
<name>Get_Contact</name>
<label>Get Contact</label>
<locationX>176</locationX>
<locationY>134</locationY>
<assignNullValuesIfNoRecordsFound
>false</assignNullValuesIfNoRecordsFound>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>recordId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<screens>
<description>Display the field generation result</description>
<name>Display_Result</name>
<label>Display Result</label>
<locationX>176</locationX>
<locationY>350</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>true</allowPause>
<fields>
<name>PromptGenerationResult</name>
<fieldText>&lt;p&gt;Insert Variable Here&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<start>
<locationX>50</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Contact</targetReference>
</connector>
</start>
<status>Active</status>
<variables>
<description
>The record Id that is passed in from the quick action.</description>
<name>recordId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
</variables>
</Flow>

0 comments on commit 55d6595

Please sign in to comment.