Skip to content

Commit

Permalink
Reporting / Better change detection all round.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Jan 31, 2019
1 parent fa9b462 commit 1abd54b
Show file tree
Hide file tree
Showing 51 changed files with 2,108 additions and 751 deletions.
375 changes: 245 additions & 130 deletions uSync8.BackOffice/App_Plugins/uSync8/dashboard.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions uSync8.BackOffice/App_Plugins/uSync8/lang/en-US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
<key alias="intro">Database elements to and from disk</key>

<key alias="import">Import</key>
<key alias="importforce">Full Import</key>
<key alias="report">Report</key>
<key alias="export">Export</key>

<key alias="details">Details</key>

<key alias="handlers">Item Handlers</key>
<key alias="savesettings">Save Settings</key>
</area>
</language>
51 changes: 51 additions & 0 deletions uSync8.BackOffice/App_Plugins/uSync8/uSyncDashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,46 @@
vm.runmode = modes.NONE;

vm.showAll = false;
vm.settingsView = false;

vm.settings = {};
vm.handlers = [];
vm.status = {};

vm.reportAction = '';

// buttons

vm.importButton = {
state: 'init',
defaultButton: {
labelKey: "usync_import",
handler: importItems
},
subButtons: [{
labelKey: "usync_importforce",
handler: importForce
}]
};


// functions
vm.report = report;
vm.exportItems = exportItems;
vm.importForce = importForce;
vm.importItems = importItems;

vm.saveSettings = saveSettings;

vm.toggleDetails = toggleDetails;
vm.getTypeName = getTypeName;
vm.toggleAll = toggleAll;
vm.countChanges = countChanges;
vm.calcPercentage = calcPercentage;

vm.toggleSettings = toggleSettings;
vm.toggle = toggle;

vm.showChange = showChange;

// kick it all off
Expand Down Expand Up @@ -80,14 +102,35 @@
});
}

function importForce() {
importItems(true);
}

function importItems(force) {
resetStatus(modes.IMPORT);
vm.importButton.state = 'busy';

uSync8DashboardService.importItems(force, getClientId())
.then(function (result) {
vm.results = result.data;
vm.working = false;
vm.reported = true;
vm.importButton.state = 'success';
}, function (error) {
vm.importButton.state = 'error';
notificationsService.error('Failed', error.data.ExceptionMessage);

vm.working = false;
vm.reported = true;
});
}

function saveSettings() {
vm.working = false;
uSync8DashboardService.saveSettings(vm.settings)
.then(function (result) {
vm.working = false;
notificationsService.success('Saved', 'Settings updated');
});
}

Expand Down Expand Up @@ -124,6 +167,14 @@
return (100 * status.Processed) / status.TotalSteps;
}

function toggle(item) {
item = !item;
}

function toggleSettings() {
vm.settingsView = !vm.settingsView;
}

////// private

function init() {
Expand Down
7 changes: 6 additions & 1 deletion uSync8.BackOffice/App_Plugins/uSync8/uSyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

report: report,
exportItems: exportItems,
importItems: importItems
importItems: importItems,
saveSettings: saveSettings
};

return service;
Expand All @@ -46,6 +47,10 @@
function importItems(force, clientId) {
return $http.put(serviceRoot + 'import', { force: force, clientId: clientId });
}

function saveSettings(settings) {
return $http.post(serviceRoot + 'savesettings', settings);
}
}

angular.module('umbraco.services')
Expand Down
54 changes: 54 additions & 0 deletions uSync8.BackOffice/App_Plugins/uSync8/usync.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,44 @@
font-weight: 700;
}

.usync-detail-count {
padding: 6px 0;
}

.usync-item-details {
border-left: 4px solid #aaa;
}

.usync-item-details .umb-table-head .umb-table-row {
background-color: rgba(0,0,0,0.05);
border-bottom: 1px solid black;
}

.usync-item-details .umb-table {
background-color: #f3f3f5;
}

.usync-item-details .usync-detail-action-cell {
flex: 0 0 110px;
}

.usync-item-details .usync-old-value {
text-decoration: line-through;
color: #C62828;
}

.usync-item-details .usync-new-value {
color: #2e7d32
}

.usync-row-delete {
background-color: #ffebee;
}

.usync-row-create {
background-color: #E8F5E9;
}

.usync-handler-icon {
padding: 0.75em;
margin-right: 14px;
Expand Down Expand Up @@ -68,3 +98,27 @@
.usync-handler-icon.usync-complete {
color: #35c786;
}


.usync-settings {
display: flex;
}

.usync-settings > div {
width: 50%;
}

.usync-settings .usync-main-settings {
margin-right: 14px;
}

.usync-control {
position: relative;
padding: 10px 0;
}

.usync-control input[type="text"] {
position: absolute;
top: 10px;
width: 200px;
}
Loading

0 comments on commit 1abd54b

Please sign in to comment.