Skip to content

Commit

Permalink
Initial commit of DreamHouse metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanama committed Aug 17, 2021
1 parent f92a9a5 commit 7be120f
Show file tree
Hide file tree
Showing 46 changed files with 689 additions and 0 deletions.
Binary file added PROJECT/Exercise Files/.DS_Store
Binary file not shown.
Binary file not shown.
29 changes: 29 additions & 0 deletions PROJECT/Exercise Files/feature-chan-map/RecordMap/RecordMap.cmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes"
access="global">

<aura:attribute name="recordId" type="Id" />
<aura:attribute name="dsRecordId" type="Id" />
<aura:attribute name="sObject" type="SObject" />
<aura:attribute name="titleField" type="String" default="Name" />
<aura:attribute name="latField" type="String" default="Location__Latitude__s" />
<aura:attribute name="longField" type="String" default="Location__Longitude__s" />
<aura:attribute name="title" type="String" />
<aura:attribute name="fields" type="String[]" default="['Id']" />
<aura:attribute name="mapMarkers" type="Object[]" />
<aura:attribute name="zoomLevel" type="Integer" default="16" />

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<force:recordData aura:id="service"
recordId="{!v.dsRecordId}"
targetFields="{!v.sObject}"
fields="{!v.fields}"
recordUpdated="{!c.onRecordUpdated}" />

<aura:handler event="ltng:selectSObject" action="{!c.recordChangeHandler}" />

<lightning:card title="{!v.title}" iconName="custom:custom106">
<lightning:map mapMarkers="{!v.mapMarkers}" zoomLevel="{!v.zoomLevel}" />
</lightning:card>

