diff --git a/libs/common/common.babel b/libs/common/common.babel index dcc74d589..ebc9b4928 100644 --- a/libs/common/common.babel +++ b/libs/common/common.babel @@ -34461,57 +34461,6 @@ - - resource-type - - - all-types - - - - - ca-ES - false - - - en-US - false - - - es-ES - false - - - fr-FR - false - - - - - button-label - - - - - ca-ES - false - - - en-US - false - - - es-ES - false - - - fr-FR - false - - - - - search-in diff --git a/libs/common/src/assets/i18n/ca.json b/libs/common/src/assets/i18n/ca.json index acf4c0010..ce71c5114 100644 --- a/libs/common/src/assets/i18n/ca.json +++ b/libs/common/src/assets/i18n/ca.json @@ -1420,8 +1420,6 @@ "tasks-automation.form.filter.fields.all-types": "Tots els tipus de camp", "tasks-automation.form.filter.fields.button-label": "Tipus de camp", "tasks-automation.form.filter.resource-labels.button-label": "Etiquetes de recursos", - "tasks-automation.form.filter.resource-type.all-types": "Tots els tipus de recursos", - "tasks-automation.form.filter.resource-type.button-label": "Tipus de Recursos", "tasks-automation.form.filter.search-in.content": "El contingut conté", "tasks-automation.form.filter.search-in.title": "El títol conté", "tasks-automation.form.filter.search-in.title-or-content": "El títol o el contingut conté", @@ -1455,7 +1453,7 @@ "tasks-automation.generator.description": "Enriquiu els vostres recursos generant text addicional (com un resum) o metadades associades als recursos escollits.", "tasks-automation.generator.field-name.description": "Prefixeu l'identificador del nou camp on s'emmagatzemaran les dades generades.", "tasks-automation.generator.field-name.info": "En cada recurs, es crearà un camp nou amb el contingut generat corresponent a la vostra consulta.", - "tasks-automation.generator.field-name.invalid": "El nom del camp no pot contenir guions", + "tasks-automation.generator.field-name.invalid": "El nom del camp només ha de contenir lletres, xifres i _", "tasks-automation.generator.field-name.title": "On emmagatzemar el contingut generat?", "tasks-automation.generator.footer.activate-button-label": "Activa el generador", "tasks-automation.generator.footer.apply-automation": "Apliqueu la vostra consulta a tots els recursos existents i futurs que coincideixin amb la selecció.", diff --git a/libs/common/src/assets/i18n/en.json b/libs/common/src/assets/i18n/en.json index b9eddcb78..39553251b 100644 --- a/libs/common/src/assets/i18n/en.json +++ b/libs/common/src/assets/i18n/en.json @@ -1420,8 +1420,6 @@ "tasks-automation.form.filter.fields.all-types": "All field types", "tasks-automation.form.filter.fields.button-label": "Field types", "tasks-automation.form.filter.resource-labels.button-label": "Resource labels", - "tasks-automation.form.filter.resource-type.all-types": "All resource types", - "tasks-automation.form.filter.resource-type.button-label": "Resource types", "tasks-automation.form.filter.search-in.content": "Content contains", "tasks-automation.form.filter.search-in.title": "Title contains", "tasks-automation.form.filter.search-in.title-or-content": "Title or content contains", @@ -1455,7 +1453,7 @@ "tasks-automation.generator.description": "Enrich your resources by generating extra text (like a summary) or metadata associated to the chosen resources.", "tasks-automation.generator.field-name.description": "Prefix the id of the new field where the generated data will be stored.", "tasks-automation.generator.field-name.info": "In each resource, a new field will be created containing the generated content corresponding to your query.", - "tasks-automation.generator.field-name.invalid": "The field name cannot contain hyphens", + "tasks-automation.generator.field-name.invalid": "The field name must only contain letters, figures and _", "tasks-automation.generator.field-name.title": "Where to store the generated content?", "tasks-automation.generator.footer.activate-button-label": "Activate generator", "tasks-automation.generator.footer.apply-automation": "Apply your query to all existing and future resources matching the selection.", diff --git a/libs/common/src/assets/i18n/es.json b/libs/common/src/assets/i18n/es.json index c478af085..50c43af7a 100644 --- a/libs/common/src/assets/i18n/es.json +++ b/libs/common/src/assets/i18n/es.json @@ -1420,8 +1420,6 @@ "tasks-automation.form.filter.fields.all-types": "Todos los tipos de campos", "tasks-automation.form.filter.fields.button-label": "Tipos de campos", "tasks-automation.form.filter.resource-labels.button-label": "Etiquetas de recursos", - "tasks-automation.form.filter.resource-type.all-types": "Todos los tipos de recursos", - "tasks-automation.form.filter.resource-type.button-label": "Tipos de recursos", "tasks-automation.form.filter.search-in.content": "Contenido", "tasks-automation.form.filter.search-in.title": "El título contiene", "tasks-automation.form.filter.search-in.title-or-content": "El título o contenido contiene", @@ -1455,7 +1453,7 @@ "tasks-automation.generator.description": "Enriquezca sus recursos generando texto adicional (como un resumen) o metadatos asociados a los recursos elegidos.", "tasks-automation.generator.field-name.description": "Anteponga el id del nuevo campo donde se almacenarán los datos generados.", "tasks-automation.generator.field-name.info": "En cada recurso se creará un nuevo campo que contendrá el contenido generado correspondiente a su consulta.", - "tasks-automation.generator.field-name.invalid": "El nombre del campo no puede contener guiones", + "tasks-automation.generator.field-name.invalid": "El nombre del campo solo debe contener letras, cifras y _", "tasks-automation.generator.field-name.title": "¿Dónde almacenar el contenido generado?", "tasks-automation.generator.footer.activate-button-label": "Activar generador", "tasks-automation.generator.footer.apply-automation": "Aplique su consulta a todos los recursos existentes y futuros que coincidan con la selección.", diff --git a/libs/common/src/assets/i18n/fr.json b/libs/common/src/assets/i18n/fr.json index fe0a06837..04d263317 100644 --- a/libs/common/src/assets/i18n/fr.json +++ b/libs/common/src/assets/i18n/fr.json @@ -1420,8 +1420,6 @@ "tasks-automation.form.filter.fields.all-types": "Tous types de champs", "tasks-automation.form.filter.fields.button-label": "Types de champs", "tasks-automation.form.filter.resource-labels.button-label": "Étiquettes de ressources", - "tasks-automation.form.filter.resource-type.all-types": "Tous les types de ressources", - "tasks-automation.form.filter.resource-type.button-label": "Types de ressources", "tasks-automation.form.filter.search-in.content": "Le contenu contient", "tasks-automation.form.filter.search-in.title": "Le titre contient", "tasks-automation.form.filter.search-in.title-or-content": "Le titre ou le contenu contient", @@ -1455,7 +1453,7 @@ "tasks-automation.generator.description": "Enrichissez vos ressources en générant du texte supplémentaire (comme un résumé) ou des métadonnées associées aux ressources choisies.", "tasks-automation.generator.field-name.description": "Préfixe l'identifiant du nouveau champ où les données générées seront stockées.", "tasks-automation.generator.field-name.info": "Dans chaque ressource, un nouveau champ sera créé contenant le contenu généré correspondant à votre requête.", - "tasks-automation.generator.field-name.invalid": "Le nom du champ ne peut pas contenir de tirets", + "tasks-automation.generator.field-name.invalid": "Le nom du champ ne doit contenir que des lettres, des chiffres et des _", "tasks-automation.generator.field-name.title": "Où stocker le contenu généré ?", "tasks-automation.generator.footer.activate-button-label": "Activer le générateur", "tasks-automation.generator.footer.apply-automation": "Appliquez votre requête à toutes les ressources existantes et futures correspondant à la sélection.", diff --git a/libs/common/src/lib/tasks-automation/task-forms/ask/ask.component.ts b/libs/common/src/lib/tasks-automation/task-forms/ask/ask.component.ts index 8bcc6c8fe..173332769 100644 --- a/libs/common/src/lib/tasks-automation/task-forms/ask/ask.component.ts +++ b/libs/common/src/lib/tasks-automation/task-forms/ask/ask.component.ts @@ -35,7 +35,7 @@ export class AskComponent extends TaskRouteDirective { question: new FormControl('', { nonNullable: true, validators: [Validators.required] }), fieldName: new FormControl('', { nonNullable: true, - validators: [Validators.required, Validators.pattern('[^-]*')], + validators: [Validators.required, Validators.pattern('[0-9a-zA-Z_]+')], }), }); override errorMessages = { diff --git a/libs/common/src/lib/tasks-automation/task-forms/task-form.component.html b/libs/common/src/lib/tasks-automation/task-forms/task-form.component.html index 5a23fc07a..5a38e6638 100644 --- a/libs/common/src/lib/tasks-automation/task-forms/task-form.component.html +++ b/libs/common/src/lib/tasks-automation/task-forms/task-form.component.html @@ -45,47 +45,6 @@ } - @if (filters?.['resource_type']) { -
- - {{ 'tasks-automation.form.filter.resource-type.button-label' | translate }} - - @if (resourceTypeSelectionCount > 0) { - ({{ - resourceTypeSelectionCount === resourceTypeTotalCount - ? ('tasks-automation.form.filter.all' | translate) - : resourceTypeSelectionCount - }}) - } - - - - - - {{ 'tasks-automation.form.filter.resource-type.all-types' | translate }} - - - - @for (option of resourceTypeFilters; track option.id) { - - - {{ option.label }} - - - } - -
- }
option.selected).length; - } - get resourceTypeTotalCount(): number { - return this.resourceTypeFilters.length; - } - get selectedResourceTypes() { - return this.resourceTypeFilters.filter((option) => option.selected).map((option) => option.value); - } - fieldTypeFilters: OptionModel[] = [FIELD_TYPE.file, FIELD_TYPE.link, FIELD_TYPE.text, FIELD_TYPE.conversation].map( (t) => new OptionModel({ id: longToShortFieldType(t), value: longToShortFieldType(t), label: t }), ); @@ -227,27 +213,6 @@ export class TaskFormComponent implements OnInit, OnDestroy { this.form.controls.llm.patchValue({ model: 'chatgpt-azure-4o-mini' }); }); - this.sdk.currentKb - .pipe( - switchMap((kb) => kb.catalog('', { faceted: MIME_FACETS })), - map((results) => { - if (results.type === 'error') { - return; - } - const facets: Search.FacetsResult = results.fulltext?.facets || {}; - return formatFiltersFromFacets(facets); - }), - filter((filters) => !!filters), - map((filters) => filters as Filters), - ) - .subscribe((filters) => { - this.resourceTypeFilters = filters.mainTypes.map((filter) => ({ - ...filter, - value: filter.value.split('/').slice(2).join('/'), - })); - this.cdr.detectChanges(); - }); - combineLatest([this.form.valueChanges, this.selectedFilters]) .pipe( filter(([data]) => data.applyTaskTo === 'EXISTING'), @@ -277,11 +242,6 @@ export class TaskFormComponent implements OnInit, OnDestroy { const tagName = (event.target as HTMLElement).tagName; if (tagName === 'LI' || tagName === 'INPUT') { switch (filter) { - case 'types': - this.resourceTypeFilters = this.resourceTypeFilters.map( - (option) => new OptionModel({ ...option, selected: !this.allResourceTypesSelected }), - ); - break; case 'fieldTypes': this.fieldTypeFilters = this.fieldTypeFilters.map( (option) => new OptionModel({ ...option, selected: !this.allFieldTypesSelected }), @@ -305,9 +265,8 @@ export class TaskFormComponent implements OnInit, OnDestroy { } onToggleFilter() { - this.allResourceTypesSelected = this.resourceTypeFilters.every((option) => option.selected); this.allFieldTypesSelected = this.fieldTypeFilters.every((option) => option.selected); - this.selectedFilters.next(this.selectedResourceTypes.concat(this.selectedFieldTypes).concat(this.labelFilters)); + this.selectedFilters.next(this.selectedFieldTypes.concat(this.labelFilters)); } activateTask() { @@ -327,7 +286,6 @@ export class TaskFormComponent implements OnInit, OnDestroy { : undefined, filter: { contains: rawValue.filter.contains ? [rawValue.filter.contains] : [], - resource_type: this.selectedResourceTypes, field_types: this.selectedFieldTypes, }, }); diff --git a/libs/common/src/lib/tasks-automation/task-forms/task-settings/task-settings.component.html b/libs/common/src/lib/tasks-automation/task-forms/task-settings/task-settings.component.html index 035b4d699..b9479adc1 100644 --- a/libs/common/src/lib/tasks-automation/task-forms/task-settings/task-settings.component.html +++ b/libs/common/src/lib/tasks-automation/task-forms/task-settings/task-settings.component.html @@ -31,18 +31,6 @@
{{ filter.contains?.[0] || '-' }}
-
- -
- @if (filter.resource_type?.length) { - @for (type of filter.resource_type; track type) { - {{ type }} - } - } @else { - {{ 'generic.all' | translate }} - } -
-
@if (fieldTypes.length > 0) {
diff --git a/libs/common/src/lib/tasks-automation/tasks-automation.models.ts b/libs/common/src/lib/tasks-automation/tasks-automation.models.ts index b783bb424..7cd519bda 100644 --- a/libs/common/src/lib/tasks-automation/tasks-automation.models.ts +++ b/libs/common/src/lib/tasks-automation/tasks-automation.models.ts @@ -52,7 +52,6 @@ function mapParameters(parameters: TaskParameters): TaskConfiguration { title: parameters.name, filters: [ { label: 'contains', count: parameters.filter.contains?.length || 0 }, - { label: 'resource_type', count: parameters.filter.resource_type?.length || 0 }, { label: 'field_types', count: parameters.filter.field_types?.length || 0 }, ], hasPrompt: false, // TODO: extract prompt from parameters