Skip to content

Commit af60c54

Browse files
Merge pull request #643 from AlphadayHQ/dev
v3.5.6 - Kasandra History Feature Flag + Safari Bug Fix
2 parents 1f13424 + ea96a4a commit af60c54

File tree

7 files changed

+43
-14
lines changed

7 files changed

+43
-14
lines changed

packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@alphaday/frontend",
33
"private": true,
4-
"version": "3.5.5",
4+
"version": "3.5.6",
55
"type": "module",
66
"scripts": {
77
"prepare": "export VITE_COMMIT=$(git rev-parse --short HEAD)",

packages/frontend/src/api/services/kasandra/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type TGetInsightsRequest = {
6969
coin: string;
7070
interval: TChartRange;
7171
limit?: number;
72+
type?: "prediction" | "history";
7273
};
7374
export type TGetInsightsRawResponse = TPagination & {
7475
results: TRemoteInsight[];

packages/frontend/src/components/kasandra/KasandraItem.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ const KasandraItem: FC<{
218218
className={twMerge(
219219
"desc fontGroup-normal pointer-events-none h-2.5 opacity-0 ease-[ease] transition-all duration-300",
220220
openAccordion &&
221-
"line-clamp-6 pointer-events-auto overflow-hidden text-ellipsis opacity-100 ease-[ease] transition-all duration-300"
221+
"line-clamp-6 pointer-events-auto overflow-hidden text-ellipsis opacity-100 ease-[ease] transition-all duration-300 mb-2"
222222
)}
223223
style={{
224224
height: openAccordion
@@ -227,11 +227,14 @@ const KasandraItem: FC<{
227227
}}
228228
>
229229
{openAccordion && (
230-
<div className="info ml-5 px-2 pr-3 pt-2 rounded-sm min-h-[45px] [align-self:normal]">
231-
<div className="wrap flex flex-wrap text-primary whitespace-pre-wrap [&>p]:mb-2 [&>p]:w-full [&>p]:inline">
230+
<div className="info ml-5 px-2 pr-3 rounded-sm min-h-full [align-self:normal]">
231+
<div
232+
className={twMerge(
233+
"wrap min-h-full inline text-primary whitespace-pre-wrap [&>p]:mt-2 [&>p]:w-full [&>p]:inline-block" // mb-2 does not work for some reason
234+
)}
235+
>
232236
<ReactMarkdown>{item.rationale}</ReactMarkdown>
233237
</div>
234-
<br />
235238
{/* {itemSources && (
236239
<>
237240
<div className="flex flex-wrap gap-1">

packages/frontend/src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export enum EFeaturesRegistry {
3333
WalletBoard = "wallet_board",
3434
Notifications = "notification",
3535
MobileApp = "mobile_app",
36+
KasandraHistory = "kasandra_history",
3637
TranslationFr = "translation_fr",
3738
TranslationEs = "translation_es",
3839
TranslationTr = "translation_tr",

packages/frontend/src/containers/kasandra/KasandraContainer.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { FC, useEffect, useMemo, useCallback, Suspense } from "react";
2-
import { useGlobalSearch, useWidgetHeight } from "src/api/hooks";
2+
import {
3+
useFeatureFlags,
4+
useGlobalSearch,
5+
useWidgetHeight,
6+
} from "src/api/hooks";
37
import { useCustomAnalytics } from "src/api/hooks/useCustomAnalytics";
48
import {
59
useGetKasandraCoinsQuery,
@@ -17,7 +21,7 @@ import KasandraModule from "src/components/kasandra/KasandraModule";
1721
import { TMarketMeta } from "src/components/kasandra/types";
1822
import { ModuleLoader } from "src/components/moduleLoader/ModuleLoader";
1923
import CONFIG from "src/config";
20-
import { EWidgetSettingsRegistry } from "src/constants";
24+
import { EFeaturesRegistry, EWidgetSettingsRegistry } from "src/constants";
2125
import { IModuleContainer } from "src/types";
2226
import BaseContainer from "../base/BaseContainer";
2327

@@ -28,6 +32,10 @@ const KasandraContainer: FC<IModuleContainer> = ({ moduleData }) => {
2832
);
2933
const WIDGET_HEIGHT = useWidgetHeight(moduleData);
3034

35+
const { enabled: isKasandraHistoryAllowed } = useFeatureFlags(
36+
EFeaturesRegistry.KasandraHistory
37+
);
38+
3139
const isAuthenticated = useAppSelector(selectIsAuthenticated);
3240
const { logButtonClicked } = useCustomAnalytics();
3341

@@ -124,6 +132,7 @@ const KasandraContainer: FC<IModuleContainer> = ({ moduleData }) => {
124132
const { data: insights } = useGetInsightsQuery({
125133
coin: selectedMarket?.slug,
126134
interval: selectedChartRange,
135+
type: isKasandraHistoryAllowed ? undefined : "prediction",
127136
limit: 30,
128137
});
129138

packages/frontend/src/containers/kasandra/KasandraTimelineContainer.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FC, useEffect, useCallback, useMemo } from "react";
2-
import { useView, useWidgetHeight } from "src/api/hooks";
2+
import { useFeatureFlags, useView, useWidgetHeight } from "src/api/hooks";
33
import { useCustomAnalytics } from "src/api/hooks/useCustomAnalytics";
44
import {
55
useGetKasandraCoinsQuery,
@@ -15,14 +15,18 @@ import { Logger } from "src/api/utils/logging";
1515
import KasandraTimelineModule from "src/components/kasandra/KasandraTimelineModule";
1616
import { TMarketMeta } from "src/components/market/types";
1717
import CONFIG from "src/config";
18-
import { ETemplateNameRegistry } from "src/constants";
18+
import { EFeaturesRegistry, ETemplateNameRegistry } from "src/constants";
1919
import { IModuleContainer } from "src/types";
2020

2121
const KasandraTimelineContainer: FC<IModuleContainer> = ({ moduleData }) => {
2222
const dispatch = useAppDispatch();
2323
const isAuthenticated = useAppSelector(userStore.selectIsAuthenticated);
2424
const { logButtonClicked } = useCustomAnalytics();
2525

26+
const { enabled: isKasandraHistoryAllowed } = useFeatureFlags(
27+
EFeaturesRegistry.KasandraHistory
28+
);
29+
2630
const { selectedView } = useView();
2731

2832
const KasandraWidgetTemplateSlug = `${ETemplateNameRegistry.Kasandra.toLowerCase()}_template`;
@@ -129,6 +133,7 @@ const KasandraTimelineContainer: FC<IModuleContainer> = ({ moduleData }) => {
129133
coin: selectedMarket?.slug,
130134
interval: selectedChartRange,
131135
limit: 30,
136+
type: isKasandraHistoryAllowed ? undefined : "prediction",
132137
});
133138

134139
const logData = useMemo(() => {

yarn.lock

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14479,12 +14479,13 @@ [email protected]:
1447914479
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
1448014480

1448114481
sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8, sha.js@~2.4.4:
14482-
version "2.4.11"
14483-
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7"
14484-
integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==
14482+
version "2.4.12"
14483+
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f"
14484+
integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==
1448514485
dependencies:
14486-
inherits "^2.0.1"
14487-
safe-buffer "^5.0.1"
14486+
inherits "^2.0.4"
14487+
safe-buffer "^5.2.1"
14488+
to-buffer "^1.2.0"
1448814489

1448914490
1449014491
version "1.1.0"
@@ -15699,6 +15700,15 @@ tmp@~0.2.1:
1569915700
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
1570015701
integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==
1570115702

15703+
to-buffer@^1.2.0:
15704+
version "1.2.1"
15705+
resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.2.1.tgz#2ce650cdb262e9112a18e65dc29dcb513c8155e0"
15706+
integrity sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ==
15707+
dependencies:
15708+
isarray "^2.0.5"
15709+
safe-buffer "^5.2.1"
15710+
typed-array-buffer "^1.0.3"
15711+
1570215712
to-data-view@^1.1.0:
1570315713
version "1.1.0"
1570415714
resolved "https://registry.yarnpkg.com/to-data-view/-/to-data-view-1.1.0.tgz#08d6492b0b8deb9b29bdf1f61c23eadfa8994d00"

0 commit comments

Comments
 (0)