@hestia-earth/ui-components 0.32.21 → 0.32.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6908,7 +6908,7 @@ class NodeLogsModelsComponent {
6908
6908
  this.termsByIdResource = rxResource({
6909
6909
  request: () => ({
6910
6910
  ids: unique(this.allBlankNodes()
6911
- .flatMap(v => v['subValues'])
6911
+ .flatMap(v => v['subValues'] ?? [])
6912
6912
  .flatMap(v => [v, ...(v.subValues ?? [])])
6913
6913
  .map(({ id }) => id))
6914
6914
  }),
@@ -10392,6 +10392,7 @@ var ErrorKeys;
10392
10392
  ErrorKeys["NestedHeaders"] = "nested-headers";
10393
10393
  ErrorKeys["NestedNodes"] = "nested-nodes";
10394
10394
  ErrorKeys["ReferenceExistingHeaders"] = "reference-existing-headers";
10395
+ ErrorKeys["MultipleTermHeaders"] = "multiple-term-headers";
10395
10396
  ErrorKeys["MaxSize"] = "max-size";
10396
10397
  ErrorKeys["MaxRows"] = "max-rows";
10397
10398
  ErrorKeys["Mendeley"] = "'content-type'";
@@ -10493,11 +10494,11 @@ class FilesUploadErrorsComponent {
10493
10494
  return value !== firstVal;
10494
10495
  }
10495
10496
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FilesUploadErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10496
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: FilesUploadErrorsComponent, isStandalone: true, selector: "he-files-upload-errors", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: true, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (error()) {\n <div class=\"has-text-danger\">\n @switch (message()) {\n @case (ErrorKeys.PrivacyNotAllowed) {\n <div>\n <span>\n Uploading data with\n <code class=\"is-px-1\">dataPrivate={{ error().value }}</code>\n is not allowed.\n </span>\n <span class=\"is-pl-1\">\n Please try uploading with\n <code class=\"is-px-1\">dataPrivate={{ !error().value }}</code>\n instead.\n </span>\n </div>\n }\n @case (ErrorKeys.InvalidJSON) {\n <div>\n <p>The uploaded content does not appear to contain valid JSON data:</p>\n <div class=\"is-mt-2\">\n <pre><code>{{error().error}}</code></pre>\n </div>\n <p>\n Please validate your JSON content before uploading it using an\n <a href=\"https://jsoneditoronline.org\" target=\"_blank\">online tool</a>\n for example.\n </p>\n </div>\n }\n @case (ErrorKeys.NoData) {\n <div class=\"is-mb-2\">\n <p>No Nodes could be found in your Upload. Please verify the column headers match the HESTIA schema.</p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (SchemaErrorKeys.PropertyNotFound) {\n <div class=\"is-mb-2\">\n <div class=\"notification is-danger\" role=\"alert\">\n <p>\n <he-svg-icon name=\"exclamation-triangle\" />\n <span class=\"is-pl-2\">You have column headers that do not match the HESTIA schema.</span>\n <span class=\"px-1\">Please refer to the</span>\n <a [href]=\"schemaUrl()\" target=\"_blank\">schema</a>\n <span class=\"pl-1\">and then correct the column headers indicated below.</span>\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n <div class=\"is-mb-2\">\n <pre><code>{{error().key}}</code></pre>\n </div>\n </div>\n }\n @case (SchemaErrorKeys.PropertyInvalidFormat) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span>\n The following value in the column\n <i>{{ error().key }}</i>\n is not in the correct format:\n </span>\n <br />\n <pre class=\"is-mt-2\"><code>{{stringify(error().value)}}</code></pre>\n </div>\n @switch (hasNumberWithCommasError()) {\n @case (true) {\n <p class=\"is-mt-2\">\n Please format your numbers to remove commas and use a decimal point to separate the whole part of the\n number from the fractional part of the number.\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>3,510.1</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>3510.1</code></pre>\n }\n @case (false) {\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n <p>The error could either be a value in the column, or an error with the column header.</p>\n <p>\n If you are trying to set no data, we accept either\n <code>-</code>\n or an empty cell.\n </p>\n }\n }\n </div>\n }\n @case (ErrorKeys.PropertyRequired) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The following field is required in the</span>\n @if (error().schema) {\n <a class=\"pr-1\" [href]=\"schemaUrl()\" target=\"_blank\">{{ error().schema }}</a>\n }\n <span>schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().property}}</code></pre>\n </div>\n <p>\n @switch (error().property) {\n @case ('id') {\n <span>\n You must assign a unique\n <code>id</code>\n for every record in your data.\n </span>\n }\n @case ('type') {\n <span>\n Every record in your data must contain a\n <code>type</code>\n .\n </span>\n }\n }\n </p>\n </div>\n }\n @case (ErrorKeys.PropertyInternal) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">\n The following field is\n <code>internal</code>\n in the\n </span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schema }} schema</a>\n <span>:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schemaKey || error().key}}</code></pre>\n </div>\n <p>\n You cannot upload\n <code>internal</code>\n fields to HESTIA.\n </p>\n </div>\n }\n @case (SchemaErrorKeys.SchemaNotFound) {\n <div class=\"is-mb-2\">\n @if (error().key) {\n <div class=\"is-mb-2\">\n <span>The following Node does not exist in the schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().key}}</code></pre>\n </div>\n } @else if (error().schema) {\n <div class=\"is-mb-2\">\n <span>The following Node Type does not exist in the schema or can not be uploaded directly:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schema}}</code></pre>\n </div>\n }\n <p>\n <span>The list of accepted values is:</span>\n </p>\n <div class=\"content\">\n <ul>\n @for (type of nodeTypes; track type) {\n <li>\n <i>{{ type }}</i>\n </li>\n }\n </ul>\n </div>\n </div>\n }\n @case (ErrorKeys.InvalidFirstColumn) {\n <div class=\"is-mb-2\">\n <span>\n No data in the HESTIA format was detected on the first sheet. Either try selecting a different sheet in the\n upload screen, or check the sheet to ensure the headers follow the schema - see examples\n </span>\n <a class=\"pl-1\" routerLink=\"/upload\" fragment=\"example\">here</a>\n </div>\n }\n @case (ErrorKeys.InvalidExcelFile) {\n <div class=\"is-mb-2\">\n This file has been uploaded with a\n <code>{{ fileExt() }}</code>\n extension, but does not appear to be a valid Excel file.\n </div>\n }\n @case (ErrorKeys.NoHeaders) {\n <div class=\"is-mb-2\">\n <p>\n No headers matching the HESTIA schema were found on the first row. Please remove all empty rows at the\n begining of the file and try uploading again.\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (ErrorKeys.InvalidSheetName) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The Excel sheet</span>\n <code>{{ error().value }}</code>\n <span class=\"pl-1\">does not exist.</span>\n <span class=\"pl-1\">Your Excel file contains the following sheets:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (e of error().error.split(';'); track e) {\n <li>\n <code>{{ e }}</code>\n </li>\n }\n </ul>\n </div>\n <p>\n <span>Please re-upload selecting one of the sheets above.</span>\n </p>\n </div>\n }\n @case (ErrorKeys.DuplicatedHeaders) {\n <div class=\"is-mb-2\">\n <span>Your upload contains duplicated column headers.</span>\n </div>\n }\n @case (ErrorKeys.DuplicatedIds) {\n <div class=\"is-mb-2\">\n <div>\n <span class=\"is-pr-1\">You have multiple</span>\n <code>{{ error().schema | pluralize }}</code>\n <span class=\"is-px-1\">with the same</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-px-1\">but different data. The</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">is:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().value}}</code></pre>\n </div>\n <p class=\"is-mt-2 is-italic\">\n <span class=\"is-pr-1\">Please note that ussing different case does not make the</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">unique.</span>\n </p>\n </div>\n }\n @case (SchemaErrorKeys.DuplicatedIdFields) {\n <div class=\"is-mb-2\">\n <span class=\"is-pr-1\">You have used both the</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">and</span>\n <code>id</code>\n <span class=\"is-px-1\">fields in the same data. Please use</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">when linking to existing nodes on the Platform, and</span>\n <code>id</code>\n <span class=\"is-px-1\">when linking to nodes you are uploading in this file using the same</span>\n <code>id</code>\n <span class=\"is-px-1\">field.</span>\n </div>\n }\n @case (ErrorKeys.NestedHeaders) {\n <div class=\"is-mb-2\">\n <p>\n To link nodes together, you first need to define the node (e.g.,\n <code>source.id</code>\n ,\n <code>source.bibliography.title</code>\n ) and then create the link (e.g.,\n <code>cycle.defaultSource.id</code>\n ). We do not allow nesting (e.g.,\n <code>cycle.defaultSource.bibliography.title</code>\n ).\n </p>\n </div>\n }\n @case (ErrorKeys.NestedNodes) {\n <div class=\"is-mb-2\">\n <p>To link nodes together, you need to upload each node separately, as we do not allow nesting:</p>\n <pre class=\"is-mt-2\"><code>{{ sampleLinkedNodes | json }}</code></pre>\n </div>\n }\n @case (ErrorKeys.ReferenceExistingHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You have used the internal\n <code>&#64;id</code>\n field to upload a new Node.\n </p>\n <p>\n The\n <code>&#64;id</code>\n field should only be used to reference existing Node or Terms. Example:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.&#64;id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n </div>\n }\n @case (SchemaErrorKeys.ObjectArrayInvalid) {\n <div class=\"is-mb-2\">\n <p>The column header {{ error().key }} must use the array format. Examples:</p>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.value' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.value' }}</code></pre>\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n </div>\n }\n @case (ErrorKeys.MaxSize) {\n <div class=\"is-mb-2\">\n <span>The maximum file size limit is {{ maxFileSizeMb }}Mb (current file size: {{ error().value }}Mb).</span>\n <span class=\"pl-1\">Please re-upload these data in multiple files.</span>\n </div>\n }\n @case (ErrorKeys.MaxRows) {\n <div class=\"is-mb-2\">\n <span>\n Your file has {{ error().value | number }} rows. This might be an error caused by adding some data at the\n bottom of a spreadsheet by accident: delete any unused rows and resubmit the file.\n </span>\n </div>\n }\n @case (ErrorKeys.Mendeley) {\n <div class=\"is-mb-2\">\n <p>An error occured while fetching the bibliographic information. Please try re-uploading the file.</p>\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @case (ErrorKeys.Timeout) {\n <div class=\"is-mb-2\">\n <p>Time exceeded for current step.</p>\n\n @if (debug()) {\n <span>You can try to \"Re-index\" or \"Re-upload\" if it still does not work.</span>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @default {\n <div class=\"is-mb-2\">\n <p>{{ message() }}</p>\n\n @if (debug()) {\n <pre><code>{{ error() | json }}</code></pre>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n }\n\n @if (hasGeoJSONError()) {\n <div class=\"is-mb-2\">\n <p>If the GeoJSON is too large, please try to simplify it following these steps:</p>\n <ul class=\"is-my-1 content is-list-style-decimal pl-5\">\n <li>\n <span class=\"is-pr-1\">Go to</span>\n <a href=\"https://mapshaper.org/\" target=\"_blank\">https://mapshaper.org/</a>\n </li>\n <li>\n <span>\n Save the boundary in a valid\n <code>.geojson</code>\n file.\n </span>\n </li>\n <li>\n <span>Import it on mapshaper.</span>\n </li>\n <li>\n <span>Click \"Simplify\" in the top right corner in the menu bar.</span>\n </li>\n <li>\n <span>Adjust the percentage to a lower value, like 50% to start with.</span>\n </li>\n <li>\n <span>\n Export to\n <code>GeoJson</code>\n or\n <code>CSV</code>\n .\n </span>\n </li>\n <li>\n <span>Copy the resulting content into your upload file.</span>\n </li>\n </ul>\n <p>If you encounter the error again, try again using a lower percentage at step 5.</p>\n </div>\n }\n\n @if (columns().length || (error().index && !isSchemaError())) {\n <div class=\"my-3\">\n <b>Hint:</b>\n <span class=\"pl-1\">the error might be located</span>\n @if (error().index && !isSchemaError()) {\n <span class=\"pl-1\">on row {{ error().index }}</span>\n }\n @if (columns().length) {\n <span class=\"pl-1\">in {{ 'column' | pluralize: columns().length }}:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (column of columns(); track column) {\n <li>\n <b class=\"pr-2\">{{ column.column }}</b>\n <code>{{ column.name }}</code>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (error().suggestions?.length) {\n <div class=\"my-3\">\n <b>Suggestions:</b>\n <span class=\"pl-1\">did you mean instead:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (suggestion of error().suggestions; track suggestion) {\n <li>\n <code>{{ suggestion }}</code>\n </li>\n }\n </ul>\n </div>\n }\n\n @if (showCsvPreview()) {\n <div class=\"is-my-2\">\n <b>\n Preview\n <sup>1</sup>\n :\n </b>\n <div class=\"table-container is-mt-2\">\n <table class=\"table is-bordered is-fullwidth is-hoverable is-narrow mb-0\">\n <thead>\n @if (error().index) {\n <th></th>\n }\n @for (header of headers(); track header) {\n <th>{{ header }}</th>\n }\n </thead>\n <tbody>\n @for (row of rows(); track row) {\n <tr>\n @if (error().index) {\n <td class=\"has-text-danger\">\n <span class=\"is-nowrap\">Row {{ error().index }}</span>\n </td>\n }\n @for (col of row; track col; let colIndex = $index) {\n <td>\n <span\n [class.has-text-danger]=\"\n message() === ErrorKeys.DuplicatedIds && hasDuplicatedError(col, colIndex)\n \">\n {{ col | ellipsis: 50 }}\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <p class=\"is-size-7\">\n <i>1. The preview does not necessarily reflect the original Upload's order or content.</i>\n </p>\n </div>\n }\n\n @if (showJsonPreview()) {\n <div class=\"is-my-2\">\n <b>Preview:</b>\n <pre class=\"is-mt-2\"><code>{{stringify(error().node)}}</code></pre>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultError>\n <p class=\"is-mt-2 has-text-black\">\n <span class=\"is-pr-1\">If you are still stuck, please see</span>\n <a [href]=\"baseUrl + '/upload#example'\" target=\"_blank\">the example uploads and videos</a>\n <span class=\"is-px-1\">\n or try using the Wizard to get the first few rows of data formatted correctly, or use the chat to ask for help.\n </span>\n </p>\n</ng-template>\n\n<ng-template #reportError>\n <p class=\"is-mt-2\">\n To report this error, please\n <a class=\"is-pl-1\" [href]=\"reportErrorUrl()\" target=\"_blank\">click here</a>\n .\n </p>\n</ng-template>\n\n<ng-template #schemaError>\n <p>\n <span class=\"pr-1\">You can see the accepted field type and some examples</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">here</a>\n <span>.</span>\n </p>\n</ng-template>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: HESvgIconComponent, selector: "he-svg-icon", inputs: ["name", "size", "animation", "svgClass"] }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: EllipsisPipe, name: "ellipsis" }, { kind: "pipe", type: PluralizePipe, name: "pluralize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10497
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: FilesUploadErrorsComponent, isStandalone: true, selector: "he-files-upload-errors", inputs: { error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: true, transformFunction: null }, file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: false, transformFunction: null }, debug: { classPropertyName: "debug", publicName: "debug", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (error()) {\n <div class=\"has-text-danger\">\n @switch (message()) {\n @case (ErrorKeys.PrivacyNotAllowed) {\n <div>\n <span>\n Uploading data with\n <code class=\"is-px-1\">dataPrivate={{ error().value }}</code>\n is not allowed.\n </span>\n <span class=\"is-pl-1\">\n Please try uploading with\n <code class=\"is-px-1\">dataPrivate={{ !error().value }}</code>\n instead.\n </span>\n </div>\n }\n @case (ErrorKeys.InvalidJSON) {\n <div>\n <p>The uploaded content does not appear to contain valid JSON data:</p>\n <div class=\"is-mt-2\">\n <pre><code>{{error().error}}</code></pre>\n </div>\n <p>\n Please validate your JSON content before uploading it using an\n <a href=\"https://jsoneditoronline.org\" target=\"_blank\">online tool</a>\n for example.\n </p>\n </div>\n }\n @case (ErrorKeys.NoData) {\n <div class=\"is-mb-2\">\n <p>No Nodes could be found in your Upload. Please verify the column headers match the HESTIA schema.</p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (SchemaErrorKeys.PropertyNotFound) {\n <div class=\"is-mb-2\">\n <div class=\"notification is-danger\" role=\"alert\">\n <p>\n <he-svg-icon name=\"exclamation-triangle\" />\n <span class=\"is-pl-2\">You have column headers that do not match the HESTIA schema.</span>\n <span class=\"px-1\">Please refer to the</span>\n <a [href]=\"schemaUrl()\" target=\"_blank\">schema</a>\n <span class=\"pl-1\">and then correct the column headers indicated below.</span>\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n <div class=\"is-mb-2\">\n <pre><code>{{error().key}}</code></pre>\n </div>\n </div>\n }\n @case (SchemaErrorKeys.PropertyInvalidFormat) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span>\n The following value in the column\n <i>{{ error().key }}</i>\n is not in the correct format:\n </span>\n <br />\n <pre class=\"is-mt-2\"><code>{{stringify(error().value)}}</code></pre>\n </div>\n @switch (hasNumberWithCommasError()) {\n @case (true) {\n <p class=\"is-mt-2\">\n Please format your numbers to remove commas and use a decimal point to separate the whole part of the\n number from the fractional part of the number.\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>3,510.1</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>3510.1</code></pre>\n }\n @case (false) {\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n <p>The error could either be a value in the column, or an error with the column header.</p>\n <p>\n If you are trying to set no data, we accept either\n <code>-</code>\n or an empty cell.\n </p>\n }\n }\n </div>\n }\n @case (ErrorKeys.PropertyRequired) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The following field is required in the</span>\n @if (error().schema) {\n <a class=\"pr-1\" [href]=\"schemaUrl()\" target=\"_blank\">{{ error().schema }}</a>\n }\n <span>schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().property}}</code></pre>\n </div>\n <p>\n @switch (error().property) {\n @case ('id') {\n <span>\n You must assign a unique\n <code>id</code>\n for every record in your data.\n </span>\n }\n @case ('type') {\n <span>\n Every record in your data must contain a\n <code>type</code>\n .\n </span>\n }\n }\n </p>\n </div>\n }\n @case (ErrorKeys.PropertyInternal) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">\n The following field is\n <code>internal</code>\n in the\n </span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schema }} schema</a>\n <span>:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schemaKey || error().key}}</code></pre>\n </div>\n <p>\n You cannot upload\n <code>internal</code>\n fields to HESTIA.\n </p>\n </div>\n }\n @case (SchemaErrorKeys.SchemaNotFound) {\n <div class=\"is-mb-2\">\n @if (error().key) {\n <div class=\"is-mb-2\">\n <span>The following Node does not exist in the schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().key}}</code></pre>\n </div>\n } @else if (error().schema) {\n <div class=\"is-mb-2\">\n <span>The following Node Type does not exist in the schema or can not be uploaded directly:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schema}}</code></pre>\n </div>\n }\n <p>\n <span>The list of accepted values is:</span>\n </p>\n <div class=\"content\">\n <ul>\n @for (type of nodeTypes; track type) {\n <li>\n <i>{{ type }}</i>\n </li>\n }\n </ul>\n </div>\n </div>\n }\n @case (ErrorKeys.InvalidFirstColumn) {\n <div class=\"is-mb-2\">\n <span>\n No data in the HESTIA format was detected on the first sheet. Either try selecting a different sheet in the\n upload screen, or check the sheet to ensure the headers follow the schema - see examples\n </span>\n <a class=\"pl-1\" routerLink=\"/upload\" fragment=\"example\">here</a>\n </div>\n }\n @case (ErrorKeys.InvalidExcelFile) {\n <div class=\"is-mb-2\">\n This file has been uploaded with a\n <code>{{ fileExt() }}</code>\n extension, but does not appear to be a valid Excel file.\n </div>\n }\n @case (ErrorKeys.NoHeaders) {\n <div class=\"is-mb-2\">\n <p>\n No headers matching the HESTIA schema were found on the first row. Please remove all empty rows at the\n begining of the file and try uploading again.\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (ErrorKeys.InvalidSheetName) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The Excel sheet</span>\n <code>{{ error().value }}</code>\n <span class=\"pl-1\">does not exist.</span>\n <span class=\"pl-1\">Your Excel file contains the following sheets:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (e of error().error.split(';'); track e) {\n <li>\n <code>{{ e }}</code>\n </li>\n }\n </ul>\n </div>\n <p>\n <span>Please re-upload selecting one of the sheets above.</span>\n </p>\n </div>\n }\n @case (ErrorKeys.DuplicatedHeaders) {\n <div class=\"is-mb-2\">\n <span>Your upload contains duplicated column headers.</span>\n </div>\n }\n @case (ErrorKeys.DuplicatedIds) {\n <div class=\"is-mb-2\">\n <div>\n <span class=\"is-pr-1\">You have multiple</span>\n <code>{{ error().schema | pluralize }}</code>\n <span class=\"is-px-1\">with the same</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-px-1\">but different data. The</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">is:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().value}}</code></pre>\n </div>\n <p class=\"is-mt-2 is-italic\">\n <span class=\"is-pr-1\">Please note that ussing different case does not make the</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">unique.</span>\n </p>\n </div>\n }\n @case (SchemaErrorKeys.DuplicatedIdFields) {\n <div class=\"is-mb-2\">\n <span class=\"is-pr-1\">You have used both the</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">and</span>\n <code>id</code>\n <span class=\"is-px-1\">fields in the same data. Please use</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">when linking to existing nodes on the Platform, and</span>\n <code>id</code>\n <span class=\"is-px-1\">when linking to nodes you are uploading in this file using the same</span>\n <code>id</code>\n <span class=\"is-px-1\">field.</span>\n </div>\n }\n @case (ErrorKeys.NestedHeaders) {\n <div class=\"is-mb-2\">\n <p>\n To link nodes together, you first need to define the node (e.g.,\n <code>source.id</code>\n ,\n <code>source.bibliography.title</code>\n ) and then create the link (e.g.,\n <code>cycle.defaultSource.id</code>\n ). We do not allow nesting (e.g.,\n <code>cycle.defaultSource.bibliography.title</code>\n ).\n </p>\n </div>\n }\n @case (ErrorKeys.NestedNodes) {\n <div class=\"is-mb-2\">\n <p>To link nodes together, you need to upload each node separately, as we do not allow nesting:</p>\n <pre class=\"is-mt-2\"><code>{{ sampleLinkedNodes | json }}</code></pre>\n </div>\n }\n @case (ErrorKeys.ReferenceExistingHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You have used the internal\n <code>&#64;id</code>\n field to upload a new Node.\n </p>\n <p>\n The\n <code>&#64;id</code>\n field should only be used to reference existing Node or Terms. Example:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.&#64;id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n </div>\n }\n @case (ErrorKeys.MultipleTermHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You are using both\n <code>&#64;id</code>\n (or\n <code>id</code>\n ) and\n <code>name</code>\n fields to upload an existing Node (e.g., a Term).\n </p>\n <p>\n Using both fields can lead to inconsistencies, if you are not uploading the correct value in either one.\n Instead, you should only use one of them:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.inputs.0.term.&#64;id,cycle.inputs.0.term.name</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.inputs.0.term.&#64;id</code></pre>\n </div>\n }\n @case (SchemaErrorKeys.ObjectArrayInvalid) {\n <div class=\"is-mb-2\">\n <p>The column header {{ error().key }} must use the array format. Examples:</p>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.value' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.value' }}</code></pre>\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n </div>\n }\n @case (ErrorKeys.MaxSize) {\n <div class=\"is-mb-2\">\n <span>The maximum file size limit is {{ maxFileSizeMb }}Mb (current file size: {{ error().value }}Mb).</span>\n <span class=\"pl-1\">Please re-upload these data in multiple files.</span>\n </div>\n }\n @case (ErrorKeys.MaxRows) {\n <div class=\"is-mb-2\">\n <span>\n Your file has {{ error().value | number }} rows. This might be an error caused by adding some data at the\n bottom of a spreadsheet by accident: delete any unused rows and resubmit the file.\n </span>\n </div>\n }\n @case (ErrorKeys.Mendeley) {\n <div class=\"is-mb-2\">\n <p>An error occured while fetching the bibliographic information. Please try re-uploading the file.</p>\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @case (ErrorKeys.Timeout) {\n <div class=\"is-mb-2\">\n <p>Time exceeded for current step.</p>\n\n @if (debug()) {\n <span>You can try to \"Re-index\" or \"Re-upload\" if it still does not work.</span>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @default {\n <div class=\"is-mb-2\">\n <p>{{ message() }}</p>\n\n @if (debug()) {\n <pre><code>{{ error() | json }}</code></pre>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n }\n\n @if (hasGeoJSONError()) {\n <div class=\"is-mb-2\">\n <p>If the GeoJSON is too large, please try to simplify it following these steps:</p>\n <ul class=\"is-my-1 content is-list-style-decimal pl-5\">\n <li>\n <span class=\"is-pr-1\">Go to</span>\n <a href=\"https://mapshaper.org/\" target=\"_blank\">https://mapshaper.org/</a>\n </li>\n <li>\n <span>\n Save the boundary in a valid\n <code>.geojson</code>\n file.\n </span>\n </li>\n <li>\n <span>Import it on mapshaper.</span>\n </li>\n <li>\n <span>Click \"Simplify\" in the top right corner in the menu bar.</span>\n </li>\n <li>\n <span>Adjust the percentage to a lower value, like 50% to start with.</span>\n </li>\n <li>\n <span>\n Export to\n <code>GeoJson</code>\n or\n <code>CSV</code>\n .\n </span>\n </li>\n <li>\n <span>Copy the resulting content into your upload file.</span>\n </li>\n </ul>\n <p>If you encounter the error again, try again using a lower percentage at step 5.</p>\n </div>\n }\n\n @if (columns().length || (error().index && !isSchemaError())) {\n <div class=\"my-3\">\n <b>Hint:</b>\n <span class=\"pl-1\">the error might be located</span>\n @if (error().index && !isSchemaError()) {\n <span class=\"pl-1\">on row {{ error().index }}</span>\n }\n @if (columns().length) {\n <span class=\"pl-1\">in {{ 'column' | pluralize: columns().length }}:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (column of columns(); track column) {\n <li>\n <b class=\"pr-2\">{{ column.column }}</b>\n <code>{{ column.name }}</code>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (error().suggestions?.length) {\n <div class=\"my-3\">\n <b>Suggestions:</b>\n <span class=\"pl-1\">did you mean instead:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (suggestion of error().suggestions; track suggestion) {\n <li>\n <code>{{ suggestion }}</code>\n </li>\n }\n </ul>\n </div>\n }\n\n @if (showCsvPreview()) {\n <div class=\"is-my-2\">\n <b>\n Preview\n <sup>1</sup>\n :\n </b>\n <div class=\"table-container is-mt-2\">\n <table class=\"table is-bordered is-fullwidth is-hoverable is-narrow mb-0\">\n <thead>\n @if (error().index) {\n <th></th>\n }\n @for (header of headers(); track header) {\n <th>{{ header }}</th>\n }\n </thead>\n <tbody>\n @for (row of rows(); track row) {\n <tr>\n @if (error().index) {\n <td class=\"has-text-danger\">\n <span class=\"is-nowrap\">Row {{ error().index }}</span>\n </td>\n }\n @for (col of row; track col; let colIndex = $index) {\n <td>\n <span\n [class.has-text-danger]=\"\n message() === ErrorKeys.DuplicatedIds && hasDuplicatedError(col, colIndex)\n \">\n {{ col | ellipsis: 50 }}\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <p class=\"is-size-7\">\n <i>1. The preview does not necessarily reflect the original Upload's order or content.</i>\n </p>\n </div>\n }\n\n @if (showJsonPreview()) {\n <div class=\"is-my-2\">\n <b>Preview:</b>\n <pre class=\"is-mt-2\"><code>{{stringify(error().node)}}</code></pre>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultError>\n <p class=\"is-mt-2 has-text-black\">\n <span class=\"is-pr-1\">If you are still stuck, please see</span>\n <a [href]=\"baseUrl + '/upload#example'\" target=\"_blank\">the example uploads and videos</a>\n <span class=\"is-px-1\">\n or try using the Wizard to get the first few rows of data formatted correctly, or use the chat to ask for help.\n </span>\n </p>\n</ng-template>\n\n<ng-template #reportError>\n <p class=\"is-mt-2\">\n To report this error, please\n <a class=\"is-pl-1\" [href]=\"reportErrorUrl()\" target=\"_blank\">click here</a>\n .\n </p>\n</ng-template>\n\n<ng-template #schemaError>\n <p>\n <span class=\"pr-1\">You can see the accepted field type and some examples</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">here</a>\n <span>.</span>\n </p>\n</ng-template>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: HESvgIconComponent, selector: "he-svg-icon", inputs: ["name", "size", "animation", "svgClass"] }, { kind: "pipe", type: DecimalPipe, name: "number" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: EllipsisPipe, name: "ellipsis" }, { kind: "pipe", type: PluralizePipe, name: "pluralize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10497
10498
  }
