@campxdev/shared 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/constants/UIConstants.ts +3 -50
package/package.json
CHANGED
|
@@ -1,55 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
|
-
import { campxTenantKey } from '../contexts/Providers'
|
|
3
|
-
|
|
4
|
-
// Configuration for tenant-specific batch suffixes
|
|
5
|
-
const tenantBatchConfig = {
|
|
6
|
-
upes: {
|
|
7
|
-
// Configure suffixes for specific batches
|
|
8
|
-
batchConfigs: {
|
|
9
|
-
'2025 - 2026': ['_JUL', '_OCT'],
|
|
10
|
-
// Add more specific year configurations as needed
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
// Add other tenant configurations here as needed
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const batchOptions = (() => {
|
|
17
|
-
const baseBatches = Array.from({ length: 12 }, (_, i) => {
|
|
18
|
-
return `${new Date().getFullYear() - i} - ${
|
|
19
|
-
new Date().getFullYear() - i + 1
|
|
20
|
-
}`
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
// Check if current tenant has specific batch configuration
|
|
24
|
-
const tenantConfig = tenantBatchConfig[campxTenantKey]
|
|
25
|
-
|
|
26
|
-
if (tenantConfig) {
|
|
27
|
-
const { batchConfigs } = tenantConfig
|
|
28
|
-
const batchesWithSuffixes = []
|
|
29
|
-
|
|
30
|
-
baseBatches.forEach((batch) => {
|
|
31
|
-
// Check if this batch has specific configuration
|
|
32
|
-
const suffixes = batchConfigs[batch]
|
|
33
|
-
|
|
34
|
-
if (suffixes) {
|
|
35
|
-
// Add batch with each suffix
|
|
36
|
-
suffixes.forEach((suffix) => {
|
|
37
|
-
batchesWithSuffixes.push(`${batch}${suffix}`)
|
|
38
|
-
})
|
|
39
|
-
} else {
|
|
40
|
-
// Add batch without suffix
|
|
41
|
-
batchesWithSuffixes.push(batch)
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
console.log(batchesWithSuffixes, 'suffix')
|
|
45
|
-
return batchesWithSuffixes
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
console.log(baseBatches, 'baseBatches')
|
|
49
2
|
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
})
|
|
3
|
+
export const batchOptions = Array.from({ length: 12 }, (_, i) => {
|
|
4
|
+
return `${new Date().getFullYear() - i} - ${new Date().getFullYear() - i + 1}`
|
|
5
|
+
})
|
|
53
6
|
|
|
54
7
|
export const getYears = () => {
|
|
55
8
|
const start = 2019
|