Code Monkey home page Code Monkey logo

az-insurance's Introduction

AZ Insurance Lightning Web Runtime Sample Application

Github Workflow

AZ Insurance is a sample application that demonstrates how to build customer, partner, and marketing experiences for Salesforce Experience Cloud and Lightning Web Runtime. AZ Insurance is a fictitious insurance company. The application helps AZ Insurance to provide engaging experiences to their external partners that directly integrate with their internal systems.

Application progress

The full source code of this application will be released in stages throughout the month of July 2021. Check out the new mini-series about Experience Cloud and LWR sites, that will walk you through the key elements once released. Click Watch here on the repository to get updates on changes, and check out the playlist on YouTube.

Experience Cloud and LWR sites

Table of contents

Installing AZ Insurance using a Scratch Org

  1. Set up your environment. Follow the steps in the Quick Start: Lightning Web Components Trailhead project. The steps include:

    • Enable Dev Hub in your Trailhead Playground
    • Install Salesforce CLI
    • Install Visual Studio Code
    • Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension
  2. If you haven't already done so, authorize your hub org and provide it with an alias (myhuborg in the command below):

    sfdx auth:web:login -d -a myhuborg
  3. Clone the repository:

    git clone https://github.com/trailheadapps/az-insurance
    cd az-insurance
  4. Create a scratch org and provide it with an alias (az-insurance in the command below):

    sfdx force:org:create -s -f config/project-scratch-def.json -a az-insurance
  5. Create a dummy Experience site. This is currently a necessary intermediate step to provision Experience Cloud related metadata before deploying our site.

    sfdx force:community:create --name "Dummy" --templatename "Aloha" -p "dummy"
  6. Deploy Salesforce org metadata (does not contain Experience site metadata, a current product bug prevents a deploy of all metadata at once):

    sfdx force:source:deploy -m "ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow"
  7. Deploy Experience site metadata:

    sfdx force:source:deploy -m "ApexPage,CustomSite,ExperienceBundle,NavigationMenu,Network,Profile"
  8. Assign the LWR_Marketing_Builder permission set to the default user:

    sfdx force:user:permset:assign -n LWR_Marketing_Builder
  9. Publish the Marketing site. The site URL will be printed via the CLI, and you'll receive a notification via email:

    sfdx force:community:publish -n "LWR Demo Marketing"
  10. Open the scratch org:

    sfdx force:org:open
    

As the sample app uses data from Salesforce CMS we have to import the provided sample data.

  1. In App Launcher, enter Digital Experiences in the search box, and select that entry.

  2. Click Add Workspace.

  3. Enter AZ Insurance as CMS Workspace name, click Next.

  4. Select LWR Demo Marketing as channel, click Next, and Next.

  5. Select English as language, and also set English as Default Language. Click Next, then Done.

  6. Import media content by selecting the dropdown besides the Language button, then select Import.

  7. Select the file 2-media-content-0gU1F000000000a.zip from this projects data folder. Ensure to select Publish content after import.

  8. Import text content by selecting the dropdown besides the Language button, then select Import.

  9. Import text the file 1-content-0gU1F000000000a.zip from this projects data folder. Ensure to select Publish content after import.

  10. Open the previously provided URL to access your Experience Cloud LWR site.

Optional Installation Instructions

This repository contains several files that are relevant if you want to integrate modern web development tooling to your Salesforce development processes, or to your continuous integration/continuous deployment processes.

Code formatting

Prettier is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .prettierignore and .prettierrc files are provided as part of this repository to control the behavior of the Prettier formatter.

Code linting

ESLint is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install this extension from the Visual Studio Code Marketplace. The .eslintignore file is provided as part of this repository to exclude specific files from the linting process in the context of Lightning Web Components development.

Pre-commit hook

This repository also comes with a package.json file that makes it easy to set up a pre-commit hook that enforces code formatting and linting by running Prettier and ESLint every time you git commit changes.

To set up the formatting and linting pre-commit hook:

  1. Install Node.js if you haven't already done so

  2. Run npm install in your project's root folder to install the ESLint and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.)

Prettier and ESLint will now run automatically every time you commit changes. The commit will fail if linting errors are detected. You can also run the formatting and linting from the command line using the following commands (check out package.json for the full list):

npm run lint
npm run prettier

az-insurance's People

Contributors

dependabot[bot] avatar muenzpraeger avatar pozil avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

az-insurance's Issues

Installing AZ Insurance using a Scratch Org throwing Error at step7

Summary

Followed all the steps exactly and step 7 is throwing error:
Type Name Problem
Error
────────────────────────────────────────────────────────────────────────────────
Error LWR_Demo_Marketing1 The value for urlPathPrefix in ExperienceBundle isn't valid. Check the value and try again.

Salesforce Org Type

Scratch Org

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

CMS Home has changed names