</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="urn:metadata.tooling.soap.sforce.com" fqn="RecordMap">
<apiVersion>47.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.THIS .slds-card__body {
margin-bottom: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<design:component label="Record Map">
<design:attribute name="titleField" label="Title Field" default="Name"/>
<design:attribute name="latField" label="Latitude Field" default="Location__Latitude__s" />
<design:attribute name="longField" label="Longitude Field" default="Location__Longitude__s" />
</design:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
({
doInit : function(component, event, helper) {
component.set("v.fields", ["Id", component.get("v.latField"), component.get("v.longField"), component.get("v.titleField")]);
var recordId = component.get("v.recordId");
component.set("v.dsRecordId", recordId);
helper.reloadRecord(component);
},

recordChangeHandler : function(component, event, helper) {
console.log('recordChangeHandler');
var id = event.getParam("recordId");
component.set("v.dsRecordId", id);
helper.reloadRecord(component);
},

onRecordUpdated : function(component, event) {
console.log('onRecordUpdated');
var sObject = component.get("v.sObject");
if (sObject) {
component.set("v.title", sObject[component.get("v.titleField")]);
component.set("v.mapMarkers", [
{
location: {
Latitude: sObject[component.get("v.latField")],
Longitude: sObject[component.get("v.longField")]
}
}
]);
}
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
({
reloadRecord : function(component) {
var service = component.find("service");
service.reloadRecord(false, function() {
var sObject = component.get("v.sObject");
component.set("v.mapMarkers", [
{
location: {
Latitude: sObject[component.get("v.latField")],
Longitude: sObject[component.get("v.longField")]
}
}
]);
});
}

})
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<aura:component access="global">

<aura:attribute name="slideIndex" type="Integer" default="0"/>
<aura:attribute name="slideWidth" type="Integer" default="0"/>
<aura:attribute name="slides" type="Object[]"/>

<div aura:id="gallery" class="gallery">
<div class="filmstrip" style="{! 'margin-left: -' + (v.slideIndex * v.slideWidth) + 'px' }">
<aura:iteration items="{!v.slides}" var="slide" indexVar="index">
<div class="slide" style="{!'width:' + v.slideWidth + 'px;background-image:url(' + slide + ')' }"></div>
</aura:iteration>
</div>
<div class="{! v.slideWidth>640 ? 'btn prev x-large' : 'btn prev'}">
<lightning:buttonIcon variant="border-filled" onclick="{!c.prev}"
size="large" iconName="utility:chevronleft"
disabled="{! v.slideIndex &lt;= 0 }" />
</div>
<div class="{! v.slideWidth>640 ? 'btn next x-large' : 'btn next'}">
<lightning:buttonIcon variant="border-filled" onclick="{!c.next}"
size="large" iconName="utility:chevronright"
disabled="{! v.slideIndex &gt;= (v.slides.length-1) }" />
</div>
</div>
</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.THIS {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}

.THIS * {
box-sizing: border-box;
}

.THIS .filmstrip {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
transition: all .5s ease-in-out;
height: 100%;
display: inline-block;
white-space: nowrap;
}

.THIS .slide {
height: 100%;
display: inline-block;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}

.THIS .btn {
position: absolute;
}

.THIS .btn.next {
top: 44%;
right: 6px;
}

.THIS .btn.prev {
top: 44%;
left: 6px;
}

.THIS .btn.fullscreen,
.THIS .btn.close
{
bottom: 0;
left: 0;
}

.THIS .btn.x-large .slds-button {
width: 3.5rem;
height: 3.5rem;
}
.THIS .btn.x-large .slds-button__icon {
width: 1.7rem;
height: 1.7rem;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
({
next: function(component) {
var slideIndex = component.get("v.slideIndex");
var slides = component.get("v.slides");
if (slideIndex + 1 < slides.length) {
slideIndex = slideIndex + 1;
component.set("v.slideIndex", slideIndex);
}
},

prev: function(component) {
var slideIndex = component.get("v.slideIndex");
if (slideIndex > 0) {
slideIndex = slideIndex - 1;
component.set("v.slideIndex", slideIndex);
}
}

})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
({
setSlideWidth: function (component) {
var slideWidth = component.find("gallery").getElement().offsetWidth;
component.set("v.slideWidth", slideWidth);
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
({
afterRender: function (component, helper) {
this.superAfterRender();
helper.setSlideWidth(component, helper);
}
})
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<aura:component implements="flexipage:availableForAllPageTypes"
access="global">

<aura:attribute name="fullScreen" type="Boolean" default="false"/>
<aura:attribute name="animations" type="Boolean" default="true"/>
<aura:attribute name="slides" type="Object[]"/>

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

<lightning:card iconName="utility:image" title="Picture Gallery">
<aura:set attribute="actions">
<lightning:buttonIcon onclick="{!c.fullScreen}" size="large" iconName="utility:expand" />
</aura:set>
<c:PictureCarousel slides="{!v.slides}"/>
<aura:if isTrue="{!v.fullScreen==true}">
<div role="dialog" tabindex="-1" aria-labelledby="header43" class="slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<c:PictureCarousel slides="{!v.slides}"/>
</div>

<div class="btn slds-modal__close close x-large">
<lightning:buttonIcon variant="border-filled" onclick="{!c.closeDialog}" size="large" iconName="utility:close" />
</div>

</div>
<div class="slds-backdrop slds-backdrop--open"></div>
</aura:if>
</lightning:card>

</aura:component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.THIS * {
box-sizing: border-box;
}

.THIS .slds-card__body {
height: 340px;
margin-bottom: 0;
}

.THIS .slds-modal__container {
margin-top: 100px;
height: 90%;
width: 90%;
max-width: initial;
}

.THIS .slds-modal__close {
position: absolute;
top: 100px;
right: 5%;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<design:component label="Picture Gallery">
<design:attribute name="animations" label="Animations" description="Animated transitions" />
</design:component>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
({
doInit : function(component) {
// Hardcoding images in this demo component
component.set("v.slides", [
'https://s3-us-west-1.amazonaws.com/sfdc-demo/houses/living_room.jpg',
'https://s3-us-west-1.amazonaws.com/sfdc-demo/houses/eatinkitchen.jpg',
'https://s3-us-west-1.amazonaws.com/sfdc-demo/houses/kitchen.jpg'
]);
},

fullScreen : function(component) {
component.set("v.fullScreen", true);
},

closeDialog : function(component) {
component.set("v.fullScreen", false);
}

})
16 changes: 16 additions & 0 deletions PROJECT/Water4Plants/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
**/lwc/**/*.css
**/lwc/**/*.html
**/lwc/**/*.json
**/lwc/**/*.svg
**/lwc/**/*.xml
**/aura/**/*.auradoc
**/aura/**/*.cmp
**/aura/**/*.css
**/aura/**/*.design
**/aura/**/*.evt
**/aura/**/*.json
**/aura/**/*.svg
**/aura/**/*.tokens
**/aura/**/*.xml
**/aura/**/*.app
.sfdx
12 changes: 12 additions & 0 deletions PROJECT/Water4Plants/.forceignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#

package.xml

# LWC configuration files
**/jsconfig.json
**/.eslintrc.json

# LWC Jest
**/__tests__/**
Loading

0 comments on commit 7be120f

Please sign in to comment.