Add updated at and created at order for vendor
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -35,7 +35,7 @@ import type {
|
|||||||
VendorGraphPaginatedFragment$data,
|
VendorGraphPaginatedFragment$data,
|
||||||
VendorGraphPaginatedFragment$key,
|
VendorGraphPaginatedFragment$key,
|
||||||
} from "/hooks/graph/__generated__/VendorGraphPaginatedFragment.graphql";
|
} from "/hooks/graph/__generated__/VendorGraphPaginatedFragment.graphql";
|
||||||
import { SortableTable } from "/components/SortableTable";
|
import { SortableTable, SortableTh } from "/components/SortableTable";
|
||||||
|
|
||||||
type Vendor = NodeOf<VendorGraphPaginatedFragment$data["vendors"]>;
|
type Vendor = NodeOf<VendorGraphPaginatedFragment$data["vendors"]>;
|
||||||
|
|
||||||
@@ -76,11 +76,10 @@ export default function VendorsPage(props: Props) {
|
|||||||
<SortableTable {...pagination}>
|
<SortableTable {...pagination}>
|
||||||
<Thead>
|
<Thead>
|
||||||
<Tr>
|
<Tr>
|
||||||
<Th>{__("Vendor")}</Th>
|
<SortableTh field="NAME">{__("Vendor")}</SortableTh>
|
||||||
<Th>{__("Accessed At")}</Th>
|
<Th>{__("Accessed At")}</Th>
|
||||||
<Th>{__("Data Risk")}</Th>
|
<Th>{__("Data Risk")}</Th>
|
||||||
<Th>{__("Business Risk")}</Th>
|
<Th>{__("Business Risk")}</Th>
|
||||||
<Th>{__("Assessment Date")}</Th>
|
|
||||||
<Th></Th>
|
<Th></Th>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
@@ -110,7 +109,6 @@ function VendorRow({
|
|||||||
}) {
|
}) {
|
||||||
const { __, dateFormat } = useTranslate();
|
const { __, dateFormat } = useTranslate();
|
||||||
const latestAssessment = vendor.riskAssessments?.edges[0]?.node;
|
const latestAssessment = vendor.riskAssessments?.edges[0]?.node;
|
||||||
const assessmentDate = latestAssessment?.assessedAt || null;
|
|
||||||
|
|
||||||
const deleteVendor = useDeleteVendor(vendor, connectionId);
|
const deleteVendor = useDeleteVendor(vendor, connectionId);
|
||||||
|
|
||||||
@@ -138,16 +136,6 @@ function VendorRow({
|
|||||||
<Td>
|
<Td>
|
||||||
<RiskBadge level={latestAssessment?.businessImpact ?? "NONE"} />
|
<RiskBadge level={latestAssessment?.businessImpact ?? "NONE"} />
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
|
||||||
<Badge variant={assessmentDate ? "success" : "warning"}>
|
|
||||||
{assessmentDate
|
|
||||||
? dateFormat(assessmentDate, {
|
|
||||||
day: "2-digit",
|
|
||||||
month: "short",
|
|
||||||
})
|
|
||||||
: __("Not assessed")}
|
|
||||||
</Badge>
|
|
||||||
</Td>
|
|
||||||
<Td noLink width={50} className="text-end">
|
<Td noLink width={50} className="text-end">
|
||||||
<ActionDropdown>
|
<ActionDropdown>
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
|
|||||||
@@ -155,6 +155,17 @@ enum PeopleOrderField
|
|||||||
enum VendorOrderField
|
enum VendorOrderField
|
||||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorOrderField") {
|
@goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorOrderField") {
|
||||||
NAME
|
NAME
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldName"
|
||||||
|
)
|
||||||
|
CREATED_AT
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldCreatedAt"
|
||||||
|
)
|
||||||
|
UPDATED_AT
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldUpdatedAt"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum FrameworkOrderField
|
enum FrameworkOrderField
|
||||||
|
|||||||
@@ -5010,6 +5010,17 @@ enum PeopleOrderField
|
|||||||
enum VendorOrderField
|
enum VendorOrderField
|
||||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorOrderField") {
|
@goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorOrderField") {
|
||||||
NAME
|
NAME
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldName"
|
||||||
|
)
|
||||||
|
CREATED_AT
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldCreatedAt"
|
||||||
|
)
|
||||||
|
UPDATED_AT
|
||||||
|
@goEnum(
|
||||||
|
value: "github.com/getprobo/probo/pkg/coredata.VendorOrderFieldUpdatedAt"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum FrameworkOrderField
|
enum FrameworkOrderField
|
||||||
@@ -53612,13 +53623,13 @@ func (ec *executionContext) marshalNVendorEdge2ᚖgithubᚗcomᚋgetproboᚋprob
|
|||||||
|
|
||||||
func (ec *executionContext) unmarshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField(ctx context.Context, v any) (coredata.VendorOrderField, error) {
|
func (ec *executionContext) unmarshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField(ctx context.Context, v any) (coredata.VendorOrderField, error) {
|
||||||
tmp, err := graphql.UnmarshalString(v)
|
tmp, err := graphql.UnmarshalString(v)
|
||||||
res := coredata.VendorOrderField(tmp)
|
res := unmarshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField[tmp]
|
||||||
return res, graphql.ErrorOnPath(ctx, err)
|
return res, graphql.ErrorOnPath(ctx, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) marshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.VendorOrderField) graphql.Marshaler {
|
func (ec *executionContext) marshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.VendorOrderField) graphql.Marshaler {
|
||||||
_ = sel
|
_ = sel
|
||||||
res := graphql.MarshalString(string(v))
|
res := graphql.MarshalString(marshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField[v])
|
||||||
if res == graphql.Null {
|
if res == graphql.Null {
|
||||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||||
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
||||||
@@ -53627,6 +53638,19 @@ func (ec *executionContext) marshalNVendorOrderField2githubᚗcomᚋgetproboᚋp
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
unmarshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField = map[string]coredata.VendorOrderField{
|
||||||
|
"NAME": coredata.VendorOrderFieldName,
|
||||||
|
"CREATED_AT": coredata.VendorOrderFieldCreatedAt,
|
||||||
|
"UPDATED_AT": coredata.VendorOrderFieldUpdatedAt,
|
||||||
|
}
|
||||||
|
marshalNVendorOrderField2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐVendorOrderField = map[coredata.VendorOrderField]string{
|
||||||
|
coredata.VendorOrderFieldName: "NAME",
|
||||||
|
coredata.VendorOrderFieldCreatedAt: "CREATED_AT",
|
||||||
|
coredata.VendorOrderFieldUpdatedAt: "UPDATED_AT",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
func (ec *executionContext) marshalNVendorRiskAssessment2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐVendorRiskAssessment(ctx context.Context, sel ast.SelectionSet, v *types.VendorRiskAssessment) graphql.Marshaler {
|
func (ec *executionContext) marshalNVendorRiskAssessment2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐVendorRiskAssessment(ctx context.Context, sel ast.SelectionSet, v *types.VendorRiskAssessment) graphql.Marshaler {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user