In the readme, it says

In App Launcher, enter CMS Home in the search box, and select that entry.

However, it appears CMS Home has changed names to Digital Experiences
digitalexperiences

Use managedContentPage instead of webPage for LNS

handleClick(event) {
this[NavigationMixin.Navigate]({
type: 'standard__webPage',
attributes: {
url: `${basePath}/blog/post?blogId=${event.currentTarget.dataset.id}`
}
});
}

Should be using a managedContentPage

handleClick(event) { 
     this[NavigationMixin.Navigate]({ 
         type: 'standard__managedContentPage',
        attributes :{
            'contentTypeName': 'blog',
            'contentKey': ${event.currentTarget.dataset.id}'
        }
     }); 
 } 

README : a permission set is required to get admin rights for CMS Digital Experiences

Summary

The README instructions are no longer correct for setting up CMS Digital Experiences : it is necessary to create a perm set for admin to get rights to administrate CMS Workspaces et al.

Salesforce Org Type

Scratch Org

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Error force-app/main/default/experiences/LWR_Demo_Agent1.site-meta.xml Required ThemeLayouts are missing in the layouts section of LWR_Demo_Agent1/themes/buildYourOwnLWR.json. Add mappings for ServiceNotAvailable and try again.

Hi there,

I got this the below error when deploying the community

Error force-app/main/default/experiences/LWR_Demo_Agent1.site-meta.xml Required ThemeLayouts are missing in the layouts section of LWR_Demo_Agent1/themes/buildYourOwnLWR.json. Add mappings for ServiceNotAvailable and try again.

Regards,

Error when deploying

Summary

not able to deploy

Steps To Reproduce:

Do before steps like cloning etc..

sfdx force:source:deploy -m ApexPage,CustomSite,ExperienceBundle,NavigationMenu,Network,Profile

when you run this command it shows the error

Expected result

Success

Actual result

failed

Additional information

image

CMSImageWithTitle

Summary

Compontent throws error after mouseOver an selected Image. In scrachtOrga as well as in our dev Sandbox. Hope I've done nothing wrong...

Salesforce Org Type

Scratch Org

Steps To Reproduce

  1. Insert component cmsImageWithTitle on LWR Site.
  2. Add picture from CMS
  3. Move mouse over picture
  4. Error happens in edit as well as in preview mode

Current Behavior

  1. Image is displayed
  2. Error occurs on mouseOver
  3. After reload, error still occurs but image isn't displayed

Expected Behavior

No response

Relevant Log Output

