Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include sync status in Hamburg menu #3382

Merged
merged 11 commits into from Apr 19, 2017
Merged

Include sync status in Hamburg menu #3382

merged 11 commits into from Apr 19, 2017

Conversation

alxndrsn
Copy link
Contributor

Closes #3357

@alxndrsn alxndrsn requested review from garethbowen and removed request for garethbowen April 13, 2017 08:42
$scope.replicationStatus.lastCompleted = now;
}
$scope.replicationStatus.current = update.state;
$scope.replicationStatus.icon = 'fa-' + SYNC_ICON[update.status];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it just me or is this adding too many "fa-"? Remove the prefix here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fa-fa-fa-fa-fa-fa-fa-fa-fa-far better

<li role="separator" class="divider" ng-if="!replicationStatus.disabled"></li>
<li role="presentation disabled" ng-show="!replicationStatus.disabled && replicationStatus.current !== 'unknown'">
<a>
Last sync <i class="fa fa-fw fa-refresh"></i><br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internationalisation!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien sûr!

<li role="presentation disabled" ng-if="!replicationStatus.disabled" class="sync-status">
<a ng-class="replicationStatus.current">
<i class="fa fa-fw" ng-class="replicationStatus.icon"></i>
<span>{{'sync.status.' + replicationStatus.current | translate}}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't concatenate keys - it makes it really hard to find if they're in use. Instead make replicationStatus.current have the full key, or have a replicationStatus.key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

<li role="presentation disabled" ng-if="!replicationStatus.disabled" class="sync-status">
<a ng-class="replicationStatus.current">
<i class="fa fa-fw" ng-class="replicationStatus.icon"></i>
<span>{{'sync.status.' + replicationStatus.current | translate}}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <span translate>{{replicationStatus.current}}</span> - it reduces our watch count.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good to know someone's watching the watches.

contact.profile.delivery_code.unknown = Delivery
sync.status.in_progress=Currently syncing…
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need spaces around the = operator, but I could be wrong...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure they're required functionally, but definitely are for consistency. Added.

var delay = last ? (now - last) / 1000 : 'unknown';
$log.info('Replicate ' + status.direction + ' server successful with ' + delay + ' seconds since the previous successful replication.');

var now;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely now must always be Date.now()? I think it's possible it'll be undefined at line 84. Just initialise it here, or inline it everywhere and remove the now var altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not possible it will be undefined at line 84, but I agree it's hard to follow the code. Seems logical to me to keep the value of now the same if assigning it in two different places - someone may think it's logical at a later date to compare the values at lastSuccess and lastCompleted, and my be surprised if they differ.

I'll move the assignment in line with the variable declaration.

@@ -245,6 +245,15 @@ body {
}
}

.sync-status {
.in_progress, .not_required {
color: green;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always try and use existing variables for colours because then they'll be consistent with our palette rather than every commit adding a new colour. Also if we decide to change what colour should represent "ok" then we only need to change it in one place. The current variables are defined in variables.less. Consider using @ok-color.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ok-boss

color: green;
}
.required {
color: red;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above - try @error-color

contact.profile.delivery_code.unknown = Delivery
sync.status.in_progress=Currently syncing…
sync.status.not_required=All reports synced
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "reports" or "docs"? I think docs is more technically correct but makes less sense to users maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I'm not sure if there was specific thinking behind this wording from the design team or not.

I agree that docs is technically more correct, but perhaps reports is more relevant to a user - he'll may be worrying whether the things he has submitted via the Reports tab have been sent to the server. Although... the Reports tab is normally hidden, and he'll generally filling out reports via Contacts or Tasks...

N.B. currently the only use of the word docs in user-facing text is in the About tab's db debug info, and soon to be in the boot screen...

@alxndrsn alxndrsn dismissed garethbowen’s stale review April 19, 2017 10:13

I think it's all resolved

@alxndrsn alxndrsn merged commit 44c393e into master Apr 19, 2017
@alxndrsn alxndrsn deleted the 3357_sync-status branch April 19, 2017 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants