@everymatrix/casino-tournaments-page-controller 0.0.342 → 0.0.345
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/casino-tournaments-page-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.345",
|
|
4
4
|
"main": "dist/casino-tournaments-page-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "63e86c33c4f941198addad3864a924170d27f073"
|
|
40
40
|
}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
export let currency: string = 'EUR';
|
|
30
30
|
export let tablelimit: string = '30';
|
|
31
31
|
export let namemask: string = '';
|
|
32
|
+
export let showunqualifiedplayer: string = 'true'
|
|
32
33
|
export let mobiletablelimit:string = '15';
|
|
33
34
|
export let updatetableintime:string = 'true';
|
|
34
35
|
export let viewmode:string = '';
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
// data for current user
|
|
78
79
|
const transFormCurrentUserData = (item:any) => {
|
|
79
80
|
let userData = {
|
|
80
|
-
Rank: item.rank,
|
|
81
|
+
Rank: showunqualifiedplayer == "false" ? item.rankWithoutUnqualified : item.rank,
|
|
81
82
|
Player: item.shortName,
|
|
82
83
|
Points: item.score,
|
|
83
84
|
Prize: item.prizeName,
|
|
@@ -88,21 +89,21 @@
|
|
|
88
89
|
return userData;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
const transFormCurrentUserDataAtFistRow = (item: any) => ({
|
|
93
|
+
...transFormCurrentUserData(item),
|
|
94
|
+
...(item.unqualified === true ? { Rank: item.rank } : {})
|
|
95
|
+
})
|
|
96
|
+
|
|
91
97
|
// @TODO data type
|
|
92
98
|
const transformTableData = (data:any) => {
|
|
99
|
+
|
|
100
|
+
currentUserInPage = false
|
|
101
|
+
|
|
93
102
|
let tableData:any = [];
|
|
94
103
|
|
|
95
104
|
if (data && data.length > 0) {
|
|
96
105
|
data.forEach((item:any) => {
|
|
97
|
-
let transformedItem =
|
|
98
|
-
Rank: item.rank,
|
|
99
|
-
Player: item.shortName,
|
|
100
|
-
Points: item.score,
|
|
101
|
-
Prize: item.prizeName,
|
|
102
|
-
Unqualified: item.unqualified,
|
|
103
|
-
BetCount: item.betCount,
|
|
104
|
-
userID: item.userID
|
|
105
|
-
}
|
|
106
|
+
let transformedItem = transFormCurrentUserData(item)
|
|
106
107
|
if(item.userID == playerID){
|
|
107
108
|
currentUserData = transformedItem;
|
|
108
109
|
currentUserInPage = true;
|
|
@@ -155,9 +156,9 @@
|
|
|
155
156
|
currentUserInPage = newTableData.filter((item)=>{
|
|
156
157
|
return item.userID = playerID;
|
|
157
158
|
}).length > 0;
|
|
158
|
-
if(updateTableData.item
|
|
159
|
+
if(updateTableData.item){
|
|
159
160
|
firstRowAvailable = true;
|
|
160
|
-
firstRowData =
|
|
161
|
+
firstRowData = transFormCurrentUserDataAtFistRow(updateTableData.item);
|
|
161
162
|
if(firstRowData){
|
|
162
163
|
window.postMessage({ type: 'CasinoTableFirstRowData', tableData: firstRowData }, window.location.href);
|
|
163
164
|
}
|
|
@@ -182,7 +183,7 @@
|
|
|
182
183
|
}
|
|
183
184
|
},
|
|
184
185
|
startupTableDataChangeListener = (tournamentID: String, searchParams: any) => {
|
|
185
|
-
let endpointURL: String = `${endpoint}/tournaments/${tournamentID}/leaderboard/updates?HeartBeat=false&XSessionId=${session}`;
|
|
186
|
+
let endpointURL: String = `${endpoint}/tournaments/${tournamentID}/leaderboard/updates?HeartBeat=false&XSessionId=${session}&${searchParams.toString()}`;
|
|
186
187
|
if(tableUpdateEventSource){
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
@@ -251,6 +252,8 @@
|
|
|
251
252
|
url.searchParams.append('filter', `shortNameMask=${namemask}`);
|
|
252
253
|
}
|
|
253
254
|
|
|
255
|
+
url.searchParams.append('filter', `includeUnqualifiedPlayer=${showunqualifiedplayer}`);
|
|
256
|
+
|
|
254
257
|
if (session) {
|
|
255
258
|
let limit = isMobile(userAgent) == true? mobiletablelimit : tablelimit;
|
|
256
259
|
url.searchParams.append('pagination', `offset=0,limit=${limit}`);
|
|
@@ -270,7 +273,7 @@
|
|
|
270
273
|
tournamentTableData = transformTableData(res.items);
|
|
271
274
|
if(res.item && !currentUserInPage){
|
|
272
275
|
firstRowAvailable = true;
|
|
273
|
-
firstRowData =
|
|
276
|
+
firstRowData = transFormCurrentUserDataAtFistRow(res.item);
|
|
274
277
|
}
|
|
275
278
|
showTable = true;
|
|
276
279
|
latestRank = currentUserInPage ? currentUserData.Rank : firstRowData.Rank
|