mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix frontend type errors
This commit is contained in:
@@ -38,13 +38,13 @@ export async function down(knex: Knex): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
if (!hasSecretVersionV2IdentityActorId) {
|
||||
if (hasSecretVersionV2IdentityActorId) {
|
||||
await knex.schema.alterTable(TableName.SecretVersionV2, (t) => {
|
||||
t.dropColumn("identityActorId");
|
||||
});
|
||||
}
|
||||
|
||||
if (!hasSecretVersionV2ActorType) {
|
||||
if (hasSecretVersionV2ActorType) {
|
||||
await knex.schema.alterTable(TableName.SecretVersionV2, (t) => {
|
||||
t.dropColumn("actorType");
|
||||
});
|
||||
|
||||
@@ -214,7 +214,7 @@ export const SecretDetailSidebar = ({
|
||||
const secretReminderRepeatDays = watch("reminderRepeatDays");
|
||||
const secretReminderNote = watch("reminderNote");
|
||||
|
||||
const getModifiedByIcon = (userType: string) => {
|
||||
const getModifiedByIcon = (userType: string | undefined | null) => {
|
||||
switch (userType) {
|
||||
case ActorType.USER:
|
||||
return faUser;
|
||||
@@ -225,7 +225,7 @@ export const SecretDetailSidebar = ({
|
||||
}
|
||||
};
|
||||
|
||||
const getModifiedByName = (userType: string, userName: string | undefined) => {
|
||||
const getModifiedByName = (userType: string | undefined | null, userName: string | null | undefined) => {
|
||||
switch (userType) {
|
||||
case ActorType.PLATFORM:
|
||||
return "System-generated";
|
||||
@@ -235,7 +235,8 @@ export const SecretDetailSidebar = ({
|
||||
};
|
||||
|
||||
const getUserMembershipId = (actorId: string) => {
|
||||
return members.filter((member) => member.user?.id === actorId)?.[0].id || null;
|
||||
const foundMember = members.find((member) => member.user?.id === actorId);
|
||||
return foundMember?.id || null;
|
||||
};
|
||||
|
||||
const getLinkToModifyHistoryEntity = (actorId: string, actorType: string) => {
|
||||
@@ -249,8 +250,8 @@ export const SecretDetailSidebar = ({
|
||||
}
|
||||
};
|
||||
|
||||
const onModifyHistoryClick = (actorId: string | undefined, actorType: string) => {
|
||||
if (actorId && actorType !== ActorType.PLATFORM) {
|
||||
const onModifyHistoryClick = (actorId: string | undefined | null, actorType: string | undefined | null) => {
|
||||
if (actorType && actorId && actorType !== ActorType.PLATFORM) {
|
||||
const redirectLink = getLinkToModifyHistoryEntity(actorId, actorType);
|
||||
if (redirectLink) {
|
||||
navigate({ to: redirectLink });
|
||||
|
||||
Reference in New Issue
Block a user