mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 01:27:41 +00:00
feat: remove accessType hardcap in migration + style
This commit is contained in:
@@ -8,7 +8,7 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
const hasColumn = await knex.schema.hasColumn(TableName.SecretSharing, "accessType");
|
const hasColumn = await knex.schema.hasColumn(TableName.SecretSharing, "accessType");
|
||||||
if (!hasColumn) {
|
if (!hasColumn) {
|
||||||
await knex.schema.table(TableName.SecretSharing, (table) => {
|
await knex.schema.table(TableName.SecretSharing, (table) => {
|
||||||
table.string("accessType", 20).notNullable().defaultTo(SecretSharingAccessType.Anyone);
|
table.string("accessType").notNullable().defaultTo(SecretSharingAccessType.Anyone);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export const secretSharingServiceFactory = ({
|
|||||||
}
|
}
|
||||||
await secretSharingDAL.updateById(sharedSecretId, { $decr: { expiresAfterViews: 1 } });
|
await secretSharingDAL.updateById(sharedSecretId, { $decr: { expiresAfterViews: 1 } });
|
||||||
}
|
}
|
||||||
if (sharedSecret.accessType === SecretSharingAccessType.Organization) {
|
if (sharedSecret.accessType === SecretSharingAccessType.Organization && orgId === sharedSecret.orgId) {
|
||||||
return { ...sharedSecret, orgName };
|
return { ...sharedSecret, orgName };
|
||||||
}
|
}
|
||||||
return { ...sharedSecret, orgName: undefined };
|
return { ...sharedSecret, orgName: undefined };
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ export const SecretTable = ({
|
|||||||
orgName
|
orgName
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const [isVisible, setIsVisible] = useToggle(false);
|
const [isVisible, setIsVisible] = useToggle(false);
|
||||||
const title = (<p>Someone from <strong>{orgName}</strong> organization has shared a secret with you</p>);
|
const title = orgName
|
||||||
|
? (<p>Someone from <strong>{orgName}</strong> organization has shared a secret with you</p>)
|
||||||
|
: (<p>You need to be logged in to view this secret</p>);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex w-full items-center justify-center rounded-md border border-solid border-mineshaft-700 bg-mineshaft-800 p-2">
|
<div className="flex w-full items-center justify-center rounded-md border border-solid border-mineshaft-700 bg-mineshaft-800 p-2">
|
||||||
@@ -60,7 +62,7 @@ export const SecretTable = ({
|
|||||||
onClick={() => {}}
|
onClick={() => {}}
|
||||||
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="ml-2" />}
|
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="ml-2" />}
|
||||||
>
|
>
|
||||||
Login to view this secret
|
Login into <strong>{orgName}</strong> to view this secret
|
||||||
</Button>
|
</Button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user