10498
10499
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: FilesUploadErrorsComponent, decorators: [{
10499
10500
  type: Component$1,
10500
- args: [{ selector: 'he-files-upload-errors', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, HESvgIconComponent, DecimalPipe, JsonPipe, EllipsisPipe, PluralizePipe], template: "@if (error()) {\n <div class=\"has-text-danger\">\n @switch (message()) {\n @case (ErrorKeys.PrivacyNotAllowed) {\n <div>\n <span>\n Uploading data with\n <code class=\"is-px-1\">dataPrivate={{ error().value }}</code>\n is not allowed.\n </span>\n <span class=\"is-pl-1\">\n Please try uploading with\n <code class=\"is-px-1\">dataPrivate={{ !error().value }}</code>\n instead.\n </span>\n </div>\n }\n @case (ErrorKeys.InvalidJSON) {\n <div>\n <p>The uploaded content does not appear to contain valid JSON data:</p>\n <div class=\"is-mt-2\">\n <pre><code>{{error().error}}</code></pre>\n </div>\n <p>\n Please validate your JSON content before uploading it using an\n <a href=\"https://jsoneditoronline.org\" target=\"_blank\">online tool</a>\n for example.\n </p>\n </div>\n }\n @case (ErrorKeys.NoData) {\n <div class=\"is-mb-2\">\n <p>No Nodes could be found in your Upload. Please verify the column headers match the HESTIA schema.</p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (SchemaErrorKeys.PropertyNotFound) {\n <div class=\"is-mb-2\">\n <div class=\"notification is-danger\" role=\"alert\">\n <p>\n <he-svg-icon name=\"exclamation-triangle\" />\n <span class=\"is-pl-2\">You have column headers that do not match the HESTIA schema.</span>\n <span class=\"px-1\">Please refer to the</span>\n <a [href]=\"schemaUrl()\" target=\"_blank\">schema</a>\n <span class=\"pl-1\">and then correct the column headers indicated below.</span>\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n <div class=\"is-mb-2\">\n <pre><code>{{error().key}}</code></pre>\n </div>\n </div>\n }\n @case (SchemaErrorKeys.PropertyInvalidFormat) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span>\n The following value in the column\n <i>{{ error().key }}</i>\n is not in the correct format:\n </span>\n <br />\n <pre class=\"is-mt-2\"><code>{{stringify(error().value)}}</code></pre>\n </div>\n @switch (hasNumberWithCommasError()) {\n @case (true) {\n <p class=\"is-mt-2\">\n Please format your numbers to remove commas and use a decimal point to separate the whole part of the\n number from the fractional part of the number.\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>3,510.1</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>3510.1</code></pre>\n }\n @case (false) {\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n <p>The error could either be a value in the column, or an error with the column header.</p>\n <p>\n If you are trying to set no data, we accept either\n <code>-</code>\n or an empty cell.\n </p>\n }\n }\n </div>\n }\n @case (ErrorKeys.PropertyRequired) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The following field is required in the</span>\n @if (error().schema) {\n <a class=\"pr-1\" [href]=\"schemaUrl()\" target=\"_blank\">{{ error().schema }}</a>\n }\n <span>schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().property}}</code></pre>\n </div>\n <p>\n @switch (error().property) {\n @case ('id') {\n <span>\n You must assign a unique\n <code>id</code>\n for every record in your data.\n </span>\n }\n @case ('type') {\n <span>\n Every record in your data must contain a\n <code>type</code>\n .\n </span>\n }\n }\n </p>\n </div>\n }\n @case (ErrorKeys.PropertyInternal) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">\n The following field is\n <code>internal</code>\n in the\n </span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schema }} schema</a>\n <span>:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schemaKey || error().key}}</code></pre>\n </div>\n <p>\n You cannot upload\n <code>internal</code>\n fields to HESTIA.\n </p>\n </div>\n }\n @case (SchemaErrorKeys.SchemaNotFound) {\n <div class=\"is-mb-2\">\n @if (error().key) {\n <div class=\"is-mb-2\">\n <span>The following Node does not exist in the schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().key}}</code></pre>\n </div>\n } @else if (error().schema) {\n <div class=\"is-mb-2\">\n <span>The following Node Type does not exist in the schema or can not be uploaded directly:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schema}}</code></pre>\n </div>\n }\n <p>\n <span>The list of accepted values is:</span>\n </p>\n <div class=\"content\">\n <ul>\n @for (type of nodeTypes; track type) {\n <li>\n <i>{{ type }}</i>\n </li>\n }\n </ul>\n </div>\n </div>\n }\n @case (ErrorKeys.InvalidFirstColumn) {\n <div class=\"is-mb-2\">\n <span>\n No data in the HESTIA format was detected on the first sheet. Either try selecting a different sheet in the\n upload screen, or check the sheet to ensure the headers follow the schema - see examples\n </span>\n <a class=\"pl-1\" routerLink=\"/upload\" fragment=\"example\">here</a>\n </div>\n }\n @case (ErrorKeys.InvalidExcelFile) {\n <div class=\"is-mb-2\">\n This file has been uploaded with a\n <code>{{ fileExt() }}</code>\n extension, but does not appear to be a valid Excel file.\n </div>\n }\n @case (ErrorKeys.NoHeaders) {\n <div class=\"is-mb-2\">\n <p>\n No headers matching the HESTIA schema were found on the first row. Please remove all empty rows at the\n begining of the file and try uploading again.\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (ErrorKeys.InvalidSheetName) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The Excel sheet</span>\n <code>{{ error().value }}</code>\n <span class=\"pl-1\">does not exist.</span>\n <span class=\"pl-1\">Your Excel file contains the following sheets:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (e of error().error.split(';'); track e) {\n <li>\n <code>{{ e }}</code>\n </li>\n }\n </ul>\n </div>\n <p>\n <span>Please re-upload selecting one of the sheets above.</span>\n </p>\n </div>\n }\n @case (ErrorKeys.DuplicatedHeaders) {\n <div class=\"is-mb-2\">\n <span>Your upload contains duplicated column headers.</span>\n </div>\n }\n @case (ErrorKeys.DuplicatedIds) {\n <div class=\"is-mb-2\">\n <div>\n <span class=\"is-pr-1\">You have multiple</span>\n <code>{{ error().schema | pluralize }}</code>\n <span class=\"is-px-1\">with the same</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-px-1\">but different data. The</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">is:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().value}}</code></pre>\n </div>\n <p class=\"is-mt-2 is-italic\">\n <span class=\"is-pr-1\">Please note that ussing different case does not make the</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">unique.</span>\n </p>\n </div>\n }\n @case (SchemaErrorKeys.DuplicatedIdFields) {\n <div class=\"is-mb-2\">\n <span class=\"is-pr-1\">You have used both the</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">and</span>\n <code>id</code>\n <span class=\"is-px-1\">fields in the same data. Please use</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">when linking to existing nodes on the Platform, and</span>\n <code>id</code>\n <span class=\"is-px-1\">when linking to nodes you are uploading in this file using the same</span>\n <code>id</code>\n <span class=\"is-px-1\">field.</span>\n </div>\n }\n @case (ErrorKeys.NestedHeaders) {\n <div class=\"is-mb-2\">\n <p>\n To link nodes together, you first need to define the node (e.g.,\n <code>source.id</code>\n ,\n <code>source.bibliography.title</code>\n ) and then create the link (e.g.,\n <code>cycle.defaultSource.id</code>\n ). We do not allow nesting (e.g.,\n <code>cycle.defaultSource.bibliography.title</code>\n ).\n </p>\n </div>\n }\n @case (ErrorKeys.NestedNodes) {\n <div class=\"is-mb-2\">\n <p>To link nodes together, you need to upload each node separately, as we do not allow nesting:</p>\n <pre class=\"is-mt-2\"><code>{{ sampleLinkedNodes | json }}</code></pre>\n </div>\n }\n @case (ErrorKeys.ReferenceExistingHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You have used the internal\n <code>&#64;id</code>\n field to upload a new Node.\n </p>\n <p>\n The\n <code>&#64;id</code>\n field should only be used to reference existing Node or Terms. Example:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.&#64;id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n </div>\n }\n @case (SchemaErrorKeys.ObjectArrayInvalid) {\n <div class=\"is-mb-2\">\n <p>The column header {{ error().key }} must use the array format. Examples:</p>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.value' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.value' }}</code></pre>\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n </div>\n }\n @case (ErrorKeys.MaxSize) {\n <div class=\"is-mb-2\">\n <span>The maximum file size limit is {{ maxFileSizeMb }}Mb (current file size: {{ error().value }}Mb).</span>\n <span class=\"pl-1\">Please re-upload these data in multiple files.</span>\n </div>\n }\n @case (ErrorKeys.MaxRows) {\n <div class=\"is-mb-2\">\n <span>\n Your file has {{ error().value | number }} rows. This might be an error caused by adding some data at the\n bottom of a spreadsheet by accident: delete any unused rows and resubmit the file.\n </span>\n </div>\n }\n @case (ErrorKeys.Mendeley) {\n <div class=\"is-mb-2\">\n <p>An error occured while fetching the bibliographic information. Please try re-uploading the file.</p>\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @case (ErrorKeys.Timeout) {\n <div class=\"is-mb-2\">\n <p>Time exceeded for current step.</p>\n\n @if (debug()) {\n <span>You can try to \"Re-index\" or \"Re-upload\" if it still does not work.</span>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @default {\n <div class=\"is-mb-2\">\n <p>{{ message() }}</p>\n\n @if (debug()) {\n <pre><code>{{ error() | json }}</code></pre>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n }\n\n @if (hasGeoJSONError()) {\n <div class=\"is-mb-2\">\n <p>If the GeoJSON is too large, please try to simplify it following these steps:</p>\n <ul class=\"is-my-1 content is-list-style-decimal pl-5\">\n <li>\n <span class=\"is-pr-1\">Go to</span>\n <a href=\"https://mapshaper.org/\" target=\"_blank\">https://mapshaper.org/</a>\n </li>\n <li>\n <span>\n Save the boundary in a valid\n <code>.geojson</code>\n file.\n </span>\n </li>\n <li>\n <span>Import it on mapshaper.</span>\n </li>\n <li>\n <span>Click \"Simplify\" in the top right corner in the menu bar.</span>\n </li>\n <li>\n <span>Adjust the percentage to a lower value, like 50% to start with.</span>\n </li>\n <li>\n <span>\n Export to\n <code>GeoJson</code>\n or\n <code>CSV</code>\n .\n </span>\n </li>\n <li>\n <span>Copy the resulting content into your upload file.</span>\n </li>\n </ul>\n <p>If you encounter the error again, try again using a lower percentage at step 5.</p>\n </div>\n }\n\n @if (columns().length || (error().index && !isSchemaError())) {\n <div class=\"my-3\">\n <b>Hint:</b>\n <span class=\"pl-1\">the error might be located</span>\n @if (error().index && !isSchemaError()) {\n <span class=\"pl-1\">on row {{ error().index }}</span>\n }\n @if (columns().length) {\n <span class=\"pl-1\">in {{ 'column' | pluralize: columns().length }}:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (column of columns(); track column) {\n <li>\n <b class=\"pr-2\">{{ column.column }}</b>\n <code>{{ column.name }}</code>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (error().suggestions?.length) {\n <div class=\"my-3\">\n <b>Suggestions:</b>\n <span class=\"pl-1\">did you mean instead:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (suggestion of error().suggestions; track suggestion) {\n <li>\n <code>{{ suggestion }}</code>\n </li>\n }\n </ul>\n </div>\n }\n\n @if (showCsvPreview()) {\n <div class=\"is-my-2\">\n <b>\n Preview\n <sup>1</sup>\n :\n </b>\n <div class=\"table-container is-mt-2\">\n <table class=\"table is-bordered is-fullwidth is-hoverable is-narrow mb-0\">\n <thead>\n @if (error().index) {\n <th></th>\n }\n @for (header of headers(); track header) {\n <th>{{ header }}</th>\n }\n </thead>\n <tbody>\n @for (row of rows(); track row) {\n <tr>\n @if (error().index) {\n <td class=\"has-text-danger\">\n <span class=\"is-nowrap\">Row {{ error().index }}</span>\n </td>\n }\n @for (col of row; track col; let colIndex = $index) {\n <td>\n <span\n [class.has-text-danger]=\"\n message() === ErrorKeys.DuplicatedIds && hasDuplicatedError(col, colIndex)\n \">\n {{ col | ellipsis: 50 }}\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <p class=\"is-size-7\">\n <i>1. The preview does not necessarily reflect the original Upload's order or content.</i>\n </p>\n </div>\n }\n\n @if (showJsonPreview()) {\n <div class=\"is-my-2\">\n <b>Preview:</b>\n <pre class=\"is-mt-2\"><code>{{stringify(error().node)}}</code></pre>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultError>\n <p class=\"is-mt-2 has-text-black\">\n <span class=\"is-pr-1\">If you are still stuck, please see</span>\n <a [href]=\"baseUrl + '/upload#example'\" target=\"_blank\">the example uploads and videos</a>\n <span class=\"is-px-1\">\n or try using the Wizard to get the first few rows of data formatted correctly, or use the chat to ask for help.\n </span>\n </p>\n</ng-template>\n\n<ng-template #reportError>\n <p class=\"is-mt-2\">\n To report this error, please\n <a class=\"is-pl-1\" [href]=\"reportErrorUrl()\" target=\"_blank\">click here</a>\n .\n </p>\n</ng-template>\n\n<ng-template #schemaError>\n <p>\n <span class=\"pr-1\">You can see the accepted field type and some examples</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">here</a>\n <span>.</span>\n </p>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
10501
+ args: [{ selector: 'he-files-upload-errors', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgTemplateOutlet, HESvgIconComponent, DecimalPipe, JsonPipe, EllipsisPipe, PluralizePipe], template: "@if (error()) {\n <div class=\"has-text-danger\">\n @switch (message()) {\n @case (ErrorKeys.PrivacyNotAllowed) {\n <div>\n <span>\n Uploading data with\n <code class=\"is-px-1\">dataPrivate={{ error().value }}</code>\n is not allowed.\n </span>\n <span class=\"is-pl-1\">\n Please try uploading with\n <code class=\"is-px-1\">dataPrivate={{ !error().value }}</code>\n instead.\n </span>\n </div>\n }\n @case (ErrorKeys.InvalidJSON) {\n <div>\n <p>The uploaded content does not appear to contain valid JSON data:</p>\n <div class=\"is-mt-2\">\n <pre><code>{{error().error}}</code></pre>\n </div>\n <p>\n Please validate your JSON content before uploading it using an\n <a href=\"https://jsoneditoronline.org\" target=\"_blank\">online tool</a>\n for example.\n </p>\n </div>\n }\n @case (ErrorKeys.NoData) {\n <div class=\"is-mb-2\">\n <p>No Nodes could be found in your Upload. Please verify the column headers match the HESTIA schema.</p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (SchemaErrorKeys.PropertyNotFound) {\n <div class=\"is-mb-2\">\n <div class=\"notification is-danger\" role=\"alert\">\n <p>\n <he-svg-icon name=\"exclamation-triangle\" />\n <span class=\"is-pl-2\">You have column headers that do not match the HESTIA schema.</span>\n <span class=\"px-1\">Please refer to the</span>\n <a [href]=\"schemaUrl()\" target=\"_blank\">schema</a>\n <span class=\"pl-1\">and then correct the column headers indicated below.</span>\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n <div class=\"is-mb-2\">\n <pre><code>{{error().key}}</code></pre>\n </div>\n </div>\n }\n @case (SchemaErrorKeys.PropertyInvalidFormat) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span>\n The following value in the column\n <i>{{ error().key }}</i>\n is not in the correct format:\n </span>\n <br />\n <pre class=\"is-mt-2\"><code>{{stringify(error().value)}}</code></pre>\n </div>\n @switch (hasNumberWithCommasError()) {\n @case (true) {\n <p class=\"is-mt-2\">\n Please format your numbers to remove commas and use a decimal point to separate the whole part of the\n number from the fractional part of the number.\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>3,510.1</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>3510.1</code></pre>\n }\n @case (false) {\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n <p>The error could either be a value in the column, or an error with the column header.</p>\n <p>\n If you are trying to set no data, we accept either\n <code>-</code>\n or an empty cell.\n </p>\n }\n }\n </div>\n }\n @case (ErrorKeys.PropertyRequired) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The following field is required in the</span>\n @if (error().schema) {\n <a class=\"pr-1\" [href]=\"schemaUrl()\" target=\"_blank\">{{ error().schema }}</a>\n }\n <span>schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().property}}</code></pre>\n </div>\n <p>\n @switch (error().property) {\n @case ('id') {\n <span>\n You must assign a unique\n <code>id</code>\n for every record in your data.\n </span>\n }\n @case ('type') {\n <span>\n Every record in your data must contain a\n <code>type</code>\n .\n </span>\n }\n }\n </p>\n </div>\n }\n @case (ErrorKeys.PropertyInternal) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">\n The following field is\n <code>internal</code>\n in the\n </span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schema }} schema</a>\n <span>:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schemaKey || error().key}}</code></pre>\n </div>\n <p>\n You cannot upload\n <code>internal</code>\n fields to HESTIA.\n </p>\n </div>\n }\n @case (SchemaErrorKeys.SchemaNotFound) {\n <div class=\"is-mb-2\">\n @if (error().key) {\n <div class=\"is-mb-2\">\n <span>The following Node does not exist in the schema:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().key}}</code></pre>\n </div>\n } @else if (error().schema) {\n <div class=\"is-mb-2\">\n <span>The following Node Type does not exist in the schema or can not be uploaded directly:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().schema}}</code></pre>\n </div>\n }\n <p>\n <span>The list of accepted values is:</span>\n </p>\n <div class=\"content\">\n <ul>\n @for (type of nodeTypes; track type) {\n <li>\n <i>{{ type }}</i>\n </li>\n }\n </ul>\n </div>\n </div>\n }\n @case (ErrorKeys.InvalidFirstColumn) {\n <div class=\"is-mb-2\">\n <span>\n No data in the HESTIA format was detected on the first sheet. Either try selecting a different sheet in the\n upload screen, or check the sheet to ensure the headers follow the schema - see examples\n </span>\n <a class=\"pl-1\" routerLink=\"/upload\" fragment=\"example\">here</a>\n </div>\n }\n @case (ErrorKeys.InvalidExcelFile) {\n <div class=\"is-mb-2\">\n This file has been uploaded with a\n <code>{{ fileExt() }}</code>\n extension, but does not appear to be a valid Excel file.\n </div>\n }\n @case (ErrorKeys.NoHeaders) {\n <div class=\"is-mb-2\">\n <p>\n No headers matching the HESTIA schema were found on the first row. Please remove all empty rows at the\n begining of the file and try uploading again.\n </p>\n <ng-container *ngTemplateOutlet=\"defaultError\" />\n </div>\n }\n @case (ErrorKeys.InvalidSheetName) {\n <div class=\"is-mb-2\">\n <div class=\"is-mb-2\">\n <span class=\"pr-1\">The Excel sheet</span>\n <code>{{ error().value }}</code>\n <span class=\"pl-1\">does not exist.</span>\n <span class=\"pl-1\">Your Excel file contains the following sheets:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (e of error().error.split(';'); track e) {\n <li>\n <code>{{ e }}</code>\n </li>\n }\n </ul>\n </div>\n <p>\n <span>Please re-upload selecting one of the sheets above.</span>\n </p>\n </div>\n }\n @case (ErrorKeys.DuplicatedHeaders) {\n <div class=\"is-mb-2\">\n <span>Your upload contains duplicated column headers.</span>\n </div>\n }\n @case (ErrorKeys.DuplicatedIds) {\n <div class=\"is-mb-2\">\n <div>\n <span class=\"is-pr-1\">You have multiple</span>\n <code>{{ error().schema | pluralize }}</code>\n <span class=\"is-px-1\">with the same</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-px-1\">but different data. The</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">is:</span>\n <br />\n <pre class=\"is-mt-2\"><code>{{error().value}}</code></pre>\n </div>\n <p class=\"is-mt-2 is-italic\">\n <span class=\"is-pr-1\">Please note that ussing different case does not make the</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">{{ error().schemaKey }}</a>\n <span class=\"is-pl-1\">unique.</span>\n </p>\n </div>\n }\n @case (SchemaErrorKeys.DuplicatedIdFields) {\n <div class=\"is-mb-2\">\n <span class=\"is-pr-1\">You have used both the</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">and</span>\n <code>id</code>\n <span class=\"is-px-1\">fields in the same data. Please use</span>\n <code>&#64;id</code>\n <span class=\"is-px-1\">when linking to existing nodes on the Platform, and</span>\n <code>id</code>\n <span class=\"is-px-1\">when linking to nodes you are uploading in this file using the same</span>\n <code>id</code>\n <span class=\"is-px-1\">field.</span>\n </div>\n }\n @case (ErrorKeys.NestedHeaders) {\n <div class=\"is-mb-2\">\n <p>\n To link nodes together, you first need to define the node (e.g.,\n <code>source.id</code>\n ,\n <code>source.bibliography.title</code>\n ) and then create the link (e.g.,\n <code>cycle.defaultSource.id</code>\n ). We do not allow nesting (e.g.,\n <code>cycle.defaultSource.bibliography.title</code>\n ).\n </p>\n </div>\n }\n @case (ErrorKeys.NestedNodes) {\n <div class=\"is-mb-2\">\n <p>To link nodes together, you need to upload each node separately, as we do not allow nesting:</p>\n <pre class=\"is-mt-2\"><code>{{ sampleLinkedNodes | json }}</code></pre>\n </div>\n }\n @case (ErrorKeys.ReferenceExistingHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You have used the internal\n <code>&#64;id</code>\n field to upload a new Node.\n </p>\n <p>\n The\n <code>&#64;id</code>\n field should only be used to reference existing Node or Terms. Example:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.&#64;id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.id,cycle.inputs.0.term.&#64;id,source.id</code></pre>\n </div>\n }\n @case (ErrorKeys.MultipleTermHeaders) {\n <div class=\"is-mb-2\">\n <p>\n You are using both\n <code>&#64;id</code>\n (or\n <code>id</code>\n ) and\n <code>name</code>\n fields to upload an existing Node (e.g., a Term).\n </p>\n <p>\n Using both fields can lead to inconsistencies, if you are not uploading the correct value in either one.\n Instead, you should only use one of them:\n </p>\n <p class=\"is-mt-2 has-text-danger has-text-underline\">Incorrect:</p>\n <pre class=\"is-mt-2\"><code>cycle.inputs.0.term.&#64;id,cycle.inputs.0.term.name</code></pre>\n <p class=\"is-mt-2 has-text-success has-text-underline\">Correct:</p>\n <pre class=\"is-mt-2\"><code>cycle.inputs.0.term.&#64;id</code></pre>\n </div>\n }\n @case (SchemaErrorKeys.ObjectArrayInvalid) {\n <div class=\"is-mb-2\">\n <p>The column header {{ error().key }} must use the array format. Examples:</p>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.0.value' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.term.name' }}</code></pre>\n <pre class=\"is-mt-2\"><code>{{ error().key + '.1.value' }}</code></pre>\n <ng-container *ngTemplateOutlet=\"schemaError\" />\n </div>\n }\n @case (ErrorKeys.MaxSize) {\n <div class=\"is-mb-2\">\n <span>The maximum file size limit is {{ maxFileSizeMb }}Mb (current file size: {{ error().value }}Mb).</span>\n <span class=\"pl-1\">Please re-upload these data in multiple files.</span>\n </div>\n }\n @case (ErrorKeys.MaxRows) {\n <div class=\"is-mb-2\">\n <span>\n Your file has {{ error().value | number }} rows. This might be an error caused by adding some data at the\n bottom of a spreadsheet by accident: delete any unused rows and resubmit the file.\n </span>\n </div>\n }\n @case (ErrorKeys.Mendeley) {\n <div class=\"is-mb-2\">\n <p>An error occured while fetching the bibliographic information. Please try re-uploading the file.</p>\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @case (ErrorKeys.Timeout) {\n <div class=\"is-mb-2\">\n <p>Time exceeded for current step.</p>\n\n @if (debug()) {\n <span>You can try to \"Re-index\" or \"Re-upload\" if it still does not work.</span>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n @default {\n <div class=\"is-mb-2\">\n <p>{{ message() }}</p>\n\n @if (debug()) {\n <pre><code>{{ error() | json }}</code></pre>\n }\n\n <ng-container *ngTemplateOutlet=\"reportError\" />\n </div>\n }\n }\n\n @if (hasGeoJSONError()) {\n <div class=\"is-mb-2\">\n <p>If the GeoJSON is too large, please try to simplify it following these steps:</p>\n <ul class=\"is-my-1 content is-list-style-decimal pl-5\">\n <li>\n <span class=\"is-pr-1\">Go to</span>\n <a href=\"https://mapshaper.org/\" target=\"_blank\">https://mapshaper.org/</a>\n </li>\n <li>\n <span>\n Save the boundary in a valid\n <code>.geojson</code>\n file.\n </span>\n </li>\n <li>\n <span>Import it on mapshaper.</span>\n </li>\n <li>\n <span>Click \"Simplify\" in the top right corner in the menu bar.</span>\n </li>\n <li>\n <span>Adjust the percentage to a lower value, like 50% to start with.</span>\n </li>\n <li>\n <span>\n Export to\n <code>GeoJson</code>\n or\n <code>CSV</code>\n .\n </span>\n </li>\n <li>\n <span>Copy the resulting content into your upload file.</span>\n </li>\n </ul>\n <p>If you encounter the error again, try again using a lower percentage at step 5.</p>\n </div>\n }\n\n @if (columns().length || (error().index && !isSchemaError())) {\n <div class=\"my-3\">\n <b>Hint:</b>\n <span class=\"pl-1\">the error might be located</span>\n @if (error().index && !isSchemaError()) {\n <span class=\"pl-1\">on row {{ error().index }}</span>\n }\n @if (columns().length) {\n <span class=\"pl-1\">in {{ 'column' | pluralize: columns().length }}:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (column of columns(); track column) {\n <li>\n <b class=\"pr-2\">{{ column.column }}</b>\n <code>{{ column.name }}</code>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (error().suggestions?.length) {\n <div class=\"my-3\">\n <b>Suggestions:</b>\n <span class=\"pl-1\">did you mean instead:</span>\n <ul class=\"mt-1 content is-list-style-disc pl-5\">\n @for (suggestion of error().suggestions; track suggestion) {\n <li>\n <code>{{ suggestion }}</code>\n </li>\n }\n </ul>\n </div>\n }\n\n @if (showCsvPreview()) {\n <div class=\"is-my-2\">\n <b>\n Preview\n <sup>1</sup>\n :\n </b>\n <div class=\"table-container is-mt-2\">\n <table class=\"table is-bordered is-fullwidth is-hoverable is-narrow mb-0\">\n <thead>\n @if (error().index) {\n <th></th>\n }\n @for (header of headers(); track header) {\n <th>{{ header }}</th>\n }\n </thead>\n <tbody>\n @for (row of rows(); track row) {\n <tr>\n @if (error().index) {\n <td class=\"has-text-danger\">\n <span class=\"is-nowrap\">Row {{ error().index }}</span>\n </td>\n }\n @for (col of row; track col; let colIndex = $index) {\n <td>\n <span\n [class.has-text-danger]=\"\n message() === ErrorKeys.DuplicatedIds && hasDuplicatedError(col, colIndex)\n \">\n {{ col | ellipsis: 50 }}\n </span>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <p class=\"is-size-7\">\n <i>1. The preview does not necessarily reflect the original Upload's order or content.</i>\n </p>\n </div>\n }\n\n @if (showJsonPreview()) {\n <div class=\"is-my-2\">\n <b>Preview:</b>\n <pre class=\"is-mt-2\"><code>{{stringify(error().node)}}</code></pre>\n </div>\n }\n </div>\n}\n\n<ng-template #defaultError>\n <p class=\"is-mt-2 has-text-black\">\n <span class=\"is-pr-1\">If you are still stuck, please see</span>\n <a [href]=\"baseUrl + '/upload#example'\" target=\"_blank\">the example uploads and videos</a>\n <span class=\"is-px-1\">\n or try using the Wizard to get the first few rows of data formatted correctly, or use the chat to ask for help.\n </span>\n </p>\n</ng-template>\n\n<ng-template #reportError>\n <p class=\"is-mt-2\">\n To report this error, please\n <a class=\"is-pl-1\" [href]=\"reportErrorUrl()\" target=\"_blank\">click here</a>\n .\n </p>\n</ng-template>\n\n<ng-template #schemaError>\n <p>\n <span class=\"pr-1\">You can see the accepted field type and some examples</span>\n <a [href]=\"schemaKeyUrl()\" target=\"_blank\">here</a>\n <span>.</span>\n </p>\n</ng-template>\n", styles: [":host{display:block}\n"] }]
10501
10502
  }], ctorParameters: () => [] });
