Skip to content

Commit

Permalink
230 - Remove simprints (medic#7461)
Browse files Browse the repository at this point in the history
Ticket: medic/cht-android#230

This commit:
- Removes Simprints integration.
- Removes unused code: getIsAdmin.
  • Loading branch information
latin-panda authored Feb 8, 2022
1 parent 118c775 commit dc0be4f
Show file tree
Hide file tree
Showing 40 changed files with 12 additions and 536 deletions.
1 change: 0 additions & 1 deletion admin/src/js/services/get-summaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ angular.module('inboxServices').factory('GetSummaries',
contact_type: doc.contact_type,
contact: doc.contact && doc.contact._id,
lineage: getLineage(doc.parent),
simprints_id: doc.simprints_id,
date_of_death: doc.date_of_death,
muted: doc.muted
};
Expand Down
3 changes: 0 additions & 3 deletions admin/tests/unit/services/get-summaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ describe('GetSummaries service', () => {
_id: 'g'
}
},
simprints_id: '987',
muted: true
} },
] });
Expand All @@ -207,7 +206,6 @@ describe('GetSummaries service', () => {
contact: 'c',
lineage: [],
date_of_death: 999,
simprints_id: undefined,
muted: undefined
},
{
Expand All @@ -220,7 +218,6 @@ describe('GetSummaries service', () => {
contact: undefined,
lineage: [ 'f', 'g' ],
date_of_death: undefined,
simprints_id: '987',
muted: true
}
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ function(doc) {
if (doc.patient_id) {
emitReference('shortcode', doc.patient_id);
}
if (doc.simprints_id) {
emitReference('simprints', doc.simprints_id);
}
if (doc.rc_code) {
// need String because rewriter wraps everything in quotes
// keep refid case-insenstive since data is usually coming from SMS
Expand Down
3 changes: 0 additions & 3 deletions ddocs/medic/_attachments/translations/messages-en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1188,9 +1188,6 @@ setup.skip = Skip the setup wizard
setup.start = Finish
setup.statistics.description = Allow anonymous statistics to be submitted to Medic? Statistics will be sent monthly to help us improve the software and learn about the impact it's having. Strictly no confidential patient information will be shared with us. You can update these settings at any time from this wizard.
setup.statistics.title = Share impact statistics
simprints.disabled = Simprints isn't available on this device. Use a recent version of the Medic Android app to enable Simprints integration.
simprints.register = Register with Simprints
simprints.search = Search with Simprints
sms_message.message = Incoming message
sms_received = SMS message received; it will be reviewed shortly. If you were trying to submit a text form, please enter a correct form code and try again.
state.cleared = cleared
Expand Down
1 change: 0 additions & 1 deletion ddocs/medic/views/doc_summaries_by_id/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function(doc) {
contact_type: doc.contact_type,
contact: doc.contact && doc.contact._id,
lineage: getLineage(doc.parent),
simprints_id: doc.simprints_id,
date_of_death: doc.date_of_death,
muted: doc.muted
});
Expand Down
18 changes: 0 additions & 18 deletions shared-libs/search/src/generate-search-requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,6 @@ const contactTypeRequest = function(filters, sortByLastVisitedDate) {
return request;
};

const simprintsRequest = function(filters) {
if (!filters.simprintsIdentities) {
return;
}
const keys = filters.simprintsIdentities.map(function(identity) {
return [ 'simprints', identity.id ];
});
return {
view: 'medic-client/contacts_by_reference',
params: { keys: keys }
};
};

const defaultReportRequest = function() {
return {
view: 'medic-client/reports_by_date',
Expand Down Expand Up @@ -206,11 +193,6 @@ const requestBuilders = {
return requests;
},
contacts: function(filters, extensions) {
const simprints = simprintsRequest(filters);
if (simprints) {
return [ simprints ];
}

const shouldSortByLastVisitedDate = module.exports.shouldSortByLastVisitedDate(extensions);

const typeRequest = contactTypeRequest(filters, shouldSortByLastVisitedDate);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/forms/submit-photo-upload-form.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Submit Photo Upload form', () => {
await genericForm.selectFormNative('photo-upload');
await helper.waitElementToPresentNative(photoUpload.imagePathInput());
await photoUpload.imagePathInput().sendKeys(
path.join(__dirname, '../../../webapp/src/img/simprints.png')
path.join(__dirname, '../../../webapp/src/img/setup-wizard-demo.png')
);
await helper.waitUntilReadyNative(photoUpload.imagePreview());

Expand Down
1 change: 0 additions & 1 deletion tests/e2e/service-worker.wdio-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ describe('Service worker cache', () => {
'/img/icon-pregnant.svg',
'/img/layers.png',
'/img/setup-wizard-demo.png',
'/img/simprints.png',
'/login/script.js',
'/login/style.css',
'/main.js',
Expand Down
3 changes: 0 additions & 3 deletions webapp/src/css/enketo/medic.less
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,6 @@
}
}
}
.or .simprints-register img {
display: inherit;
}
.select2-container .select2-selection--single {
height: @input-height;
}
Expand Down
18 changes: 1 addition & 17 deletions webapp/src/css/inbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,7 @@ body {
}

.reset-filter,
.sort-results,
.simprints-filter {
.sort-results {
line-height: 38px;
> a {
color: @text-normal-color;
Expand Down Expand Up @@ -1218,21 +1217,6 @@ a.fa:hover {
}
}

.simprints-stars {
&:after {
font-family: FontAwesome;
}
&.tier-1:after {
content: '\f005\f005\f005\f005\f005'; /* 5 stars full */
}
&.tier-2:after {
content: '\f005\f005\f005\f005\f006'; /* 4 stars full, 1 empty */
}
&.tier-3:after {
content: '\f005\f005\f005\f006\f006'; /* 3 star full, 2 empty */
}
}

.upgrade-config .status {
text-align: center;
}
Expand Down
Binary file removed webapp/src/img/simprints.png
Binary file not shown.
1 change: 0 additions & 1 deletion webapp/src/js/enketo/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
require( './widgets/unselectable-radios' ),
require( './widgets/android-datepicker' ),
require( './widgets/bikram-sambat-datepicker' ),
require( './widgets/simprints' ),
require( './widgets/mrdt' ),
require( './widgets/android-app-launcher' ),
require( './widgets/display-base64-image' ),
Expand Down
78 changes: 0 additions & 78 deletions webapp/src/js/enketo/widgets/simprints.js

This file was deleted.

5 changes: 0 additions & 5 deletions webapp/src/ts/actions/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const Actions = {
setFilter: createSingleValueAction('SET_FILTER', 'filter'),
setFilters: createSingleValueAction('SET_FILTERS', 'filters'),
setSelectMode: createSingleValueAction('SET_SELECT_MODE', 'selectMode'),
setIsAdmin: createSingleValueAction('SET_IS_ADMIN', 'isAdmin'),
setTitle: createSingleValueAction('SET_TITLE', 'title'),
setPrivacyPolicyAccepted: createSingleValueAction('SET_PRIVACY_POLICY_ACCEPTED', 'accepted'),
setShowPrivacyPolicy: createSingleValueAction('SET_SHOW_PRIVACY_POLICY', 'show'),
Expand Down Expand Up @@ -105,10 +104,6 @@ export class GlobalActions {
return this.store.dispatch(Actions.setSelectMode(selectMode));
}

setIsAdmin(isAdmin) {
return this.store.dispatch(Actions.setIsAdmin(isAdmin));
}

setLoadingShowContent(id) {
this.setLoadingContent(id);
this.setShowContent(true);
Expand Down
1 change: 0 additions & 1 deletion webapp/src/ts/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export class AppComponent implements OnInit {
.then(() => this.checkDateService.check(true))
.then(() => this.startRecurringProcesses());

this.globalActions.setIsAdmin(this.sessionService.isAdmin());
this.watchBrandingChanges();
this.watchDDocChanges();
this.watchUserContextChanges();
Expand Down
3 changes: 0 additions & 3 deletions webapp/src/ts/components/components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { FormTypeFilterComponent } from '@mm-components/filters/form-type-filter
import { StatusFilterComponent } from '@mm-components/filters/status-filter/status-filter.component';
import { FreetextFilterComponent } from '@mm-components/filters/freetext-filter/freetext-filter.component';
import { ResetFiltersComponent } from '@mm-components/filters/reset-filters/reset-filters.component';
import { SimprintsFilterComponent} from '@mm-components/filters/simprints-filter/simprints-filter.component';
import { SortFilterComponent } from '@mm-components/filters/sort-filter/sort-filter.component';
import { SenderComponent } from '@mm-components/sender/sender.component';
import { ReportImageComponent } from '@mm-components/report-image/report-image.component';
Expand Down Expand Up @@ -51,7 +50,6 @@ import { MobileDetectionComponent } from '@mm-components/mobile-detection/mobile
StatusFilterComponent,
FreetextFilterComponent,
ResetFiltersComponent,
SimprintsFilterComponent,
SortFilterComponent,
SenderComponent,
ReportImageComponent,
Expand Down Expand Up @@ -84,7 +82,6 @@ import { MobileDetectionComponent } from '@mm-components/mobile-detection/mobile
StatusFilterComponent,
FreetextFilterComponent,
ResetFiltersComponent,
SimprintsFilterComponent,
SortFilterComponent,
SenderComponent,
ReportImageComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ <h4>
</div>
<p *ngIf="dob" [innerHTML]="dob | age:dod"></p>
<span *ngIf="muted && displayMuted">{{'contact.muted' | translate}}</span>
<div *ngIf="simprintsTier" class="simprints-stars tier-{{simprintsTier}}"></div>
<div *ngIf="lineage && lineage.length" class="detail" [innerHTML]="lineage | lineage"></div>
<div *ngIf="warning" class="warning">{{warning}}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export class ContentRowListItemComponent {
@Input() verified;
// array: (optional) the hierarchy for the row
@Input() lineage;
// integer: (optional) the simprints tier of the contact match
@Input() simprintsTier;
// boolean: (optional) whether to mark this row as a primary contact
@Input() primaryContact;
// integer: (optional) how much tasks to show as pending for this contact
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<div class="basic-filters left-pane show-one-filter">
<mm-freetext-filter class="filter" (search)="applyFilters()" [disabled]="disabled"></mm-freetext-filter>
<mm-simprints-filter
[simprintsEnabled]="simprintsEnabled"
(identify)="simprintsIdentify()"
></mm-simprints-filter>
<reset-filters (resetFilters)="resetFilters()" [disabled]="disabled"></reset-filters>
<mm-sort-filter
[lastVisitedDateExtras]="lastVisitedDateExtras"
Expand Down
13 changes: 2 additions & 11 deletions webapp/src/ts/modules/contacts/contacts-filters.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Component, ViewChild, Output, Input, EventEmitter } from '@angular/core';
import { GlobalActions } from '@mm-actions/global';
import { Store } from '@ngrx/store';

import { GlobalActions } from '@mm-actions/global';
import { FreetextFilterComponent } from '@mm-components/filters/freetext-filter/freetext-filter.component';
import { SimprintsFilterComponent } from '@mm-components/filters/simprints-filter/simprints-filter.component';

@Component({
selector: 'contacts-filters',
Expand All @@ -18,28 +18,19 @@ export class ContactsFiltersComponent {
}

@Output() search: EventEmitter<any> = new EventEmitter();
@Output() simIdentify: EventEmitter<any> = new EventEmitter();
@Output() sort: EventEmitter<any> = new EventEmitter();
@Input() reset;
@Input() disabled;
@Input() simprintsEnabled;
@Input() sortDirection;
@Input() lastVisitedDateExtras;

@ViewChild(FreetextFilterComponent)
freetextFilter:FreetextFilterComponent;

@ViewChild(SimprintsFilterComponent)
simprintsFilter:SimprintsFilterComponent;

applyFilters(force?) {
this.search.emit(force);
}

simprintsIdentify() {
this.simIdentify.emit();
}

resetFilters() {
this.globalActions.clearFilters();
this.freetextFilter?.clear();
Expand Down
4 changes: 0 additions & 4 deletions webapp/src/ts/modules/contacts/contacts.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div class="inner">
<contacts-filters
(search)="search()"
(simIdentify)="simprintsIdentify()"
(sort)="sort($event)"
[simprintsEnabled]="simprintsEnabled"
[disabled]="false"
[sortDirection]="sortDirection"
[lastVisitedDateExtras]="lastVisitedDateExtras">
Expand Down Expand Up @@ -49,8 +47,6 @@ <h4>
<span>{{contact.visits.summary}}</span>
</div>
</div>

<div *ngIf="contact.simprintsTier" class="simprints-stars tier-{{contact.simprintsTier}}"></div>
</div>
</a>
</li>
Expand Down
Loading

0 comments on commit dc0be4f

Please sign in to comment.