Fix controls and frameworks small issues
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
BIN
apps/console/public/logos/hipaa.png
Normal file
BIN
apps/console/public/logos/hipaa.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -8,7 +8,7 @@ const availableLogos = new Map(
|
|||||||
export function FrameworkLogo({ name }: { name: string }) {
|
export function FrameworkLogo({ name }: { name: string }) {
|
||||||
const logo = availableLogos.get(name);
|
const logo = availableLogos.get(name);
|
||||||
return logo ? (
|
return logo ? (
|
||||||
<img src={logo} alt="" className="size-12" />
|
<img src={logo} alt="" className="h-12" />
|
||||||
) : (
|
) : (
|
||||||
<Avatar name={name} size="l" className="size-12" />
|
<Avatar name={name} size="l" className="size-12" />
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export default function FrameworkDetailPage(props: Props) {
|
|||||||
const controls = framework.controls.edges.map((edge) => edge.node);
|
const controls = framework.controls.edges.map((edge) => edge.node);
|
||||||
const selectedControl = controlId
|
const selectedControl = controlId
|
||||||
? controls.find((control) => control.id === controlId)
|
? controls.find((control) => control.id === controlId)
|
||||||
: controls[0];
|
: controls[0] || null;
|
||||||
const connectionId = framework.controls.__id;
|
const connectionId = framework.controls.__id;
|
||||||
const deleteFramework = useDeleteFrameworkMutation(
|
const deleteFramework = useDeleteFrameworkMutation(
|
||||||
framework,
|
framework,
|
||||||
@@ -109,7 +109,7 @@ export default function FrameworkDetailPage(props: Props) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!controlId) {
|
if (!controlId && controls.length > 0) {
|
||||||
return (
|
return (
|
||||||
<Navigate
|
<Navigate
|
||||||
to={`/organizations/${organizationId}/frameworks/${framework.id}/controls/${controls[0].id}`}
|
to={`/organizations/${organizationId}/frameworks/${framework.id}/controls/${controls[0].id}`}
|
||||||
|
|||||||
@@ -12,15 +12,9 @@ export const availableFrameworks = [
|
|||||||
description: "System and Organization Controls 2",
|
description: "System and Organization Controls 2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "GDPR",
|
id: "HIPAA",
|
||||||
name: "GDPR",
|
name: "HIPAA",
|
||||||
logo: "/logos/gdpr.png",
|
logo: "/logos/hipaa.png",
|
||||||
description: "General Data Protection Regulation",
|
description: "Health Insurance Portability and Accountability Act",
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "SOX",
|
|
||||||
name: "SOX",
|
|
||||||
logo: "/logos/sox.png",
|
|
||||||
description: "Sarbanes-Oxley Act",
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ type (
|
|||||||
Name string
|
Name string
|
||||||
Description string
|
Description string
|
||||||
SectionTitle string
|
SectionTitle string
|
||||||
|
Status *coredata.ControlStatus
|
||||||
|
ExclusionJustification *string
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateControlRequest struct {
|
UpdateControlRequest struct {
|
||||||
@@ -504,6 +506,8 @@ func (s ControlService) Create(
|
|||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
Description: req.Description,
|
Description: req.Description,
|
||||||
SectionTitle: req.SectionTitle,
|
SectionTitle: req.SectionTitle,
|
||||||
|
Status: *req.Status,
|
||||||
|
ExclusionJustification: req.ExclusionJustification,
|
||||||
CreatedAt: now,
|
CreatedAt: now,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1761,7 +1761,7 @@ input CreateControlInput {
|
|||||||
sectionTitle: String!
|
sectionTitle: String!
|
||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
status: ControlStatus
|
status: ControlStatus!
|
||||||
exclusionJustification: String
|
exclusionJustification: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6718,7 +6718,7 @@ input CreateControlInput {
|
|||||||
sectionTitle: String!
|
sectionTitle: String!
|
||||||
name: String!
|
name: String!
|
||||||
description: String!
|
description: String!
|
||||||
status: ControlStatus
|
status: ControlStatus!
|
||||||
exclusionJustification: String
|
exclusionJustification: String
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38150,7 +38150,7 @@ func (ec *executionContext) unmarshalInputCreateControlInput(ctx context.Context
|
|||||||
it.Description = data
|
it.Description = data
|
||||||
case "status":
|
case "status":
|
||||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status"))
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("status"))
|
||||||
data, err := ec.unmarshalOControlStatus2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlStatus(ctx, v)
|
data, err := ec.unmarshalNControlStatus2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐControlStatus(ctx, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return it, err
|
return it, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ type CreateControlInput struct {
|
|||||||
SectionTitle string `json:"sectionTitle"`
|
SectionTitle string `json:"sectionTitle"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Status *coredata.ControlStatus `json:"status,omitempty"`
|
Status coredata.ControlStatus `json:"status"`
|
||||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1205,6 +1205,8 @@ func (r *mutationResolver) CreateControl(ctx context.Context, input types.Create
|
|||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
SectionTitle: input.SectionTitle,
|
SectionTitle: input.SectionTitle,
|
||||||
|
Status: &input.Status,
|
||||||
|
ExclusionJustification: input.ExclusionJustification,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot create control: %w", err)
|
return nil, fmt.Errorf("cannot create control: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user