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 }) {
|
||||
const logo = availableLogos.get(name);
|
||||
return logo ? (
|
||||
<img src={logo} alt="" className="size-12" />
|
||||
<img src={logo} alt="" className="h-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 selectedControl = controlId
|
||||
? controls.find((control) => control.id === controlId)
|
||||
: controls[0];
|
||||
: controls[0] || null;
|
||||
const connectionId = framework.controls.__id;
|
||||
const deleteFramework = useDeleteFrameworkMutation(
|
||||
framework,
|
||||
@@ -109,7 +109,7 @@ export default function FrameworkDetailPage(props: Props) {
|
||||
});
|
||||
};
|
||||
|
||||
if (!controlId) {
|
||||
if (!controlId && controls.length > 0) {
|
||||
return (
|
||||
<Navigate
|
||||
to={`/organizations/${organizationId}/frameworks/${framework.id}/controls/${controls[0].id}`}
|
||||
|
||||
@@ -12,15 +12,9 @@ export const availableFrameworks = [
|
||||
description: "System and Organization Controls 2",
|
||||
},
|
||||
{
|
||||
id: "GDPR",
|
||||
name: "GDPR",
|
||||
logo: "/logos/gdpr.png",
|
||||
description: "General Data Protection Regulation",
|
||||
},
|
||||
{
|
||||
id: "SOX",
|
||||
name: "SOX",
|
||||
logo: "/logos/sox.png",
|
||||
description: "Sarbanes-Oxley Act",
|
||||
id: "HIPAA",
|
||||
name: "HIPAA",
|
||||
logo: "/logos/hipaa.png",
|
||||
description: "Health Insurance Portability and Accountability Act",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -31,11 +31,13 @@ type (
|
||||
}
|
||||
|
||||
CreateControlRequest struct {
|
||||
ID gid.GID
|
||||
FrameworkID gid.GID
|
||||
Name string
|
||||
Description string
|
||||
SectionTitle string
|
||||
ID gid.GID
|
||||
FrameworkID gid.GID
|
||||
Name string
|
||||
Description string
|
||||
SectionTitle string
|
||||
Status *coredata.ControlStatus
|
||||
ExclusionJustification *string
|
||||
}
|
||||
|
||||
UpdateControlRequest struct {
|
||||
@@ -498,14 +500,16 @@ func (s ControlService) Create(
|
||||
framework := &coredata.Framework{}
|
||||
|
||||
control := &coredata.Control{
|
||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ControlEntityType),
|
||||
FrameworkID: req.FrameworkID,
|
||||
TenantID: s.svc.scope.GetTenantID(),
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
SectionTitle: req.SectionTitle,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
ID: gid.New(s.svc.scope.GetTenantID(), coredata.ControlEntityType),
|
||||
FrameworkID: req.FrameworkID,
|
||||
TenantID: s.svc.scope.GetTenantID(),
|
||||
Name: req.Name,
|
||||
Description: req.Description,
|
||||
SectionTitle: req.SectionTitle,
|
||||
Status: *req.Status,
|
||||
ExclusionJustification: req.ExclusionJustification,
|
||||
CreatedAt: now,
|
||||
UpdatedAt: now,
|
||||
}
|
||||
|
||||
err := s.svc.pg.WithTx(
|
||||
|
||||
@@ -1761,7 +1761,7 @@ input CreateControlInput {
|
||||
sectionTitle: String!
|
||||
name: String!
|
||||
description: String!
|
||||
status: ControlStatus
|
||||
status: ControlStatus!
|
||||
exclusionJustification: String
|
||||
}
|
||||
|
||||
|
||||
@@ -6718,7 +6718,7 @@ input CreateControlInput {
|
||||
sectionTitle: String!
|
||||
name: String!
|
||||
description: String!
|
||||
status: ControlStatus
|
||||
status: ControlStatus!
|
||||
exclusionJustification: String
|
||||
}
|
||||
|
||||
@@ -38150,7 +38150,7 @@ func (ec *executionContext) unmarshalInputCreateControlInput(ctx context.Context
|
||||
it.Description = data
|
||||
case "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 {
|
||||
return it, err
|
||||
}
|
||||
|
||||
@@ -169,12 +169,12 @@ type CreateControlDocumentMappingPayload struct {
|
||||
}
|
||||
|
||||
type CreateControlInput struct {
|
||||
FrameworkID gid.GID `json:"frameworkId"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status *coredata.ControlStatus `json:"status,omitempty"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
FrameworkID gid.GID `json:"frameworkId"`
|
||||
SectionTitle string `json:"sectionTitle"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status coredata.ControlStatus `json:"status"`
|
||||
ExclusionJustification *string `json:"exclusionJustification,omitempty"`
|
||||
}
|
||||
|
||||
type CreateControlMeasureMappingInput struct {
|
||||
|
||||
@@ -1201,10 +1201,12 @@ func (r *mutationResolver) CreateControl(ctx context.Context, input types.Create
|
||||
prb := r.ProboService(ctx, input.FrameworkID.TenantID())
|
||||
|
||||
control, err := prb.Controls.Create(ctx, probo.CreateControlRequest{
|
||||
FrameworkID: input.FrameworkID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
SectionTitle: input.SectionTitle,
|
||||
FrameworkID: input.FrameworkID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
SectionTitle: input.SectionTitle,
|
||||
Status: &input.Status,
|
||||
ExclusionJustification: input.ExclusionJustification,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot create control: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user