Skip to content

Commit

Permalink
Fixing minor bugs in dashboard and billing
Browse files Browse the repository at this point in the history
  • Loading branch information
vmatsiiako committed Apr 17, 2023
1 parent 56c3529 commit 44c716a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 6 additions & 4 deletions frontend/src/pages/dashboard/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ export default function Dashboard() {
setWorkspaceEnvs(accessibleEnvironments || []);

// set env
const env = accessibleEnvironments?.[0] || {
console.log(1, accessibleEnvironments, envInURL)
const env = accessibleEnvironments?.find((ae: WorkspaceEnv) => ae.slug === envInURL) || {
name: 'unknown',
slug: 'unknown'
};
console.log(1, env)
setSelectedEnv(env);
setSelectedSnapshotEnv(env);

Expand Down Expand Up @@ -279,7 +281,7 @@ export default function Dashboard() {
setData(undefined);
}
})();
}, [workspaceId]);
}, [workspaceId, envInURL]);

useEffect(() => {
(async () => {
Expand All @@ -290,7 +292,7 @@ export default function Dashboard() {
let dataToSort;
if (selectedEnv) {
dataToSort = await getSecretsForProject({
env: selectedEnv.slug,
env: String(envInURL),
setIsKeyAvailable,
setData,
workspaceId
Expand Down Expand Up @@ -1018,7 +1020,7 @@ export default function Dashboard() {
<div className="flex items-center justify-center h-full my-48">
<Image
src="/images/loading/loading.gif"
height={600}
height={60}
width={100}
alt="infisical loading indicator"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const DashboardInput = ({ isOverridden, isSecretValueHidden, isReadOnly, secret,
ref.current.scrollLeft = e.currentTarget.scrollLeft;
};

return <td key={`row-${secret?.key || ''}--`} className={`flex flex-row w-full min-w-[11rem] justify-center h-10 items-center ${!(secret?.value || secret?.value === '') ? "bg-red-400/10" : "bg-mineshaft-900/30"}`}>
<div className="group relative whitespace-pre flex flex-col justify-center w-full">
return <td key={`row-${secret?.key || ''}--`} className={`flex cursor-default flex-row w-full min-w-[11rem] justify-center h-10 items-center ${!(secret?.value || secret?.value === '') ? "bg-red-400/10" : "bg-mineshaft-900/30"}`}>
<div className="group relative whitespace-pre flex flex-col justify-center w-full cursor-default">
<input
// {...register(`secrets.${index}.valueOverride`)}
defaultValue={(isOverridden ? secret.valueOverride : secret?.value || '')}
Expand All @@ -39,7 +39,7 @@ const DashboardInput = ({ isOverridden, isSecretValueHidden, isReadOnly, secret,
isSecretValueHidden
? 'text-transparent focus:text-transparent active:text-transparent'
: ''
} z-10 peer font-mono ph-no-capture bg-transparent caret-transparent text-transparent text-sm px-2 py-2 w-full outline-none duration-200 no-scrollbar no-scrollbar::-webkit-scrollbar`}
} z-10 peer cursor-default font-mono ph-no-capture bg-transparent caret-transparent text-transparent text-sm px-2 py-2 w-full outline-none duration-200 no-scrollbar no-scrollbar::-webkit-scrollbar`}
spellCheck="false"
/>
<div
Expand All @@ -49,7 +49,7 @@ const DashboardInput = ({ isOverridden, isSecretValueHidden, isReadOnly, secret,
? 'text-bunker-800 group-hover:text-gray-400 peer-focus:text-gray-100 peer-active:text-gray-400 duration-200'
: ''
} ${!secret?.value && "text-bunker-400 justify-center"}
absolute flex flex-row whitespace-pre font-mono z-0 ${isSecretValueHidden && secret?.value ? 'invisible' : 'visible'} peer-focus:visible mt-0.5 ph-no-capture overflow-x-scroll bg-transparent h-10 text-sm px-2 py-2 w-full min-w-16 outline-none duration-100 no-scrollbar no-scrollbar::-webkit-scrollbar`}
absolute cursor-default flex flex-row whitespace-pre font-mono z-0 ${isSecretValueHidden && secret?.value ? 'invisible' : 'visible'} peer-focus:visible mt-0.5 ph-no-capture overflow-x-scroll bg-transparent h-10 text-sm px-2 py-2 w-full min-w-16 outline-none duration-100 no-scrollbar no-scrollbar::-webkit-scrollbar`}
>
{(secret?.value || secret?.value === '') && (isOverridden ? secret.valueOverride : secret?.value)?.split('').length === 0 && <span className='text-bunker-400/80 font-sans w-full'>EMPTY</span>}
{(secret?.value || secret?.value === '') && (isOverridden ? secret.valueOverride : secret?.value)?.split(REGEX).map((word: string) => {
Expand Down Expand Up @@ -78,7 +78,7 @@ const DashboardInput = ({ isOverridden, isSecretValueHidden, isReadOnly, secret,
</span>
);
})}
{!(secret?.value || secret?.value === '') && <span className='text-red-500/80 font-sans text-xs italic'>missing</span>}
{!(secret?.value || secret?.value === '') && <span className='text-red-500/80 cursor-default font-sans text-xs italic'>missing</span>}
</div>
{(isSecretValueHidden && secret?.value) && (
<div className='absolute flex flex-row justify-between items-center z-0 peer pr-2 peer-active:hidden peer-focus:hidden group-hover:bg-white/[0.00] duration-100 h-10 w-full text-bunker-400 text-clip'>
Expand Down Expand Up @@ -118,7 +118,7 @@ export const EnvComparisonRow = ({
<tr className="group min-w-full flex flex-row items-center hover:bg-bunker-700">
<td className="w-10 h-10 px-4 flex items-center justify-center border-none"><div className='text-center w-10 text-xs text-bunker-400'>{index + 1}</div></td>
<td className="flex flex-row justify-between items-center h-full min-w-[200px] lg:min-w-[220px] xl:min-w-[250px]">
<div className="flex flex-row items-center h-8">{secret?.key || ''}</div>
<div className="flex flex-row items-center h-8 cursor-default">{secret?.key || ''}</div>
<button type="button" className='mr-2 text-bunker-400 hover:text-bunker-300 invisible group-hover:visible' onClick={() => setAreValuesHiddenThisRow(!areValuesHiddenThisRow)}>
<FontAwesomeIcon icon={areValuesHiddenThisRow ? faEye : faEyeSlash} />
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export const OrgSettingsPage = () => {
(orgUsers || []).length >= 5 &&
subscriptionPlan === plans.starter &&
host === 'https://app.infisical.com' &&
currentWorkspace?._id !== '63ea8121b6e2b0543ba79616';
currentWorkspace?._id !== '63ea8121b6e2b0543ba79616' &&
currentWorkspace?._id !== '634870246fd2e26f28e76996' &&
currentWorkspace?._id !== '63d823cef9e728a0a961255a' &&
currentWorkspace?._id !== '6412ec319db25595ac00b8c6';

const onRenameOrg = async (name: string) => {
if (!currentOrg?._id) return;
Expand Down

0 comments on commit 44c716a

Please sign in to comment.