Skip to content

Commit 69a63f9

Browse files
committed
fix: TT-223-Consume-end-point-archive-customers
1 parent c937c6c commit 69a63f9

File tree

7 files changed

+20
-21
lines changed

7 files changed

+20
-21
lines changed

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</td>
3131
<td class="col-2 text-center">
3232
<button
33-
class="btn"
33+
class="btn btn-sm"
3434
data-toggle="modal"
3535
data-target="#deleteModal"
3636
[ngClass]="customer.btnColor"

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('CustomerTableListComponent', () => {
215215
expect(component.dtElement.dtInstance.then).toHaveBeenCalled();
216216
});
217217

218-
it('openModal should set on true and display "Are you sure you want to archive activity"', () => {
218+
it('openModal should set on true and display "Are you sure you want to archive customer"', () => {
219219
const message = 'Are you sure you want to archive name?';
220220
const itemData = {
221221
id: '1',

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
} from './../../../../store/customer-management.actions';
1818
import { ResetProjectToEdit, SetProjectToEdit } from '../../../projects/components/store/project.actions';
1919
import { ResetProjectTypeToEdit, SetProjectTypeToEdit } from '../../../projects-type/store';
20-
import { UnArchiveCustomer } from '../../../../store/customer-management.actions';
20+
import { UnarchiveCustomer } from '../../../../store/customer-management.actions';
2121

2222
@Component({
2323
selector: 'app-customer-list',
@@ -181,7 +181,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
181181
this.openModal(item);
182182
} else {
183183
this.showModal = false;
184-
this.store.dispatch(new UnArchiveCustomer(item.id));
184+
this.store.dispatch(new UnarchiveCustomer(item.id));
185185
}
186186
}
187187

src/app/modules/customer-management/store/customer-management.actions.spec.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,21 @@ describe('CustomerManagmentActions', () => {
7878
expect(resetCustomerIdToEdit.type).toEqual(actions.CustomerManagementActionTypes.RESET_CUSTOMER_ID_TO_EDIT);
7979
});
8080

81-
it('UnArchiveCustomer type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER', () => {
82-
const unArchiveCustomer = new actions.UnArchiveCustomer('id_test');
81+
it('UnarchiveCustomer type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER', () => {
82+
const unArchiveCustomer = new actions.UnarchiveCustomer('id_test');
8383
expect(unArchiveCustomer.type).toEqual(actions.CustomerManagementActionTypes.UNARCHIVE_CUSTOMER);
8484
});
8585

86-
it('UnArchiveCustomerSuccess type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_SUCCESS', () => {
87-
const unArchiveCustomerSuccess = new actions.UnArchiveCustomerSuccess({
86+
it('UnarchiveCustomerSuccess type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_SUCCESS', () => {
87+
const unArchiveCustomerSuccess = new actions.UnarchiveCustomerSuccess({
8888
id: 'id_test',
8989
status: 'active',
9090
});
9191
expect(unArchiveCustomerSuccess.type).toEqual(actions.CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_SUCCESS);
9292
});
9393

94-
it('UnArchiveCustomerFail type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_FAIL', () => {
95-
const unArchiveCustomerFail = new actions.UnArchiveCustomerFail('error');
94+
it('UnarchiveCustomerFail type is CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_FAIL', () => {
95+
const unArchiveCustomerFail = new actions.UnarchiveCustomerFail('error');
9696
expect(unArchiveCustomerFail.type).toEqual(actions.CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_FAIL);
9797
});
98-
9998
});

src/app/modules/customer-management/store/customer-management.actions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,19 @@ export class ResetCustomerToEdit implements Action {
100100
public readonly type = CustomerManagementActionTypes.RESET_CUSTOMER_ID_TO_EDIT;
101101
}
102102

103-
export class UnArchiveCustomer implements Action {
103+
export class UnarchiveCustomer implements Action {
104104
public readonly type = CustomerManagementActionTypes.UNARCHIVE_CUSTOMER;
105105

106106
constructor(public payload: string) {}
107107
}
108108

109-
export class UnArchiveCustomerSuccess implements Action {
109+
export class UnarchiveCustomerSuccess implements Action {
110110
public readonly type = CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_SUCCESS;
111111

112112
constructor(public payload: Status) {}
113113
}
114114

115-
export class UnArchiveCustomerFail implements Action {
115+
export class UnarchiveCustomerFail implements Action {
116116
public readonly type = CustomerManagementActionTypes.UNARCHIVE_CUSTOMER_FAIL;
117117

118118
constructor(public error: string) {}
@@ -133,6 +133,6 @@ export type CustomerManagementActions =
133133
| UpdateCustomerFail
134134
| SetCustomerToEdit
135135
| ResetCustomerToEdit
136-
| UnArchiveCustomer
137-
| UnArchiveCustomerSuccess
138-
| UnArchiveCustomerFail;
136+
| UnarchiveCustomer
137+
| UnarchiveCustomerSuccess
138+
| UnarchiveCustomerFail;

src/app/modules/customer-management/store/customer-management.effects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class CustomerEffects {
9292
@Effect()
9393
unarchiveCustomer$: Observable<Action> = this.actions$.pipe(
9494
ofType(actions.CustomerManagementActionTypes.UNARCHIVE_CUSTOMER),
95-
map((action: actions.UnArchiveCustomer) => ({
95+
map((action: actions.UnarchiveCustomer) => ({
9696
id: action.payload,
9797
status: 'active',
9898
})),

src/app/modules/customer-management/store/customer-management.reducers.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('customerManagementReducer', () => {
135135
});
136136

137137
it('on UnarchiveCustomer, isLoading is true', () => {
138-
const action = new actions.UnArchiveCustomer('1');
138+
const action = new actions.UnarchiveCustomer('1');
139139
const state = customerManagementReducer(initialState, action);
140140

141141
expect(state.isLoading).toEqual(true);
@@ -151,7 +151,7 @@ describe('customerManagementReducer', () => {
151151
};
152152
const customerEdited: Status = { id: '1', status: 'active' };
153153
const expectedCustomer = { name: 'aa', description: 'bb', tenant_id: 'cc', id: '1', status: 'active' };
154-
const action = new actions.UnArchiveCustomerSuccess(customerEdited);
154+
const action = new actions.UnarchiveCustomerSuccess(customerEdited);
155155
const state = customerManagementReducer(currentState, action);
156156

157157
expect(state.data).toEqual([expectedCustomer]);
@@ -160,7 +160,7 @@ describe('customerManagementReducer', () => {
160160
});
161161

162162
it('on UnarchiveCustomerFail, message equal to Something went wrong unarchiving customer!', () => {
163-
const action = new actions.UnArchiveCustomerFail('error');
163+
const action = new actions.UnarchiveCustomerFail('error');
164164
const state = customerManagementReducer(initialState, action);
165165

166166
expect(state.message).toEqual('Something went wrong unarchiving customer!');

0 commit comments

Comments
 (0)