Skip to content

Commit

Permalink
Cp - Add minimum characters to TCJ test centre search (#1077)
Browse files Browse the repository at this point in the history
* Add 2 char limit to TC search

* Add clear test centres on logout

* Bump version
  • Loading branch information
matthew2564 authored Mar 13, 2023
1 parent 00c9a53 commit 0021279
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 26 deletions.
34 changes: 12 additions & 22 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,13 @@
"with": "src/environments/environment.dev.dev-tools.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": {
"hidden": true,
"scripts": true,
"styles": true
},
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"aot": false,
"vendorChunk": true,
"buildOptimizer": true
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": false,
"optimization": false,
"namedChunks": false
},
"livereload": {
"fileReplacements": [
Expand All @@ -154,18 +149,13 @@
"with": "src/environments/environment.livereload.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": {
"hidden": true,
"scripts": true,
"styles": true
},
"namedChunks": true,
"aot": true,
"extractLicenses": true,
"aot": false,
"vendorChunk": true,
"buildOptimizer": true
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": false,
"optimization": false,
"namedChunks": false
},
"testing": {
"fileReplacements": [
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="uk.gov.dvsa.drivingexaminerservices" version="4.7.2.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="uk.gov.dvsa.drivingexaminerservices" version="4.7.2.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>DES</name>
<description>An application for DVSA driving examiners to conduct driving tests digitally</description>
<content src="index.html" />
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.7.2.6</string>
<string>4.7.2.7</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4.7.2.6</string>
<string>4.7.2.7</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[displayKey]="'centreName'"
[fuzzySearchKeys]="['centreName', 'costCode', 'centreId']"
[idPrefix]="'tcj-candidate-search-tab'"
[minCharactersBeforeListDisplay]="2"
[placeholder]="'Select a test centre'"
(outputChanged)="onTestCentreDidChange($event)">
</searchable-picklist-wrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[displayKey]="'centreName'"
[fuzzySearchKeys]="['centreName', 'costCode', 'centreId']"
[idPrefix]="'tcj-view-journal-tab'"
[minCharactersBeforeListDisplay]="2"
[placeholder]="'Select a test centre'"
(outputChanged)="onTestCentreDidChange($event)">
</searchable-picklist-wrapper>
Expand Down
4 changes: 4 additions & 0 deletions src/app/providers/authentication/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { UnloadJournal } from '@store/journal/journal.actions';
import { LogHelper } from '@providers/logs/logs-helper';
import { SaveLog } from '@store/logs/logs.actions';
import { LogType } from '@shared/models/log.model';
import { ClearTestCentresRefData } from '@store/reference-data/reference-data.actions';
import { AppConfigProvider } from '../app-config/app-config';
import { ConnectionStatus, NetworkStateProvider } from '../network-state/network-state';
import { TestPersistenceProvider } from '../test-persistence/test-persistence';
Expand Down Expand Up @@ -218,8 +219,11 @@ export class AuthenticationProvider {
await this.testPersistenceProvider.clearPersistedTests();
await this.completedTestPersistenceProvider.clearPersistedCompletedTests();
}

this.store$.dispatch(UnloadJournal());
this.store$.dispatch(UnloadTests());
this.store$.dispatch(ClearTestCentresRefData());

await this.clearTokens();
this.appConfig.shutDownStoreSubscription();
this.subscription?.unsubscribe();
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.dev.dev-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const minute = 1000 * 60;

export const environment: EnvironmentFile = {
...devEnvironment,
sentry: { ...devEnvironment.sentry, dsn: null }, // Comment this line out to report errors to Sentry in dev-tools mode
enableDevTools: true,
enableRehydrationPlugin: true,
logsAutoSendInterval: minute * 3,
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.livereload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const minute = 1000 * 60;

export const environment: EnvironmentFile = {
...devEnvironment,
sentry: { ...devEnvironment.sentry, dsn: null }, // Comment this line out to report errors to Sentry in livereload
enableDevTools: true,
logsAutoSendInterval: minute * 3,
};
4 changes: 4 additions & 0 deletions src/store/reference-data/reference-data.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export const GetTestCentresRefData = createAction(
'[ReferenceDataEffects] Get test centres',
);

export const ClearTestCentresRefData = createAction(
'[ReferenceDataEffects] Clear test centres',
);

export const LoadTestCentresRefDataSuccess = createAction(
'[ReferenceDataEffects] Load test centres success',
(testCentres: RefDataTestCentreResponse) => ({ testCentres }),
Expand Down
7 changes: 6 additions & 1 deletion src/store/reference-data/reference-data.reducer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { createReducer, createFeatureSelector, on } from '@ngrx/store';
import { RefDataTestCentreResponse } from '@providers/reference-data/reference-data';
import {
LoadTestCentresRefDataSuccess, SetDateRefDataUpdated,
ClearTestCentresRefData,
LoadTestCentresRefDataSuccess,
SetDateRefDataUpdated,
} from './reference-data.actions';

export type RefDataStateModel = {
Expand All @@ -26,6 +28,9 @@ export const referenceDataReducer = createReducer(
...state,
testCentres,
})),
on(ClearTestCentresRefData, () => ({
...initialState,
})),
);

export const getRefDataState = createFeatureSelector<RefDataStateModel>(refDataFeatureKey);

0 comments on commit 0021279

Please sign in to comment.