• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-angular / 13331632524

14 Feb 2025 02:51PM UTC coverage: 22.015% (-69.6%) from 91.622%
13331632524

Pull #15372

github

web-flow
Merge d52d57714 into bcb78ae0a
Pull Request #15372: chore(*): test ci passing

1990 of 15592 branches covered (12.76%)

431 of 964 new or added lines in 18 files covered. (44.71%)

19956 existing lines in 307 files now uncovered.

6452 of 29307 relevant lines covered (22.02%)

249.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/projects/igniteui-angular/src/lib/services/transaction/transaction-factory.service.ts
1
import { Injectable } from '@angular/core';
2
import { IgxBaseTransactionService } from './base-transaction';
3
import { HierarchicalTransactionService } from './hierarchical-transaction';
4
import { IgxHierarchicalTransactionService } from './igx-hierarchical-transaction';
5
import { IgxTransactionService } from './igx-transaction';
6
import { HierarchicalState, HierarchicalTransaction, State, Transaction, TransactionService } from './transaction';
7

8
/**
9
 * The type of the transaction that should be provided.
10
 * When batchEditing is disabled, `None` is provided.
11
 * When enabled - `Base` is provided.
12
 * An enum instead of a boolean value leaves room for extra scenarios in the future.
13
 */
14
export const enum TRANSACTION_TYPE {
15
    'None' = 'None',
16
    'Base' = 'Base'
17
}
18

19
/**
20
 * Factory service for instantiating TransactionServices
21
 */
22
@Injectable({
23
    providedIn: 'root'
24
})
25
export class IgxFlatTransactionFactory {
2✔
26

27
    /**
28
     * Creates a new Transaction service instance depending on the specified type.
29
     *
30
     * @param type The type of the transaction
31
     * @returns a new instance of TransactionService<Transaction, State>
32
     */
33
    public create(type: TRANSACTION_TYPE): TransactionService<Transaction, State> {
34
        switch (type) {
39!
35
            case (TRANSACTION_TYPE.Base):
UNCOV
36
                return new IgxTransactionService();
×
37
            default:
38
                return new IgxBaseTransactionService();
39✔
39
        }
40
    }
41
}
42

43
/**
44
 * Factory service for instantiating HierarchicalTransactionServices
45
 */
46
@Injectable({
47
    providedIn: 'root'
48
})
49
export class IgxHierarchicalTransactionFactory extends IgxFlatTransactionFactory {
2✔
50

51
    /**
52
     * Creates a new HierarchialTransaction service instance depending on the specified type.
53
     *
54
     * @param type The type of the transaction
55
     * @returns a new instance of HierarchialTransaction<HierarchialTransaction, HierarchialState>
56
     */
57
    public override create(type: TRANSACTION_TYPE): HierarchicalTransactionService<HierarchicalTransaction, HierarchicalState> {
UNCOV
58
        switch (type) {
×
59
            case (TRANSACTION_TYPE.Base):
UNCOV
60
                return new IgxHierarchicalTransactionService();
×
61
            default:
UNCOV
62
                return new IgxBaseTransactionService();
×
63
        }
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc