@@ -22,6 +22,7 @@ const vendorOverviewPageQuery = graphql`
|
||||
... on Vendor {
|
||||
id
|
||||
name
|
||||
description
|
||||
serviceStartDate
|
||||
serviceTerminationDate
|
||||
serviceCriticality
|
||||
@@ -55,9 +56,9 @@ function VendorOverviewPageContent({
|
||||
<div className="mx-auto max-w-4xl space-y-6">
|
||||
<div className="space-y-2">
|
||||
<h1 className="text-xl font-semibold text-gray-900">
|
||||
{data.node?.name}
|
||||
{data.node.name}
|
||||
</h1>
|
||||
<p className="text-gray-600">View and manage vendor details</p>
|
||||
<p className="text-gray-600">{data.node.description}</p>
|
||||
</div>
|
||||
|
||||
<Card className="p-6">
|
||||
@@ -76,7 +77,7 @@ function VendorOverviewPageContent({
|
||||
<Label className="text-sm">Service Start Date</Label>
|
||||
</div>
|
||||
<p className="text-sm text-gray-600">
|
||||
{new Date(data.node?.serviceStartDate).toLocaleDateString()}
|
||||
{new Date(data.node.serviceStartDate).toLocaleDateString()}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -87,7 +88,7 @@ function VendorOverviewPageContent({
|
||||
<Label className="text-sm">Service Termination Date</Label>
|
||||
</div>
|
||||
<p className="text-sm text-gray-600">
|
||||
{new Date(data.node?.serviceTerminationDate).toLocaleDateString()}
|
||||
{new Date(data.node.serviceTerminationDate).toLocaleDateString()}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<c905d68569a5158d7e5a0ee5eb600a2b>>
|
||||
* @generated SignedSource<<055f5292e2ca7bfecd0d701ce34c8d34>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type CreateVendorInput = {
|
||||
description: string;
|
||||
name: string;
|
||||
organizationId: string;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<939b83dd396154844197ee10514be613>>
|
||||
* @generated SignedSource<<5e9e499f91b8d971375b191b9ce35f5d>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
@@ -17,6 +17,7 @@ export type VendorOverviewPageQuery$variables = {
|
||||
export type VendorOverviewPageQuery$data = {
|
||||
readonly node: {
|
||||
readonly createdAt?: any;
|
||||
readonly description?: string;
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly riskTier?: RiskTier;
|
||||
@@ -65,45 +66,52 @@ v4 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "serviceStartDate",
|
||||
"name": "description",
|
||||
"storageKey": null
|
||||
},
|
||||
v5 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "serviceTerminationDate",
|
||||
"name": "serviceStartDate",
|
||||
"storageKey": null
|
||||
},
|
||||
v6 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "serviceCriticality",
|
||||
"name": "serviceTerminationDate",
|
||||
"storageKey": null
|
||||
},
|
||||
v7 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "riskTier",
|
||||
"name": "serviceCriticality",
|
||||
"storageKey": null
|
||||
},
|
||||
v8 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "statusPageUrl",
|
||||
"name": "riskTier",
|
||||
"storageKey": null
|
||||
},
|
||||
v9 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"name": "statusPageUrl",
|
||||
"storageKey": null
|
||||
},
|
||||
v10 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "createdAt",
|
||||
"storageKey": null
|
||||
},
|
||||
v11 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
@@ -136,7 +144,8 @@ return {
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
(v9/*: any*/),
|
||||
(v10/*: any*/)
|
||||
(v10/*: any*/),
|
||||
(v11/*: any*/)
|
||||
],
|
||||
"type": "Vendor",
|
||||
"abstractKey": null
|
||||
@@ -180,7 +189,8 @@ return {
|
||||
(v7/*: any*/),
|
||||
(v8/*: any*/),
|
||||
(v9/*: any*/),
|
||||
(v10/*: any*/)
|
||||
(v10/*: any*/),
|
||||
(v11/*: any*/)
|
||||
],
|
||||
"type": "Vendor",
|
||||
"abstractKey": null
|
||||
@@ -191,16 +201,16 @@ return {
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "c9d7bade02d1802838f6ac3b02ef7c9a",
|
||||
"cacheID": "04e4ae3f0c7613bf50b59368d02ba937",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "VendorOverviewPageQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query VendorOverviewPageQuery(\n $vendorId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n name\n serviceStartDate\n serviceTerminationDate\n serviceCriticality\n riskTier\n statusPageUrl\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
"text": "query VendorOverviewPageQuery(\n $vendorId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n name\n description\n serviceStartDate\n serviceTerminationDate\n serviceCriticality\n riskTier\n statusPageUrl\n createdAt\n updatedAt\n }\n id\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "92a640f674261d28028d752f027ec141";
|
||||
(node as any).hash = "474b8b7350d917a50c91a0b8239370ea";
|
||||
|
||||
export default node;
|
||||
|
||||
@@ -115,6 +115,7 @@ type VendorEdge {
|
||||
type Vendor implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
serviceStartDate: Datetime!
|
||||
@@ -318,6 +319,7 @@ type Mutation {
|
||||
input CreateVendorInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
}
|
||||
|
||||
input DeleteVendorInput {
|
||||
@@ -350,6 +352,7 @@ enum RiskTier @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.Risk
|
||||
input UpdateVendorInput {
|
||||
id: ID!
|
||||
name: String
|
||||
description: String
|
||||
serviceStartDate: Datetime
|
||||
serviceTerminationDate: Datetime
|
||||
serviceCriticality: ServiceCriticality
|
||||
|
||||
@@ -246,6 +246,7 @@ type ComplexityRoot struct {
|
||||
|
||||
Vendor struct {
|
||||
CreatedAt func(childComplexity int) int
|
||||
Description func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
Name func(childComplexity int) int
|
||||
RiskTier func(childComplexity int) int
|
||||
@@ -1127,6 +1128,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
|
||||
|
||||
return e.complexity.Vendor.CreatedAt(childComplexity), true
|
||||
|
||||
case "Vendor.description":
|
||||
if e.complexity.Vendor.Description == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Vendor.Description(childComplexity), true
|
||||
|
||||
case "Vendor.id":
|
||||
if e.complexity.Vendor.ID == nil {
|
||||
break
|
||||
@@ -1438,6 +1446,7 @@ type VendorEdge {
|
||||
type Vendor implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
serviceStartDate: Datetime!
|
||||
@@ -1641,6 +1650,7 @@ type Mutation {
|
||||
input CreateVendorInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
}
|
||||
|
||||
input DeleteVendorInput {
|
||||
@@ -1673,6 +1683,7 @@ enum RiskTier @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.Risk
|
||||
input UpdateVendorInput {
|
||||
id: ID!
|
||||
name: String
|
||||
description: String
|
||||
serviceStartDate: Datetime
|
||||
serviceTerminationDate: Datetime
|
||||
serviceCriticality: ServiceCriticality
|
||||
@@ -4890,6 +4901,8 @@ func (ec *executionContext) fieldContext_Mutation_createVendor(ctx context.Conte
|
||||
return ec.fieldContext_Vendor_id(ctx, field)
|
||||
case "name":
|
||||
return ec.fieldContext_Vendor_name(ctx, field)
|
||||
case "description":
|
||||
return ec.fieldContext_Vendor_description(ctx, field)
|
||||
case "createdAt":
|
||||
return ec.fieldContext_Vendor_createdAt(ctx, field)
|
||||
case "updatedAt":
|
||||
@@ -7140,6 +7153,44 @@ func (ec *executionContext) fieldContext_Vendor_name(_ context.Context, field gr
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Vendor_description(ctx context.Context, field graphql.CollectedField, obj *types.Vendor) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Vendor_description(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Description, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(string)
|
||||
fc.Result = res
|
||||
return ec.marshalNString2string(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Vendor_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Vendor",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type String does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Vendor_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.Vendor) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Vendor_createdAt(ctx, field)
|
||||
if err != nil {
|
||||
@@ -7567,6 +7618,8 @@ func (ec *executionContext) fieldContext_VendorEdge_node(_ context.Context, fiel
|
||||
return ec.fieldContext_Vendor_id(ctx, field)
|
||||
case "name":
|
||||
return ec.fieldContext_Vendor_name(ctx, field)
|
||||
case "description":
|
||||
return ec.fieldContext_Vendor_description(ctx, field)
|
||||
case "createdAt":
|
||||
return ec.fieldContext_Vendor_createdAt(ctx, field)
|
||||
case "updatedAt":
|
||||
@@ -9194,7 +9247,7 @@ func (ec *executionContext) unmarshalInputCreateVendorInput(ctx context.Context,
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"organizationId", "name"}
|
||||
fieldsInOrder := [...]string{"organizationId", "name", "description"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -9215,6 +9268,13 @@ func (ec *executionContext) unmarshalInputCreateVendorInput(ctx context.Context,
|
||||
return it, err
|
||||
}
|
||||
it.Name = data
|
||||
case "description":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
||||
data, err := ec.unmarshalNString2string(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.Description = data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9282,7 +9342,7 @@ func (ec *executionContext) unmarshalInputUpdateVendorInput(ctx context.Context,
|
||||
asMap[k] = v
|
||||
}
|
||||
|
||||
fieldsInOrder := [...]string{"id", "name", "serviceStartDate", "serviceTerminationDate", "serviceCriticality", "riskTier", "statusPageUrl"}
|
||||
fieldsInOrder := [...]string{"id", "name", "description", "serviceStartDate", "serviceTerminationDate", "serviceCriticality", "riskTier", "statusPageUrl"}
|
||||
for _, k := range fieldsInOrder {
|
||||
v, ok := asMap[k]
|
||||
if !ok {
|
||||
@@ -9303,6 +9363,13 @@ func (ec *executionContext) unmarshalInputUpdateVendorInput(ctx context.Context,
|
||||
return it, err
|
||||
}
|
||||
it.Name = data
|
||||
case "description":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description"))
|
||||
data, err := ec.unmarshalOString2ᚖstring(ctx, v)
|
||||
if err != nil {
|
||||
return it, err
|
||||
}
|
||||
it.Description = data
|
||||
case "serviceStartDate":
|
||||
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceStartDate"))
|
||||
data, err := ec.unmarshalODatetime2ᚖtimeᚐTime(ctx, v)
|
||||
@@ -11162,6 +11229,11 @@ func (ec *executionContext) _Vendor(ctx context.Context, sel ast.SelectionSet, o
|
||||
if out.Values[i] == graphql.Null {
|
||||
out.Invalids++
|
||||
}
|
||||
case "description":
|
||||
out.Values[i] = ec._Vendor_description(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
out.Invalids++
|
||||
}
|
||||
case "createdAt":
|
||||
out.Values[i] = ec._Vendor_createdAt(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
|
||||
@@ -69,6 +69,7 @@ type CreatePeopleInput struct {
|
||||
type CreateVendorInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type DeletePeopleInput struct {
|
||||
@@ -240,6 +241,7 @@ type TaskStateTransitionEdge struct {
|
||||
type UpdateVendorInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
ServiceStartDate *time.Time `json:"serviceStartDate,omitempty"`
|
||||
ServiceTerminationDate *time.Time `json:"serviceTerminationDate,omitempty"`
|
||||
ServiceCriticality *coredata.ServiceCriticality `json:"serviceCriticality,omitempty"`
|
||||
@@ -250,6 +252,7 @@ type UpdateVendorInput struct {
|
||||
type Vendor struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ServiceStartDate time.Time `json:"serviceStartDate"`
|
||||
|
||||
@@ -43,6 +43,7 @@ func NewVendor(v *coredata.Vendor) *Vendor {
|
||||
return &Vendor{
|
||||
ID: v.ID,
|
||||
Name: v.Name,
|
||||
Description: v.Description,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
ServiceStartDate: v.ServiceStartDate,
|
||||
|
||||
2
pkg/probo/coredata/migrations/20250218T112800Z.sql
Normal file
2
pkg/probo/coredata/migrations/20250218T112800Z.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE vendors ADD COLUMN description TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE vendors ALTER COLUMN description DROP DEFAULT;
|
||||
@@ -31,6 +31,7 @@ type (
|
||||
ID gid.GID
|
||||
OrganizationID gid.GID
|
||||
Name string
|
||||
Description string
|
||||
ServiceStartDate time.Time
|
||||
ServiceTerminationDate *time.Time
|
||||
ServiceCriticality ServiceCriticality
|
||||
@@ -52,6 +53,7 @@ func (v *Vendor) scan(r pgx.Row) error {
|
||||
&v.ID,
|
||||
&v.OrganizationID,
|
||||
&v.Name,
|
||||
&v.Description,
|
||||
&v.ServiceStartDate,
|
||||
&v.ServiceTerminationDate,
|
||||
&v.ServiceCriticality,
|
||||
@@ -73,6 +75,7 @@ SELECT
|
||||
id,
|
||||
organization_id,
|
||||
name,
|
||||
description,
|
||||
service_start_date,
|
||||
service_termination_date,
|
||||
service_criticality,
|
||||
@@ -115,6 +118,7 @@ INSERT INTO
|
||||
id,
|
||||
organization_id,
|
||||
name,
|
||||
description,
|
||||
service_start_date,
|
||||
service_termination_date,
|
||||
service_criticality,
|
||||
@@ -127,6 +131,7 @@ VALUES (
|
||||
@vendor_id,
|
||||
@organization_id,
|
||||
@name,
|
||||
@description,
|
||||
@service_start_date,
|
||||
@service_termination_date,
|
||||
@service_criticality,
|
||||
@@ -141,6 +146,7 @@ VALUES (
|
||||
"vendor_id": v.ID,
|
||||
"organization_id": v.OrganizationID,
|
||||
"name": v.Name,
|
||||
"description": v.Description,
|
||||
"service_start_date": v.ServiceStartDate,
|
||||
"service_termination_date": v.ServiceTerminationDate,
|
||||
"service_criticality": v.ServiceCriticality,
|
||||
@@ -183,6 +189,7 @@ SELECT
|
||||
id,
|
||||
organization_id,
|
||||
name,
|
||||
description,
|
||||
service_start_date,
|
||||
service_termination_date,
|
||||
service_criticality,
|
||||
|
||||
Reference in New Issue
Block a user