From cdcdda34d435959428b67d4334fba4d365233ed4 Mon Sep 17 00:00:00 2001 From: Trent Childers Date: Fri, 24 Feb 2017 15:55:27 -0600 Subject: [PATCH] added examples folder --- .../helloBadge/aura/helloBadge/helloBadge.cmp | 15 ++++++++++++ .../aura/helloBadge/helloBadge.cmp-meta.xml | 5 ++++ .../aura/helloBadge/helloBadge.design | 3 +++ .../aura/helloBadge/helloBadgeController.js | 24 +++++++++++++++++++ .../aura/strike_badge/strike_badge.cmp | 9 +++++++ .../strike_badge/strike_badge.cmp-meta.xml | 5 ++++ .../strike_badge/strike_badgeController.js | 5 ++++ examples/helloBadge/classes/helloBadge.cls | 9 +++++++ .../classes/helloBadge.cls-meta.xml | 5 ++++ 9 files changed, 80 insertions(+) create mode 100644 examples/helloBadge/aura/helloBadge/helloBadge.cmp create mode 100644 examples/helloBadge/aura/helloBadge/helloBadge.cmp-meta.xml create mode 100644 examples/helloBadge/aura/helloBadge/helloBadge.design create mode 100644 examples/helloBadge/aura/helloBadge/helloBadgeController.js create mode 100644 examples/helloBadge/aura/strike_badge/strike_badge.cmp create mode 100644 examples/helloBadge/aura/strike_badge/strike_badge.cmp-meta.xml create mode 100644 examples/helloBadge/aura/strike_badge/strike_badgeController.js create mode 100644 examples/helloBadge/classes/helloBadge.cls create mode 100644 examples/helloBadge/classes/helloBadge.cls-meta.xml diff --git a/examples/helloBadge/aura/helloBadge/helloBadge.cmp b/examples/helloBadge/aura/helloBadge/helloBadge.cmp new file mode 100644 index 0000000..20adc33 --- /dev/null +++ b/examples/helloBadge/aura/helloBadge/helloBadge.cmp @@ -0,0 +1,15 @@ + + + + + + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/examples/helloBadge/aura/helloBadge/helloBadge.cmp-meta.xml b/examples/helloBadge/aura/helloBadge/helloBadge.cmp-meta.xml new file mode 100644 index 0000000..f4dfff8 --- /dev/null +++ b/examples/helloBadge/aura/helloBadge/helloBadge.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 38.0 + A Lightning Component Bundle + diff --git a/examples/helloBadge/aura/helloBadge/helloBadge.design b/examples/helloBadge/aura/helloBadge/helloBadge.design new file mode 100644 index 0000000..19fc19b --- /dev/null +++ b/examples/helloBadge/aura/helloBadge/helloBadge.design @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/examples/helloBadge/aura/helloBadge/helloBadgeController.js b/examples/helloBadge/aura/helloBadge/helloBadgeController.js new file mode 100644 index 0000000..41d5faa --- /dev/null +++ b/examples/helloBadge/aura/helloBadge/helloBadgeController.js @@ -0,0 +1,24 @@ +({ + init : function(component, event, helper) { + var action = component.get('c.determineIfOwned'); + action.setParams({ + recordId: component.get('v.recordId') + }); + + action.setCallback(this, function(response){ + var isOwner = response.getReturnValue(); + console.log('********** made it back ' + isOwner); + component.set('v.loadBadge', true); + + if(isOwner){ + component.set('v.label', 'You are the owner of this account'); + component.set('v.theme', 'success'); + } else { + component.set('v.label', 'You are not the owner of this account'); + component.set('v.theme', 'warning'); + } + }); + + $A.enqueueAction(action); + } +}) \ No newline at end of file diff --git a/examples/helloBadge/aura/strike_badge/strike_badge.cmp b/examples/helloBadge/aura/strike_badge/strike_badge.cmp new file mode 100644 index 0000000..9e0c346 --- /dev/null +++ b/examples/helloBadge/aura/strike_badge/strike_badge.cmp @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/helloBadge/aura/strike_badge/strike_badge.cmp-meta.xml b/examples/helloBadge/aura/strike_badge/strike_badge.cmp-meta.xml new file mode 100644 index 0000000..f4dfff8 --- /dev/null +++ b/examples/helloBadge/aura/strike_badge/strike_badge.cmp-meta.xml @@ -0,0 +1,5 @@ + + + 38.0 + A Lightning Component Bundle + diff --git a/examples/helloBadge/aura/strike_badge/strike_badgeController.js b/examples/helloBadge/aura/strike_badge/strike_badgeController.js new file mode 100644 index 0000000..3fbf696 --- /dev/null +++ b/examples/helloBadge/aura/strike_badge/strike_badgeController.js @@ -0,0 +1,5 @@ +({ + themeChange : function(component, event, helper) { + component.set('v.theme', component.get('v.theme').toLowerCase()); + } +}) \ No newline at end of file diff --git a/examples/helloBadge/classes/helloBadge.cls b/examples/helloBadge/classes/helloBadge.cls new file mode 100644 index 0000000..609f6c0 --- /dev/null +++ b/examples/helloBadge/classes/helloBadge.cls @@ -0,0 +1,9 @@ +public class helloBadge { + @AuraEnabled + public static Boolean determineIfOwned(String recordId){ + String userId = UserInfo.getUserId(); + Account currentAccount = [SELECT Id, OwnerId FROM Account WHERE Id =: recordId]; + + return userId == currentAccount.OwnerId; + } +} \ No newline at end of file diff --git a/examples/helloBadge/classes/helloBadge.cls-meta.xml b/examples/helloBadge/classes/helloBadge.cls-meta.xml new file mode 100644 index 0000000..cbddff8 --- /dev/null +++ b/examples/helloBadge/classes/helloBadge.cls-meta.xml @@ -0,0 +1,5 @@ + + + 38.0 + Active +