diff --git a/force-app/main/default/applications/Spotify.app-meta.xml b/force-app/main/default/applications/Spotify.app-meta.xml index fee19f9..59ca0b0 100644 --- a/force-app/main/default/applications/Spotify.app-meta.xml +++ b/force-app/main/default/applications/Spotify.app-meta.xml @@ -1,8 +1,9 @@ - + View - Action override created by Lightning App Builder during activation. + Action override created by Lightning App Builder during activation. Album_Record_Page Large false @@ -11,7 +12,8 @@ View - Action override created by Lightning App Builder during activation. + Action override created by Lightning App Builder during activation. Album_Record_Page Small false @@ -20,57 +22,63 @@ View - Action override created by Lightning App Builder during activation. - Playlist_Record_Page - Small + Action override created by Lightning App Builder during activation. + Artist_Record_Page1 + Large false Flexipage - Playlist__c + Artist__c View - Action override created by Lightning App Builder during activation. - Playlist_Record_Page - Large + Action override created by Lightning App Builder during activation. + Artist_Record_Page1 + Small false Flexipage - Playlist__c + Artist__c View - Action override created by Lightning App Builder during activation. - Track_Record_Page - Large + Action override created by Lightning App Builder during activation. + Playlist_Record_Page + Small false Flexipage - Track__c + Playlist__c View - Action override created by Lightning App Builder during activation. - Track_Record_Page - Small + Action override created by Lightning App Builder during activation. + Playlist_Record_Page + Large false Flexipage - Track__c + Playlist__c View - Action override created by Lightning App Builder during activation. - Artist_Record_Page + Action override created by Lightning App Builder during activation. + Track_Record_Page Large false Flexipage - Artist__c + Track__c View - Action override created by Lightning App Builder during activation. - Artist_Record_Page + Action override created by Lightning App Builder during activation. + Track_Record_Page Small false Flexipage - Artist__c + Track__c #20D860 @@ -90,6 +98,7 @@ Playlist__c Album__c ClientCredential__c + Log__c Lightning Spotify_UtilityBar diff --git a/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls b/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls new file mode 100644 index 0000000..8b53348 --- /dev/null +++ b/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls @@ -0,0 +1,14 @@ +@isTest +private class SpotifyRequestLogTriggerTest { + @isTest static void spotifyRequestLogTriggerTest() { + // prepare data + Spotify_Request_Log__e errorEvent = new Spotify_Request_Log__e(ApexError__c = 'error'); + // test + Test.startTest(); + EventBus.publish(errorEvent); + Test.stopTest(); + //assert + List error = [SELECT ApexError__c FROM Log__c WHERE ApexError__c =: errorEvent.ApexError__c]; + Assert.isFalse(error.isEmpty()); + } +} \ No newline at end of file diff --git a/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls-meta.xml b/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls-meta.xml new file mode 100644 index 0000000..c14e405 --- /dev/null +++ b/force-app/main/default/classes/triggers/SpotifyRequestLogTriggerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active + diff --git a/force-app/main/default/objects/Log__c/Log__c.object-meta.xml b/force-app/main/default/objects/Log__c/Log__c.object-meta.xml new file mode 100644 index 0000000..56559d4 --- /dev/null +++ b/force-app/main/default/objects/Log__c/Log__c.object-meta.xml @@ -0,0 +1,167 @@ + + + + Accept + Default + + + Accept + Large + Default + + + Accept + Small + Default + + + CancelEdit + Default + + + CancelEdit + Large + Default + + + CancelEdit + Small + Default + + + Clone + Default + + + Clone + Large + Default + + + Clone + Small + Default + + + Delete + Default + + + Delete + Large + Default + + + Delete + Small + Default + + + Edit + Default + + + Edit + Large + Default + + + Edit + Small + Default + + + List + Default + + + List + Large + Default + + + List + Small + Default + + + New + Default + + + New + Large + Default + + + New + Small + Default + + + SaveEdit + Default + + + SaveEdit + Large + Default + + + SaveEdit + Small + Default + + + Tab + Default + + + Tab + Large + Default + + + Tab + Small + Default + + + View + Default + + + View + Large + Default + + + View + Small + Default + + false + SYSTEM + Deployed + false + true + false + false + false + false + false + true + true + Private + Feminine + + + LE-{000000} + + AutoNumber + + Logs + + ReadWrite + Public + diff --git a/force-app/main/default/objects/Log__c/fields/ApexError__c.field-meta.xml b/force-app/main/default/objects/Log__c/fields/ApexError__c.field-meta.xml new file mode 100644 index 0000000..d8bdb55 --- /dev/null +++ b/force-app/main/default/objects/Log__c/fields/ApexError__c.field-meta.xml @@ -0,0 +1,11 @@ + + + ApexError__c + false + + 255 + false + false + Text + false + diff --git a/force-app/main/default/objects/Log__c/fields/Endpoint__c.field-meta.xml b/force-app/main/default/objects/Log__c/fields/Endpoint__c.field-meta.xml new file mode 100644 index 0000000..cfc5597 --- /dev/null +++ b/force-app/main/default/objects/Log__c/fields/Endpoint__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Endpoint__c + false + + 255 + false + false + Text + false + diff --git a/force-app/main/default/objects/Log__c/fields/Message__c.field-meta.xml b/force-app/main/default/objects/Log__c/fields/Message__c.field-meta.xml new file mode 100644 index 0000000..0a5d315 --- /dev/null +++ b/force-app/main/default/objects/Log__c/fields/Message__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Message__c + false + + 255 + false + false + Text + false + diff --git a/force-app/main/default/objects/Log__c/fields/Status__c.field-meta.xml b/force-app/main/default/objects/Log__c/fields/Status__c.field-meta.xml new file mode 100644 index 0000000..17c3410 --- /dev/null +++ b/force-app/main/default/objects/Log__c/fields/Status__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Status__c + false + + 3 + false + 0 + false + Number + false + diff --git a/force-app/main/default/objects/Log__c/listViews/All.listView-meta.xml b/force-app/main/default/objects/Log__c/listViews/All.listView-meta.xml new file mode 100644 index 0000000..8dd05b7 --- /dev/null +++ b/force-app/main/default/objects/Log__c/listViews/All.listView-meta.xml @@ -0,0 +1,6 @@ + + + All + Everything + + diff --git a/force-app/main/default/permissionsets/Spotify_Admin.permissionset-meta.xml b/force-app/main/default/permissionsets/Spotify_Admin.permissionset-meta.xml index 63901ae..d293af4 100644 --- a/force-app/main/default/permissionsets/Spotify_Admin.permissionset-meta.xml +++ b/force-app/main/default/permissionsets/Spotify_Admin.permissionset-meta.xml @@ -2,4 +2,33 @@ false + + true + Log__c.ApexError__c + true + + + true + Log__c.Endpoint__c + true + + + true + Log__c.Message__c + true + + + true + Log__c.Status__c + true + + + true + true + true + true + false + Log__c + false + diff --git a/force-app/main/default/tabs/Log__c.tab-meta.xml b/force-app/main/default/tabs/Log__c.tab-meta.xml new file mode 100644 index 0000000..7af5cac --- /dev/null +++ b/force-app/main/default/tabs/Log__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom44: Hammer + diff --git a/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger b/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger new file mode 100644 index 0000000..5206e3f --- /dev/null +++ b/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger @@ -0,0 +1,17 @@ +trigger SpotifyRequestLogTrigger on Spotify_Request_Log__e(after insert) { + List logListErrors = new List(); + + for (Spotify_Request_Log__e eventError : Trigger.new) { + Log__c error = new Log__c( + Message__c = eventError?.Message__c, + Status__c = eventError?.Status__c, + Endpoint__c = eventError?.Endpoint__c, + ApexError__c = eventError?.ApexError__c + ); + logListErrors.add(error); + } + + if (!logListErrors.isEmpty()) { + insert logListErrors; + } +} diff --git a/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger-meta.xml b/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger-meta.xml new file mode 100644 index 0000000..26b9451 --- /dev/null +++ b/force-app/main/default/triggers/SpotifyRequestLogTrigger.trigger-meta.xml @@ -0,0 +1,5 @@ + + + 59.0 + Active +