@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import { useTranslate } from "@probo/i18n";
|
import { useTranslate } from "@probo/i18n";
|
||||||
import { Field } from "@probo/ui";
|
import { Field } from "@probo/ui";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { graphql } from "relay-runtime";
|
import { graphql } from "relay-runtime";
|
||||||
|
|
||||||
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
|
||||||
@@ -52,10 +52,12 @@ export function CompliancePageAliasField(props: {
|
|||||||
|
|
||||||
const { __ } = useTranslate();
|
const { __ } = useTranslate();
|
||||||
const [value, setValue] = useState(alias ?? "");
|
const [value, setValue] = useState(alias ?? "");
|
||||||
|
const [prevAlias, setPrevAlias] = useState(alias);
|
||||||
|
|
||||||
useEffect(() => {
|
if (alias !== prevAlias) {
|
||||||
|
setPrevAlias(alias);
|
||||||
setValue(alias ?? "");
|
setValue(alias ?? "");
|
||||||
}, [alias]);
|
}
|
||||||
|
|
||||||
const [setResourceAlias, isSettingAlias] = useMutationWithToasts(
|
const [setResourceAlias, isSettingAlias] = useMutationWithToasts(
|
||||||
setResourceAliasMutation,
|
setResourceAliasMutation,
|
||||||
|
|||||||
@@ -76,15 +76,19 @@ func normalizeRequiredJSON(data []byte) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
obj["items"] = n
|
obj["items"] = n
|
||||||
}
|
}
|
||||||
|
|
||||||
if addlRaw, ok := obj["additionalProperties"]; ok {
|
if addlRaw, ok := obj["additionalProperties"]; ok {
|
||||||
n, err := normalizeRequiredJSON(addlRaw)
|
n, err := normalizeRequiredJSON(addlRaw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
obj["additionalProperties"] = n
|
obj["additionalProperties"] = n
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(obj)
|
return json.Marshal(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,6 +118,7 @@ func normalizeRequiredJSON(data []byte) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
required = append(required, name)
|
required = append(required, name)
|
||||||
requiredSet[name] = true
|
requiredSet[name] = true
|
||||||
}
|
}
|
||||||
@@ -125,6 +130,7 @@ func normalizeRequiredJSON(data []byte) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
obj["properties"] = propsData
|
obj["properties"] = propsData
|
||||||
|
|
||||||
if len(required) > 0 {
|
if len(required) > 0 {
|
||||||
@@ -132,6 +138,7 @@ func normalizeRequiredJSON(data []byte) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
obj["required"] = reqData
|
obj["required"] = reqData
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +164,7 @@ func makeNullableJSON(data []byte) ([]byte, error) {
|
|||||||
arr, _ := json.Marshal([]string{single, "null"})
|
arr, _ := json.Marshal([]string{single, "null"})
|
||||||
obj["type"] = arr
|
obj["type"] = arr
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(obj)
|
return json.Marshal(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,9 +173,11 @@ func makeNullableJSON(data []byte) ([]byte, error) {
|
|||||||
if slices.Contains(arr, "null") {
|
if slices.Contains(arr, "null") {
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
arr = append(arr, "null")
|
arr = append(arr, "null")
|
||||||
nullable, _ := json.Marshal(arr)
|
nullable, _ := json.Marshal(arr)
|
||||||
obj["type"] = nullable
|
obj["type"] = nullable
|
||||||
|
|
||||||
return json.Marshal(obj)
|
return json.Marshal(obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ func (s *Service) RenderRobotsTxt(
|
|||||||
|
|
||||||
func (s *Service) fetchDocumentIDs(ctx context.Context, scope coredata.Scoper, orgID gid.GID) ([]string, error) {
|
func (s *Service) fetchDocumentIDs(ctx context.Context, scope coredata.Scoper, orgID gid.GID) ([]string, error) {
|
||||||
seen := make(map[gid.GID]struct{})
|
seen := make(map[gid.GID]struct{})
|
||||||
|
|
||||||
var resourceIDs []gid.GID
|
var resourceIDs []gid.GID
|
||||||
|
|
||||||
appendResourceID := func(id gid.GID) {
|
appendResourceID := func(id gid.GID) {
|
||||||
|
|||||||
Reference in New Issue
Block a user