@backtest-kit/ui 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <img src="https://github.com/tripolskypetr/backtest-kit/raw/refs/heads/master/assets/decart.svg" height="45px" align="right">
2
+
1
3
  # 📊 @backtest-kit/ui
2
4
 
3
5
  > Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. Combines a Node.js backend server with a React dashboard - all in one package.
package/build/index.cjs CHANGED
@@ -208,7 +208,21 @@ class NotificationMockService {
208
208
  };
209
209
  this.getList = async () => {
210
210
  this.loggerService.log("notificationMockService getList");
211
- return await READ_NOTIFICATION_LIST_FN();
211
+ const notificationList = await READ_NOTIFICATION_LIST_FN();
212
+ notificationList.sort((a, b) => {
213
+ const aHasTime = 'createdAt' in a;
214
+ const bHasTime = 'createdAt' in b;
215
+ if (!aHasTime && bHasTime) {
216
+ return -1;
217
+ }
218
+ if (aHasTime && !bHasTime) {
219
+ return 1;
220
+ }
221
+ const aTime = aHasTime ? a.createdAt : 0;
222
+ const bTime = bHasTime ? b.createdAt : 0;
223
+ return bTime - aTime;
224
+ });
225
+ return notificationList;
212
226
  };
213
227
  this.getOne = async (id) => {
214
228
  this.loggerService.log("notificationMockService getOne");
@@ -325,6 +339,19 @@ class NotificationViewService {
325
339
  for (const notification of await backtestKit.Notification.getData(true)) {
326
340
  notificationList.push(notification);
327
341
  }
342
+ notificationList.sort((a, b) => {
343
+ const aHasTime = 'createdAt' in a;
344
+ const bHasTime = 'createdAt' in b;
345
+ if (!aHasTime && bHasTime) {
346
+ return -1;
347
+ }
348
+ if (aHasTime && !bHasTime) {
349
+ return 1;
350
+ }
351
+ const aTime = aHasTime ? a.createdAt : 0;
352
+ const bTime = bHasTime ? b.createdAt : 0;
353
+ return bTime - aTime;
354
+ });
328
355
  return notificationList;
329
356
  };
330
357
  this.getOne = async (id) => {
package/build/index.mjs CHANGED
@@ -205,7 +205,21 @@ class NotificationMockService {
205
205
  };
206
206
  this.getList = async () => {
207
207
  this.loggerService.log("notificationMockService getList");
208
- return await READ_NOTIFICATION_LIST_FN();
208
+ const notificationList = await READ_NOTIFICATION_LIST_FN();
209
+ notificationList.sort((a, b) => {
210
+ const aHasTime = 'createdAt' in a;
211
+ const bHasTime = 'createdAt' in b;
212
+ if (!aHasTime && bHasTime) {
213
+ return -1;
214
+ }
215
+ if (aHasTime && !bHasTime) {
216
+ return 1;
217
+ }
218
+ const aTime = aHasTime ? a.createdAt : 0;
219
+ const bTime = bHasTime ? b.createdAt : 0;
220
+ return bTime - aTime;
221
+ });
222
+ return notificationList;
209
223
  };
210
224
  this.getOne = async (id) => {
211
225
  this.loggerService.log("notificationMockService getOne");
@@ -322,6 +336,19 @@ class NotificationViewService {
322
336
  for (const notification of await Notification.getData(true)) {
323
337
  notificationList.push(notification);
324
338
  }
339
+ notificationList.sort((a, b) => {
340
+ const aHasTime = 'createdAt' in a;
341
+ const bHasTime = 'createdAt' in b;
342
+ if (!aHasTime && bHasTime) {
343
+ return -1;
344
+ }
345
+ if (aHasTime && !bHasTime) {
346
+ return 1;
347
+ }
348
+ const aTime = aHasTime ? a.createdAt : 0;
349
+ const bTime = bHasTime ? b.createdAt : 0;
350
+ return bTime - aTime;
351
+ });
325
352
  return notificationList;
326
353
  };
327
354
  this.getOne = async (id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/ui",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Full-stack UI framework for visualizing cryptocurrency trading signals, backtests, and real-time market data. React dashboard with candlestick charts, signal tracking, and risk analysis.",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",