Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into 8437_useUnknownInCatchVariables
Browse files Browse the repository at this point in the history
# Conflicts:
#	webapp/src/ts/modules/tasks/tasks.component.ts
#	webapp/src/ts/services/user-contact.service.ts
#	webapp/tests/karma/ts/services/training-cards.service.spec.ts
  • Loading branch information
jkuester committed Jan 6, 2025
2 parents e7e4239 + cfa682f commit edb7876
Show file tree
Hide file tree
Showing 194 changed files with 10,140 additions and 2,567 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ https://docs.communityhealthtoolkit.org/contribute/code/workflow/#commit-message

# Code review checklist
<!-- Remove or comment out any items that do not apply to this PR; in the remaining boxes, replace the [ ] with [x]. -->
- [ ] UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable `can_view_old_navigation` permission to see the old design.
- [ ] Readable: Concise, well named, follows the [style guide](https://docs.communityhealthtoolkit.org/contribute/code/style-guide/), documented if necessary.
- [ ] Documented: Configuration and user documentation on [cht-docs](https://github.com/medic/cht-docs/)
- [ ] Tested: Unit and/or e2e where appropriate
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deploy-conf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ runs:
shell: bash
working-directory: ${{ inputs.directory }}
- name: run cht
run: npx cht --url=https://${{ inputs.username }}:${{ inputs.password }}@${{ inputs.hostname }} compile-app-settings convert-app-forms convert-collect-forms convert-contact-forms upload-app-settings upload-app-forms upload-collect-forms upload-contact-forms upload-resources upload-custom-translations --force
run: npx cht --url=https://${{ inputs.username }}:${{ inputs.password }}@${{ inputs.hostname }} compile-app-settings convert-app-forms convert-collect-forms convert-contact-forms convert-training-forms upload-app-settings upload-app-forms upload-collect-forms upload-contact-forms upload-training-forms upload-resources upload-custom-translations --force
shell: bash
working-directory: ${{ inputs.directory }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Builds brought to you courtesy of GitHub Actions.

## Copyright

Copyright 2013-2022 Medic Mobile, Inc. <[email protected]>
Copyright 2013-2025 Medic Mobile, Inc. <[email protected]>

## License

Expand Down
5 changes: 4 additions & 1 deletion admin/src/js/services/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ const _ = require('lodash/core');
}
ipCookie.remove(COOKIE_NAME, { path: '/' });
userCtxCookieValue = undefined;
// Clear browser history to prevent loading page on browser's back button after logout.
$window.history.pushState(null, null, '/');
$window.location.href = `/${Location.dbName}/login?${params.toString()}`;
};

const logout = function() {
return $http.delete('/_session')
return $http
.delete('/_session')
.catch(function() {
// Set cookie to force login before using app
ipCookie('login', 'force', { path: '/' });
Expand Down
11 changes: 11 additions & 0 deletions admin/tests/unit/services/session.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('Session service', function() {
let ipCookie;
let ipCookieRemove;
let location;
let pushStateStub;
let $httpBackend;
let Location;

Expand All @@ -14,6 +15,7 @@ describe('Session service', function() {
ipCookie = sinon.stub();
ipCookieRemove = sinon.stub();
ipCookie.remove = ipCookieRemove;
pushStateStub = sinon.stub();
Location = {};
location = {};
module(function ($provide) {
Expand All @@ -24,6 +26,7 @@ describe('Session service', function() {
$provide.factory('$window', function() {
return {
angular: { callbacks: [] },
history: { pushState: pushStateStub },
location: location,
};
});
Expand Down Expand Up @@ -59,6 +62,8 @@ describe('Session service', function() {
$httpBackend.flush();
chai.expect(location.href).to.equal(`/DB_NAME/login?redirect=CURRENT_URL&username=${expected.name}`);
chai.expect(ipCookieRemove.args[0][0]).to.equal('userCtx');
chai.expect(pushStateStub.calledOnce).to.be.true;
chai.expect(pushStateStub.args[0]).to.have.members([ null, null, '/' ]);
done();
});

Expand All @@ -73,6 +78,8 @@ describe('Session service', function() {
$httpBackend.flush();
chai.expect(location.href).to.equal('/DB_NAME/login?redirect=CURRENT_URL');
chai.expect(ipCookieRemove.args[0][0]).to.equal('userCtx');
chai.expect(pushStateStub.calledOnce).to.be.true;
chai.expect(pushStateStub.args[0]).to.have.members([ null, null, '/' ]);
done();
});

Expand All @@ -96,6 +103,7 @@ describe('Session service', function() {
service.checkCurrentSession();
$httpBackend.flush();
chai.expect(ipCookieRemove.callCount).to.equal(0);
chai.expect(pushStateStub.notCalled).to.be.true;
done();
});

Expand All @@ -114,6 +122,8 @@ describe('Session service', function() {
$httpBackend.flush();
chai.expect(location.href).to.equal(`/DB_NAME/login?redirect=CURRENT_URL&username=${expected.name}`);
chai.expect(ipCookieRemove.args[0][0]).to.equal('userCtx');
chai.expect(pushStateStub.calledOnce).to.be.true;
chai.expect(pushStateStub.args[0]).to.have.members([ null, null, '/' ]);
done();
});

Expand All @@ -125,6 +135,7 @@ describe('Session service', function() {
service.checkCurrentSession();
$httpBackend.flush();
chai.expect(ipCookieRemove.callCount).to.equal(0);
chai.expect(pushStateStub.notCalled).to.be.true;
done();
});

Expand Down
Loading

0 comments on commit edb7876

Please sign in to comment.