Skip to content

Commit

Permalink
Merge pull request #1222 from ushahidi/master
Browse files Browse the repository at this point in the history
Cycle 7 - pending release that includes changes in ushahidi/platform#3078 (comment)
  • Loading branch information
rowasc authored Aug 9, 2018
2 parents f75deca + 1e0f3e0 commit 3c54425
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ server/www/img/icons/
server/www/
app/locales/
package-lock.json
app/stats.html
4 changes: 2 additions & 2 deletions app/common/auth/authentication-events.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function AuthenticationEvents($rootScope, $location, Authentication, Session, _,

// todo: move to service
$rootScope.hasManageSettingsPermission = function () {
return $rootScope.isAdmin() ? true : (_.intersection(($rootScope.currentUser || {}).permissions, ['Manage Users', 'Manage Settings', 'Bulk Data Import']).length > 0);
return $rootScope.isAdmin() ? true : (_.intersection(($rootScope.currentUser || {}).permissions, ['Manage Users', 'Manage Settings', 'Bulk Data Import and Export', 'Bulk Data Import']).length > 0);
};

// todo: move to service
Expand Down Expand Up @@ -79,7 +79,7 @@ function AuthenticationEvents($rootScope, $location, Authentication, Session, _,
}

function loadExportJob() {
if ($rootScope.hasPermission('Bulk Data Import')) {
if ($rootScope.hasPermission('Bulk Data Import and Export') || $rootScope.hasPermission('Bulk Data Import')) {
DataExport.loadExportJob();
}
}
Expand Down
14 changes: 8 additions & 6 deletions app/common/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
"posts" : "Posts",
"there_are_no_posts" : "There are no posts",
"in_this_deployment" : " in this deployment, yet.",
"reports_total": " {{posts}} of {{total_nb}} reports",
"posts_total": " {{posts}} of {{total_nb}} posts",
"by" : "by",
"task_completed" : "Task completed",
"everyone" : "Everyone",
Expand Down Expand Up @@ -703,7 +703,7 @@
"unlocked" : "Post successfully unlocked",
"unlock" : "Unlock",
"lock_broken_by_other" : "Your Post has been unlocked. Your current unsaved changes will be lost.",
"locked_message" : "The report is locked because <strong>{{ user }}</strong> is working on it right now. Try editing a different post."
"locked_message" : "The post is locked because <strong>{{ user }}</strong> is working on it right now. Try editing a different post."
},
"modify" : {
"intro" : "Select survey:",
Expand Down Expand Up @@ -760,6 +760,7 @@
"reply" : "Reply to Message thread",
"send" : "Send New Message",
"save" : "Save",
"simple_send" : "Send",
"title" : "Conversation with author",
"associated_messages": "View messages associated with this post",
"show_only_incoming": "Show only {{provider}} not assigned to a survey yet ",
Expand Down Expand Up @@ -1004,7 +1005,7 @@
"saving_changes": "Saving",
"unavailable": "The datasource {{value}} is unavailable. <a href=\"/settings/plan\">Upgrade your plan</a> to get it!",
"email": {
"email_desc": "In order to receive reports by email, please input your email account settings below",
"email_desc": "In order to receive posts by email, please input your email account settings below",
"incoming_server_type": "Incoming Server Type",
"incoming_server_type_pop": "POP",
"incoming_server_type_imap": "IMAP",
Expand Down Expand Up @@ -1090,10 +1091,11 @@
"manage_users": "Manage Users",
"manage_posts": "Manage Posts",
"manage_settings": "Mangage Settings",
"bulk_data_import": "Bulk Data Import",
"bulk_data_import": "Bulk Data Import and Export",
"edit_own_posts": "Edit their own posts",
"registred_member": "Registered member",
"administrator": "Administrator"
"administrator": "Administrator",
"roles_description": "These options control what this type of role can make changes to. <a href=\"https://www.ushahidi.com/support/custom-roles#add-a-role\" target=\"_blank\">Visit our support guides to find out more."
},
"deployment_delete_this" : "Delete this deployment",
"deployment_delete" : "Delete deployment",
Expand Down Expand Up @@ -1351,7 +1353,7 @@
"stage_save_success" : "Updated {{stage}}",
"export" : "This will export filtered posts. Are you sure you want to continue?",
"update_status_success_bulk" : "Status updated for {{count}} posts",
"leave_without_save" : "Do you want to leave this report without saving?",
"leave_without_save" : "Do you want to leave this post without saving?",
"leave_confirm_message" : "If you continue, all of your changes will be lost",
"leave_confirm" : "Continue without saving"
},
Expand Down
7 changes: 5 additions & 2 deletions app/common/services/endpoints/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ function (
_
) {

var CollectionEndpoint = $resource(Util.apiUrl('/collections/:collectionId'), {
collectionId: '@collectionId'
// Force ordering by date created
var CollectionEndpoint = $resource(Util.apiUrl('/collections/:collectionId?orderby=:orderby'), {
collectionId: '@collectionId',
orderby: 'created',
order: 'DESC'
}, {
query: {
method: 'GET',
Expand Down
2 changes: 1 addition & 1 deletion app/main/posts/common/post-lock.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>

<div class="message-body">
<p translate-values="{ user: user.realname }" translate="post.locking.locked_message">The report is locked because <strong>Seth Hall</strong> is working on it right now. Try editing a different post.</p>
<p translate-values="{ user: user.realname }" translate="post.locking.locked_message">The post is locked because <strong>Seth Hall</strong> is working on it right now. Try editing a different post.</p>

<div class="button-group" ng-if="isAdmin()">
<button class="button button-alpha" translate="post.locking.unlock" ng-click="unlock()">Unlock</button>
Expand Down
2 changes: 1 addition & 1 deletion app/main/posts/detail/post-messages-reply.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<button type="submit" class="button-alpha modal-trigger"
ng-submit="sendMessage()"
ng-disabled="form.reply.$invalid"
translate>post.messages.save</button>
translate>post.messages.simple_send</button>
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/main/posts/views/post-view-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1 class="mode-context-title"><a href="/" ng-bind="nav.site.name"></a></h1>
<div class="listing timeline init">

<div class="bulk-action" ng-if="posts.length > 0 || !isLoading()">
<div class="bulk-action-primary" translate="post.reports_total" translate-values="{'posts': posts.length, 'total_nb': totalItems }"></div>
<div class="bulk-action-primary" translate="post.posts_total" translate-values="{'posts': posts.length, 'total_nb': totalItems }"></div>
<button id="bulk-action" class="button-link bulk-action-secondary" ng-click="selectBulkActions()" ng-if="$root.loggedin" translate="post.modify.bulk_actions">Bulk Actions</button>
</div>
<post-card
Expand Down
2 changes: 1 addition & 1 deletion app/main/posts/views/share/share-menu.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function ShareMenuController(
$scope.loading = false;
$scope.shareUrl = Util.currentUrl();
$scope.isExportable = isExportable;
$scope.hasPermission = $rootScope.hasPermission('Bulk data import');
$scope.hasPermission = $rootScope.hasPermission('Bulk Data Import and Export') || $rootScope.hasPermission('Bulk Data Import');

activate();

Expand Down
2 changes: 1 addition & 1 deletion app/settings/data-export/data-export.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function (
});

// Redirect to home if not authorized
if ($rootScope.hasPermission('Bulk Data Import') === false) {
if ($rootScope.hasPermission('Bulk Data Import and Export') === false && $rootScope.hasPermission('Bulk Data Import') === false) {
return $location.path('/');
}
// Change layout class
Expand Down
2 changes: 1 addition & 1 deletion app/settings/data-import/data-import.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="mode-context-title" translate>app.import</h1>
<main role="main">

<div class="main-col" importer-csv>
<div class="alert" translate="feature_limits.view_unavailable" translate-values="{value: 'Bulk data import'}" ng-show="!csvEnabled">
<div class="alert" translate="feature_limits.view_unavailable" translate-values="{value: 'Bulk Data Import and Export'}" ng-show="!csvEnabled">
</div>
<form name="upload" ng-show="csvEnabled">
<div class="form-sheet">
Expand Down
1 change: 1 addition & 0 deletions app/settings/roles/roles-edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h1 class="mode-context-title" ng-show="!role.id" translate>app.add_role</h1>

<fieldset>
<legend translate>role.permissions</legend>
<p translate>settings.roles.roles_description</p>

<div class="alert" ng-hide="permissions.length">
<p ng-hide="permissions.length"><em translate>empty.permission</em></p>
Expand Down
4 changes: 2 additions & 2 deletions app/settings/settings-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ <h2 class="listing-item-title"><a ui-sref="settings.datasources" translate>setti
</div>
</div>

<div class="listing-item" ng-show="hasPermission('Bulk Data Import')">
<div class="listing-item" ng-show="hasPermission('Bulk Data Import and Export') || hasPermission('Bulk Data Import')">
<div class="listing-item-primary">
<h2 class="listing-item-title"><a ui-sref="settings.dataImport" translate>settings.settings_list.import</a></h2>
<p class="listing-item-secondary" translate>settings.settings_list.import_desc</p>
</div>
</div>
<div class="listing-item" ng-show="hasPermission('Bulk Data Import')">
<div class="listing-item" ng-show="hasPermission('Bulk Data Import and Export') || hasPermission('Bulk Data Import')">
<div class="listing-item">
<div class="listing-item-primary">
<h2 class="listing-item-title"><a ui-sref="settings.dataExport" translate>settings.settings_list.export</a></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/settings/surveys/survey-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1 ng-show="!survey.id" class="mode-context-title" translate>app.add_survey</h1
<input type="text" placeholder="{{ 'survey.survey_name' | translate }}" ng-model="survey.name">

<label class="hidden" translate>app.description</label>
<textarea placeholder="{{ 'survey.describe_your_survey' | translate }}" ng-model="survey.description">Reports about streets that need resurfacing, repairs, or the removal of a hazard.</textarea>
<textarea placeholder="{{ 'survey.describe_your_survey' | translate }}" ng-model="survey.description">Posts about streets that need resurfacing, repairs, or the removal of a hazard.</textarea>
</div>

<nav class="tabs-menu init" data-tabs="survey-details">
Expand Down

0 comments on commit 3c54425

Please sign in to comment.