{"subject":"window error","message":"Cannot read properties of undefined (reading 'apply')","stack":"TypeError: Cannot read properties of undefined (reading 'apply')\n

Code of Conduct

  • I agree to follow this project's Code of Conduct

Channel not available

Summary

Hi.
We have an Experience cloud LWR site, Enhanced CMS workspace, connected them each other. In site we can choose the content from CMS in LWC component (the ContentReference property) and get the content key.
I tried to use the ManagedContentController class as is in our project, but calls to apex fails with error ConnectApiException with message "You don't have access to this channel".
Can anybody point to solution or mistakes?

I have already spent 2 days on google and salesforce help searching.

Salesforce Org Type

Sandbox

Steps To Reproduce

No response

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

error while deploying org metadata in Scratch org

Summary

I have been following step by step the instructions to deploy the sample app.
When I launch the command to deploy SF orga metadata I get a "Unexpected file found in package directory"

I am using the latest sfdx-cli.
(sfdx-cli/7.150.0 darwin-x64 node-v16.15.0)

Salesforce Org Type

Scratch Org

Steps To Reproduce

sfdx auth:web:login -d -a myhuborg
git clone https://github.com/trailheadapps/az-insurance
cd az-insurance
sfdx force:org:create -s -f config/project-scratch-def.json -a az-insurance
sfdx force:community:create --name "Dummy" --templatename "Aloha" -p "dummy"
sfdx force:source:deploy -m ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow

Current Behavior

Error message :

az-insurance % sfdx force:source:deploy -m ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow
ERROR running force:source:deploy: Unexpected file found in package directory: /Users/Pascal/Code/az-insurance/force-app/main/default/managedContentTypes/cms_actionimage.managedContentType-meta.xml

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

cannot read contentId of undefined

Summary

I can't read contentId and crashing the component inside the community
I can't pass in input at the apex methods the variable of contentId because it's undefined

Steps To Reproduce:

  1. This is step 1.
  2. This is step 2. All steps should start with '1.'

Expected result

Describe what should have happened.

Actual result

Describe what actually happened instead.

Additional information

Feel free to attach a screenshot or code snippets.

unable to deploy in to scratch org

getting below error :
Unexpected file found in package directory: C:\Users\myd\Documents\TDX\az-insurance\force-app\main\default\managedContentTypes\cms_actionimage.managedContentType-meta.xml
when i ran below command:
sfdx force:source:deploy -m ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow

getting same error when i tried convert sfdx source to mdapi (sfdx force:source:convert -d mdapi-source)

please help me if any work around there?

Thanks in advance.

Install instructions for Dev Org

Summary

I'd like to see a set of instructions that outline how to install A-Z insurance in an org with other existing Experience Cloud sites on a Dev org that is a refresh from production.

Suggested Solution

As it is done for the scratch org but what do I need to do for an existing org or even if there is no org but it is a standard dev sandbox.

Alternative Solutions

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Your site needs a route with route type service-not-available

While installing the code , I was getting the below error - [ In field: siteAdmin - no User named [email protected] foundError ] . i have fixed this by adding 'My UserName'

Error force-app\main\default\sites\LWR_Demo_Marketing.site-meta.xml In field: siteAdmin - no User named [email protected] foundError force-app\main\default\navigationMenus\Marketing_Default_Navigation.navigationMenu-meta.xml In field: Network - no Network named LWR Demo Marketing found

still not able to deploy : getting new issue.

Error force-app\main\default\experiences\LWR_Demo_Marketing1.site-meta.xml Your site needs a route with route type service-not-available. Update your file and try again.
ERROR running force:source:deploy: Deploy failed.

Could you please check

Wrong reference in README file

Summary

In README.md ➡️ CMS import ➡️ Step 9

The link is pointing to the wrong resource, here the evidence:

image

I can create the PR, if you want.

Salesforce Org Type

Scratch Org

Steps To Reproduce

  1. Go to README.md
  2. Click on the link in CMS import > Step 9

Current Behavior

I'm redirected to the resource 2-media-content-0gU1F000000000a.zip

Expected Behavior

I want to be redirected to 1-content-0gU1F000000000a.zip

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Readme CLI commands don't work

In the readme, the SFDX CLI command given is:
sfdx force:source:deploy -m ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow

However, this fails with CLI error: The specified metadata type is unsupported: [apexclass layout customobject lightningcomponentbundle managedcontenttype customobject staticresource customtab permissionset flow]

The readme needs to be updated to include double quotation marks around the metadata types

sfdx force:source:deploy -m "ApexClass,Layout,CustomObject,LightningComponentBundle,ManagedContentType,CustomObject,StaticResource,CustomTab,PermissionSet,Flow"

I believe this is an issue for all the commands with this format

Marketing LWR site won't publish unless it's Active first

I wasn't able to get the Marketing LWR site to publish using the CLI or even by clicking "Publish" in the Builder.

To get it published, I had to go to

Setup --> Digital Experiences --> LWR Demo Marketing --> Workspaces --> Administration --> Settings --> Activate

After activating, I could then successfully publish the site.

Not sure if just me, but it might be worth adding this step to the readme as well

Facing Error 'SiteDotCom source file expected' while deploying

Summary

Hi, I am facing the below error while deploying. I see there are no have SiteDotCom metadata files in the repository.

ERROR running force:source:deploy: ../az-insurance/force-app/main/default/sites/LWR_Demo_Agent.site-meta.xml: Expected source files for type 'SiteDotCom'

Salesforce Org Type

Scratch Org

Steps To Reproduce

While running the cmd
sfdx force:source:deploy -m ApexPage,CustomSite,ExperienceBundle,NavigationMenu,Network,Profile

Current Behavior

No response

Expected Behavior

No response

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Create a dummy Experience site is throwing error

image
5 th step
**Create a dummy Experience site. This is currently a necessary intermediate step to provision Experience Cloud related metadata before deploying our site

sfdx force:community:create --name "Dummy" --templatename "Aloha" -p "dummy"**

is throwing error
ERROR running force:community:create: The requested resource does not exist

Test Classes for Apex Classes

Summary

Could you please provide apex test classes for some of the classes used throughout the LWCs here? If I am missing them then please point me in the right direction. Thanks!

Suggested Solution

No response

Alternative Solutions

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Error when deploying into a SDO / Enterprise org

Summary

Got an error when doing the following installation step:

adipalma-ltm1:config adipalma$ sfdx force:source:deploy -m ApexPage,CustomSite,ExperienceBundle,NavigationMenu,Network,Profile
*** Deploying with SOAP API ***
Deploy ID: 0Af0900000MrR4ECAV
SOURCE PROGRESS | ████████████████████████████████████░░░░ | 10/11 Components

=== Component Failures [1]
Type Name Problem
───── ─────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Error LWR_Demo_Agent1 Required ThemeLayouts are missing in the layouts section of LWR_Demo_Agent1/themes/buildYourOwnLWR.json. Add mappings for ServiceNotAvailable and try again.

Steps To Reproduce:

I used the steps reported in the main readme file. Only difference is that I’m using a standard org not a scratch org.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.