Skip to content

Commit

Permalink
Merge branch 'develop' into total_items_on_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit645 authored Mar 5, 2020
2 parents 1957e20 + 7f95658 commit 7020c89
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
5 changes: 5 additions & 0 deletions app/main/posts/modify/post-data-editor.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function PostDataEditorController(
$scope.tagKeys = [];
$scope.save = $translate.instant('app.save');
$scope.saving = $translate.instant('app.saving');
$scope.cancel = cancel;
$scope.submit = $translate.instant('app.submit');
$scope.submitting = $translate.instant('app.submitting');
$scope.hasPermission = $rootScope.hasPermission('Manage Posts');
Expand Down Expand Up @@ -406,4 +407,8 @@ function PostDataEditorController(
});
});
}

function cancel() {
$state.go('posts.data.detail',{postId: $scope.post.id});
}
}
2 changes: 1 addition & 1 deletion app/main/posts/modify/post-data-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<div class="toolbar toolbar-secondary">
<div class="button-group">

<button class="button-flat" ng-click="leavePost()" translate>app.cancel</button>
<button class="button-flat" ng-click="cancel()" translate>app.cancel</button>
<button class="button button-alpha" ng-click="savePost()" ng-if="!isSaving()" translate="">app.save</button>
<loading-dots button-class="'button-alpha'" ng-if="isSaving()" disabled=true label="'app.saving'"></loading-dots>
</div>
Expand Down
14 changes: 9 additions & 5 deletions app/settings/data-export/hdx-export.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ function (
let obj = formAttribute.selectedTag ? {form_attribute_id: formAttribute.id, hxl_tag_id: formAttribute.selectedTag.id} : {form_attribute_id: formAttribute.id};
if (formAttribute.selectedHxlAttributes && !_.isEmpty(formAttribute.selectedHxlAttributes)) {
_.each(formAttribute.selectedHxlAttributes, (hxlAttribute) => {
let objWithAttr = angular.copy(obj);
objWithAttr.hxl_attribute_id = parseInt(getHxlAttributeByTagIdAndName(formAttribute, hxlAttribute.attribute).id);
hxlData.push(objWithAttr);
let hxlAttr = getHxlAttributeByTagIdAndName(formAttribute, hxlAttribute.attribute);
if (hxlAttr) {
let objWithAttr = angular.copy(obj);
objWithAttr.hxl_attribute_id = parseInt(hxlAttr.id);
hxlData.push(objWithAttr);
}
});
} else {
hxlData.push(obj);
Expand All @@ -203,7 +206,8 @@ function (
}

function exportData(sendToHDX) {
if (formatIds().length === 0) {
const formattedIds = formatIds();
if (formattedIds.length === 0) {
// scrolling to top and display the error-message
$scope.fieldError = true;
$anchorScroll();
Expand All @@ -224,7 +228,7 @@ function (
'send_to_hdx': sendToHDX,
'include_hxl': true,
'send_to_browser': !sendToHDX,
'hxl_heading_row': formatIds()
'hxl_heading_row': formattedIds
};

if (sendToHDX) {
Expand Down
10 changes: 5 additions & 5 deletions app/settings/datasources/datasources.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2 class="listing-item-title">
<label class="tgl-btn" for="{{provider.id}}_form_enable"></label>
</div>
<div data-fieldgroup-target="import_to_survey-survey" class="init active">
<p data-fieldgroup-target="hide-author-message" class="init" ng-class="{'active' : formEnabled[provider.id]}" translate-values="{ provider: provider.name }" translate="" >
<p data-fieldgroup-target="hide-author-message" class="init" ng-class="{'active' : formEnabled[provider.id]}" translate-values="{ datasource_type: provider.name }" translate="survey.choose_survey_field_desc" >
<em>
All incoming data from {{provider.name}} will be used to create responses to the survey you choose.
</em>
Expand Down Expand Up @@ -117,7 +117,7 @@ <h2 class="listing-item-title">

<fieldset data-fieldgroup-target="import_to_survey-fields" class="init active" ng-show="selectedForm[provider.id] && formEnabled">
<legend translate="survey.choose_survey_field">Choose what should be assigned to each survey field</legend>
<p translate="survey.choose_survey_field_desc">Each of the survey's fields are listed below. Choose the data from your tweets that you'd like to use to populate each of those fields.</p>
<p translate="survey.choose_survey_field_desc" translate-values="{ datasource_type: provider.name }">Each of the survey's fields are listed below. Choose the data from {{provider.name}} that you'd like to use to populate each of those fields.</p>
<table>
<thead>
<tr>
Expand Down Expand Up @@ -156,14 +156,14 @@ <h2 class="listing-item-title">
<div ng-repeat="(option_key, option) in provider.options track by option_key" ng-class="{ error : formsSubmitted[provider.id] && forms[provider.id][option_key].$invalid, 'form-field' : option.input !== 'radio', 'required' : option.rules.indexOf('required') > -1 }">

<div class="" ng-if="option.input == 'read-only-text'">
<label ng-if="option.label" class="input-label">{{option.label}}</label>
<label ng-if="option.label" ng-bind-html="option.label" class="input-label"></label>
<p ng-bind-html="option.description"></p>
</div>

<div class="form-field" ng-if="option.input == 'text'">
<label ng-if="option.label">
<p ng-if="option.label">
{{option.label}}
</label>
</p>

<p ng-if="option.description">
{{option.description}}
Expand Down

0 comments on commit 7020c89

Please sign in to comment.