Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(frontend): extract classification example data to JSON file (#19722)

Danny Xudd2e69328455
diff --git a/frontend/src/components/SensitiveData/ClassificationView.vue b/frontend/src/components/SensitiveData/ClassificationView.vue
index 1368f81464..6467459ef6 100644
--- a/frontend/src/components/SensitiveData/ClassificationView.vue
+++ b/frontend/src/components/SensitiveData/ClassificationView.vue
@@ -78,7 +78,7 @@
<DataExampleModal
v-if="state.showExampleModal"
- :example="JSON.stringify(example, null, 2)"
+ :example="exampleJSON"
@dismiss="state.showExampleModal = false"
/>
</template>
@@ -111,6 +111,7 @@ import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import { hasWorkspacePermissionV2 } from "@/utils";
import LearnMoreLink from "../LearnMoreLink.vue";
import SingleFileSelector from "../SingleFileSelector.vue";
+import classificationExample from "./classification-example.json";
import ClassificationTree from "./components/ClassificationTree.vue";
import DataExampleModal from "./components/DataExampleModal.vue";
@@ -332,92 +333,5 @@ const onFileSelect = (file: File) => {
fr.readAsText(file);
};
-const example = {
- title: "Classification Example",
- levels: [
- create(DataClassificationSetting_DataClassificationConfig_LevelSchema, {
- id: "1",
- title: "Level 1",
- description: "",
- }),
- create(DataClassificationSetting_DataClassificationConfig_LevelSchema, {
- id: "2",
- title: "Level 2",
- description: "",
- }),
- create(DataClassificationSetting_DataClassificationConfig_LevelSchema, {
- id: "3",
- title: "Level 3",
- description: "",
- }),
- create(DataClassificationSetting_DataClassificationConfig_LevelSchema, {
- id: "4",
- title: "Level 4",
- description: "",
- }),
- ],
- classification: {
- "1": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "1",
- title: "Basic",
- description: "",
- }
- ),
- "1-1": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "1-1",
- title: "Basic",
- description: "",
- levelId: "1",
- }
- ),
- "1-2": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "1-2",
- title: "Contact",
- description: "",
- levelId: "2",
- }
- ),
- "1-3": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "1-3",
- title: "Health",
- description: "",
- levelId: "4",
- }
- ),
- "2": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "2",
- title: "Relationship",
- description: "",
- }
- ),
- "2-1": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "2-1",
- title: "Social",
- description: "",
- levelId: "1",
- }
- ),
- "2-2": create(
- DataClassificationSetting_DataClassificationConfig_DataClassificationSchema,
- {
- id: "2-2",
- title: "Business",
- description: "",
- levelId: "3",
- }
- ),
- },
-} satisfies UploadClassificationConfig;
+const exampleJSON = JSON.stringify(classificationExample, null, 2);
</script>
diff --git a/frontend/src/components/SensitiveData/classification-example.json b/frontend/src/components/SensitiveData/classification-example.json
new file mode 100644
index 0000000000..00a6f25513
--- /dev/null
+++ b/frontend/src/components/SensitiveData/classification-example.json
@@ -0,0 +1,38 @@
+{
+ "title": "Classification Example",
+ "levels": [
+ { "id": "1", "title": "Level 1", "description": "" },
+ { "id": "2", "title": "Level 2", "description": "" },
+ { "id": "3", "title": "Level 3", "description": "" },
+ { "id": "4", "title": "Level 4", "description": "" }
+ ],
+ "classification": {
+ "1": { "id": "1", "title": "Basic", "description": "" },
+ "1-1": { "id": "1-1", "title": "Basic", "description": "", "levelId": "1" },
+ "1-2": {
+ "id": "1-2",
+ "title": "Contact",
+ "description": "",
+ "levelId": "2"
+ },
+ "1-3": {
+ "id": "1-3",
+ "title": "Health",
+ "description": "",
+ "levelId": "4"
+ },
+ "2": { "id": "2", "title": "Relationship", "description": "" },
+ "2-1": {
+ "id": "2-1",
+ "title": "Social",
+ "description": "",
+ "levelId": "1"
+ },
+ "2-2": {
+ "id": "2-2",
+ "title": "Business",
+ "description": "",
+ "levelId": "3"
+ }
+ }
+}