-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding feature flag possibility
* wip: updated license managing * wip: remove featureAccessService & export each function into it * fix: missing dependency in useEffect * fix: eslint yelling for format + some unused eslint directives * fix: eslint errors & warning * chore: remove server part from featire-access file * feat: add nudge compoenent for workflow & testrun * wip: adding nudge on webhook + analytics + user creation * feat: add snooze rule nudge * fix: wrong typo for analytics nudge entry * feat: adding test nudge and connect entitlements to backend * feat: adding github banner for stars & finishing rule snooze feature flag * fix: hide github banner when clicking on the link * chore: update traduction for arabic & french version
- Loading branch information
Showing
71 changed files
with
1,335 additions
and
922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Icon } from 'ui-icons'; | ||
|
||
export const GithubBanner = () => { | ||
const [isShown, setVisibility] = useState( | ||
(localStorage.getItem('show-github-banner') as 'true' | 'false') ?? 'true', | ||
); | ||
|
||
const { t } = useTranslation(['common']); | ||
|
||
return isShown === 'true' ? ( | ||
<div className="text-s text-grey-00 absolute left-0 top-0 flex w-full flex-row justify-between gap-2 bg-purple-100 p-4 font-normal"> | ||
<div className="flex w-full flex-row items-center gap-4"> | ||
<Icon icon="notifications" className="size-6" /> | ||
<span className="inline-flex gap-1 font-semibold"> | ||
<span>{t('common:github_banner')}</span> | ||
<a | ||
href="https://github.com/checkmarble/marble" | ||
className="underline" | ||
target="_blank" | ||
rel="noreferrer" | ||
onClick={() => { | ||
localStorage.setItem('show-github-banner', 'false'); | ||
setVisibility('false'); | ||
}} | ||
> | ||
Github | ||
</a> | ||
</span> | ||
</div> | ||
<Icon | ||
icon="cross" | ||
className="size-6 hover:cursor-pointer" | ||
onClick={() => { | ||
localStorage.setItem('show-github-banner', 'false'); | ||
setVisibility('false'); | ||
}} | ||
/> | ||
</div> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { | ||
Hovercard, | ||
HovercardAnchor, | ||
HovercardProvider, | ||
} from '@ariakit/react/hovercard'; | ||
import clsx from 'clsx'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { CtaClassName } from 'ui-design-system'; | ||
import { Icon } from 'ui-icons'; | ||
|
||
type NudgeProps = { | ||
content: string; | ||
className?: string; | ||
link?: string; | ||
kind?: 'test' | 'restricted'; | ||
}; | ||
|
||
export const Nudge = ({ | ||
content, | ||
link, | ||
className, | ||
kind = 'restricted', | ||
}: NudgeProps) => { | ||
const { t } = useTranslation(['scenarios', 'common']); | ||
|
||
return ( | ||
<HovercardProvider showTimeout={0} hideTimeout={0} placement="right"> | ||
<HovercardAnchor | ||
tabIndex={-1} | ||
className={clsx( | ||
'text-grey-00 flex flex-row items-center justify-center rounded', | ||
{ 'bg-purple-100': kind === 'test' }, | ||
{ 'bg-purple-50': kind === 'restricted' }, | ||
className, | ||
)} | ||
> | ||
<Icon | ||
icon={kind === 'restricted' ? 'lock' : 'unlock-right'} | ||
className="size-3.5" | ||
aria-hidden | ||
/> | ||
</HovercardAnchor> | ||
<Hovercard | ||
portal | ||
gutter={8} | ||
className="bg-grey-00 flex w-60 flex-col items-center gap-6 rounded border border-purple-50 p-4 shadow-lg" | ||
> | ||
<span className="text-m font-bold">{t('common:premium')}</span> | ||
<div className="flex w-full flex-col items-center gap-2"> | ||
<p className="text-s w-full text-center font-medium">{content}</p> | ||
{link ? ( | ||
<a | ||
className="text-s inline-block w-full text-center text-purple-100 hover:underline" | ||
target="_blank" | ||
rel="noreferrer" | ||
href={link} | ||
> | ||
{t('common:check_on_docs')} | ||
</a> | ||
) : null} | ||
</div> | ||
<a | ||
className={CtaClassName({ | ||
variant: 'primary', | ||
color: 'purple', | ||
className: 'mt-4', | ||
})} | ||
href="https://checkmarble.com/upgrade" | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
{t('common:upgrade')} | ||
</a> | ||
</Hovercard> | ||
</HovercardProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.