10502
10503
 
10503
10504
  const nodeTerm = (node, key) => {
@@ -12802,17 +12803,29 @@ const sortedPoints = (values) => Object.entries(values)
12802
12803
  .sort((a, b) => new Date(a.x).getTime() - new Date(b.x).getTime());
12803
12804
  class SitesManagementChartComponent {
12804
12805
  constructor() {
12806
+ this.nodeService = inject(HeNodeService);
12805
12807
  this.site = input.required();
12806
12808
  this.management = computed(() => this.site().management ?? []);
12809
+ this.propertyLookupsResource = rxResource({
12810
+ loader: () => this.nodeService.downloadRaw$(lookupUrl(TermTermType.property).replace('.csv', '.json'))
12811
+ });
12812
+ this.propertyToGroup = computed(() => Object.fromEntries((this.propertyLookupsResource.value() ?? []).map(value => [value['term.id'], value.blankNodesGroup])));
12813
+ this.propertyGroups = computed(() => unique(Object.values(this.propertyToGroup()).flat()));
12807
12814
  this.managementPerTermType = computed(() => this.management()
12808
12815
  .filter(({ value }) => typeof value === 'number' && isNumber(value))
12809
- .reduce((prev, curr) => ({
12810
- ...prev,
12811
- [curr.term.termType]: [...(prev[curr.term.termType] || []), curr]
12812
- }), {}));
12813
- this.termTypes = computed(() => Object.keys(this.managementPerTermType()).sort());
12816
+ .reduce((prev, curr) => {
12817
+ const blankNodesGroup = curr.properties?.map(p => this.propertyToGroup()[p.term['@id']])?.filter(Boolean)?.[0] || null;
12818
+ prev[curr.term.termType] = prev[curr.term.termType] || {};
12819
+ prev[curr.term.termType][blankNodesGroup] = [...(prev[curr.term.termType][blankNodesGroup] || []), curr];
12820
+ return prev;
12821
+ }, {}));
12822
+ this.termTypes = computed(() => Object.entries(this.managementPerTermType()).flatMap(([termType, values]) => Object.keys(values).map(blankNodesGroup => ({
12823
+ termType,
12824
+ blankNodesGroup
12825
+ }))));
12814
12826
  this.selectedTermType = signal(undefined);
12815
- this.selectedManagement = computed(() => this.managementPerTermType()?.[this.selectedTermType()] ?? []);
12827
+ this.selectedManagement = computed(() => this.managementPerTermType()?.[this.selectedTermType()?.termType]?.[this.selectedTermType()?.blankNodesGroup] ??
12828
+ []);
12816
12829
  this.dates = computed(() => this.selectedManagement()
12817
12830
  .flatMap(({ startDate, endDate }) => [formatDate(startDate, true), formatDate(endDate, false)])
12818
12831
  .filter(Boolean));
@@ -12876,12 +12889,17 @@ class SitesManagementChartComponent {
12876
12889
  }
12877
12890
  });
