Skip to content

Commit 064ce3f

Browse files
Merge branch 'master' into 9255-notifications
2 parents b6f2969 + e80cfc0 commit 064ce3f

File tree

307 files changed

+12017
-26566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+12017
-26566
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Bug report
2+
name: 🐞 Bug report
33
about: Create a report to help us improve
44
title: ''
55
labels: 'Type: Bug'

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
blank_issues_enabled: true
22
contact_links:
3-
- name: Support Request
3+
- name: 📚 Documentation
4+
url: https://docs.communityhealthtoolkit.org/
5+
about: Read the CHT documentation.
6+
- name: 💬 Ask on the forum
47
url: https://forum.communityhealthtoolkit.org/
5-
about: Request support from the community
6-
- name: Security Vulnerability
7-
url: https://docs.communityhealthtoolkit.org/contribute/code/#disclosing-vulnerabilities
8-
about: Report a security vulnerability.
8+
about: The best place for asking for support or general purpose questions.
9+
- name: 👥 Get involved
10+
url: https://docs.communityhealthtoolkit.org/community/
11+
about: Learn how to contribute.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Feature request
2+
name: 💡 Feature request
33
about: Suggest an idea for this project
44
title: ''
55
labels: 'Type: Feature'

.github/ISSUE_TEMPLATE/improvement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Improvement
2+
name: 🤩 Improvement
33
about: Suggest something to make an existing feature better
44
title: ''
55
labels: 'Type: Improvement'

.github/ISSUE_TEMPLATE/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Performance improvement
2+
name: 📈 Performance improvement
33
about: Suggest something to make something faster
44
title: ''
55
labels: 'Type: Performance'

.github/ISSUE_TEMPLATE/support_request.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/technical_issue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Technical issue
2+
name: ⚙️ Technical issue
33
about: Suggest an improvement users won't notice
44
title: ''
55
labels: 'Type: Technical issue'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ user-password-change.txt
5959
user-password-change.csv
6060
/scripts/build/helm/tests/integration-k3d-values.yaml
6161
/tests/e2e/visual/images/*.png
62-
62+
.envrc

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Reporting a Vulnerability
44

5-
Follow [these guidelines](https://docs.communityhealthtoolkit.org/contribute/code/#disclosing-vulnerabilities) to report vulnerabilities.
5+
Follow [these guidelines](https://docs.communityhealthtoolkit.org/community/contributing/disclosing-vulnerabilities/) to report vulnerabilities.

admin/src/js/controllers/display-languages.js

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ angular.module('controllers').controller('DisplayLanguagesCtrl',
2929
if (hasEnabledLanguages(languages)) {
3030
return languages.some(translation => translation.enabled !== false && translation.locale === doc.code);
3131
}
32-
return doc.enabled;
32+
$scope.error = $translate.instant('language.settings.invalid');
33+
return true;
3334
};
3435

3536
const createLocaleModel = function(doc, totalTranslations, languages) {
@@ -51,6 +52,11 @@ angular.module('controllers').controller('DisplayLanguagesCtrl',
5152
};
5253

5354
const updateLanguageSettings = (languages, doc, enabled) => {
55+
if (!languages) {
56+
$log.error('No languages settings found.');
57+
return;
58+
}
59+
5460
let language = languages.find(language => language.locale === doc.code);
5561
if (!language) {
5662
language = { locale: doc.code };
@@ -60,21 +66,12 @@ angular.module('controllers').controller('DisplayLanguagesCtrl',
6066
return UpdateSettings({ languages });
6167
};
6268

63-
const updateLanguageDoc = (doc, enabled) => {
64-
doc.enabled = enabled;
65-
return DB().put(doc);
66-
};
67-
6869
const setLanguageStatus = function(doc, enabled) {
69-
return Settings().then(settings => {
70-
if (hasEnabledLanguages(settings.languages)) {
71-
return updateLanguageSettings(settings.languages, doc, enabled);
72-
}
73-
74-
return updateLanguageDoc(doc, enabled);
75-
}).catch(err => {
76-
$log.error('Error updating translation doc', err);
77-
});
70+
return Settings()
71+
.then(settings => updateLanguageSettings(settings.languages, doc, enabled))
72+
.catch(err => {
73+
$log.error('Error updating translation doc', err);
74+
});
7875
};
7976

8077
const getTranslationKeys = doc => {
@@ -89,14 +86,14 @@ angular.module('controllers').controller('DisplayLanguagesCtrl',
8986

9087
const getLanguages = function() {
9188
$scope.loading = true;
92-
$q.all([
93-
DB().query('medic-client/doc_by_type', {
94-
startkey: [ 'translations', false ],
95-
endkey: [ 'translations', true ],
96-
include_docs: true
97-
}),
98-
Settings()
99-
])
89+
$q
90+
.all([
91+
DB().query('medic-client/doc_by_type', {
92+
key: [ 'translations' ],
93+
include_docs: true
94+
}),
95+
Settings()
96+
])
10097
.then(([translations, settings]) => {
10198
const totalTranslations = countTotalTranslations(translations.rows);
10299
$scope.loading = false;
@@ -138,6 +135,7 @@ angular.module('controllers').controller('DisplayLanguagesCtrl',
138135
$scope.enableLanguage = function(doc) {
139136
return setLanguageStatus(doc, true);
140137
};
138+
141139
$scope.prepareImport = function(doc) {
142140
Modal({
143141
templateUrl: 'templates/import_translation.html',

0 commit comments

Comments
 (0)