12878
12891
  }
12892
+ selectTermType(value) {
12893
+ const [termType, blankNodesGroup] = value.split(' - ');
12894
+ const selected = this.termTypes().find(v => keyToLabel(v.termType) === termType && v.blankNodesGroup === (blankNodesGroup || 'null'));
12895
+ this.selectedTermType.set(selected);
12896
+ }
12879
12897
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SitesManagementChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12880
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: SitesManagementChartComponent, isStandalone: true, selector: "he-sites-management-chart", inputs: { site: { classPropertyName: "site", publicName: "site", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"p-3\">\n @if (termTypes().length > 1) {\n <div class=\"field has-addons pt-2 px-3\">\n <div class=\"control\">\n <span class=\"button is-small is-static is-secondary\">Select a Term Type</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth is-secondary\">\n <select (change)=\"selectedTermType.set($event.target.value)\">\n @for (termType of termTypes(); track termType) {\n <option [value]=\"termType\">{{ termType | keyToLabel }}</option>\n }\n </select>\n </div>\n </div>\n </div>\n }\n\n <div class=\"is-mt-1\">\n <he-chart class=\"is-relative\" [data]=\"chartData()\" [config]=\"chartConfig\" />\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}he-chart ::ng-deep .chart-container{min-height:400px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "component", type: ChartComponent, selector: "he-chart", inputs: ["data", "config"] }, { kind: "pipe", type: KeyToLabelPipe, name: "keyToLabel" }] }); }
12898
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.4", type: SitesManagementChartComponent, isStandalone: true, selector: "he-sites-management-chart", inputs: { site: { classPropertyName: "site", publicName: "site", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"p-3\">\n @if (termTypes().length > 1) {\n <div class=\"field has-addons pt-2 px-3\">\n <div class=\"control\">\n <span class=\"button is-small is-static is-secondary\">Select a Term Type</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth is-secondary\">\n <select (change)=\"selectTermType($event.target.value)\">\n @for (termType of termTypes(); track termType) {\n <option [ngValue]=\"termType\">\n {{ termType.termType | keyToLabel }}\n @if (termType.blankNodesGroup && termType.blankNodesGroup !== 'null') {\n - {{ termType.blankNodesGroup }}\n }\n </option>\n }\n </select>\n </div>\n </div>\n </div>\n }\n\n <div class=\"is-mt-1\">\n <he-chart class=\"is-relative\" [data]=\"chartData()\" [config]=\"chartConfig\" />\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}he-chart ::ng-deep .chart-container{min-height:400px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "component", type: ChartComponent, selector: "he-chart", inputs: ["data", "config"] }, { kind: "pipe", type: KeyToLabelPipe, name: "keyToLabel" }] }); }
12881
12899
  }
12882
12900
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: SitesManagementChartComponent, decorators: [{
12883
12901
  type: Component$1,
12884
- args: [{ selector: 'he-sites-management-chart', imports: [FormsModule, ChartComponent, KeyToLabelPipe], template: "<div class=\"p-3\">\n @if (termTypes().length > 1) {\n <div class=\"field has-addons pt-2 px-3\">\n <div class=\"control\">\n <span class=\"button is-small is-static is-secondary\">Select a Term Type</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth is-secondary\">\n <select (change)=\"selectedTermType.set($event.target.value)\">\n @for (termType of termTypes(); track termType) {\n <option [value]=\"termType\">{{ termType | keyToLabel }}</option>\n }\n </select>\n </div>\n </div>\n </div>\n }\n\n <div class=\"is-mt-1\">\n <he-chart class=\"is-relative\" [data]=\"chartData()\" [config]=\"chartConfig\" />\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}he-chart ::ng-deep .chart-container{min-height:400px}\n"] }]
12902
+ args: [{ selector: 'he-sites-management-chart', imports: [FormsModule, ChartComponent, KeyToLabelPipe], template: "<div class=\"p-3\">\n @if (termTypes().length > 1) {\n <div class=\"field has-addons pt-2 px-3\">\n <div class=\"control\">\n <span class=\"button is-small is-static is-secondary\">Select a Term Type</span>\n </div>\n <div class=\"control is-expanded\">\n <div class=\"select is-small is-fullwidth is-secondary\">\n <select (change)=\"selectTermType($event.target.value)\">\n @for (termType of termTypes(); track termType) {\n <option [ngValue]=\"termType\">\n {{ termType.termType | keyToLabel }}\n @if (termType.blankNodesGroup && termType.blankNodesGroup !== 'null') {\n - {{ termType.blankNodesGroup }}\n }\n </option>\n }\n </select>\n </div>\n </div>\n </div>\n }\n\n <div class=\"is-mt-1\">\n <he-chart class=\"is-relative\" [data]=\"chartData()\" [config]=\"chartConfig\" />\n </div>\n</div>\n", styles: [":host{display:block;overflow:visible}he-chart ::ng-deep .chart-container{min-height:400px}\n"] }]
12885
12903
  }], ctorParameters: () => [] });
12886
12904
 
12887
12905
  var View;