Skip to content

Commit

Permalink
v1.187.0
Browse files Browse the repository at this point in the history
  • Loading branch information
varovaro committed Oct 7, 2024
2 parents 015144c + b027984 commit 533eaa4
Show file tree
Hide file tree
Showing 12 changed files with 401 additions and 305 deletions.
15 changes: 14 additions & 1 deletion app/api/services/informationextraction/InformationExtraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface TaskParameters {
id: string;
multi_value?: boolean;
options?: { label: string; id: string }[];
metadata?: { [key: string]: string };
}

interface TaskMessage {
Expand Down Expand Up @@ -372,7 +373,14 @@ class InformationExtraction {
await this.taskManager.startTask({
task: 'suggestions',
tenant: tenants.current().name,
params: { id: extractorId.toString() },
params: {
id: extractorId.toString(),
metadata: {
extractor_name: extractor.name || '',
property: extractor.property || '',
templates: Array.isArray(extractor.templates) ? extractor.templates.join(',') : '',
},
},
});
};

Expand Down Expand Up @@ -413,6 +421,11 @@ class InformationExtraction {
const params: TaskParameters = {
id: extractorId.toString(),
multi_value: property.type === 'multiselect' || property.type === 'relationship',
metadata: {
extractor_name: extractor.name || '',
property: extractor.property || '',
templates: extractor.templates ? extractor.templates.join(',') : '',
},
};

if (propertyTypeIsSelectOrMultiSelect(property.type)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,15 @@ describe('InformationExtraction', () => {
await informationExtraction.trainModel(factory.id('prop1extractor'));

expect(informationExtraction.taskManager?.startTask).toHaveBeenCalledWith({
params: { id: factory.id('prop1extractor').toString(), multi_value: false },
params: {
id: factory.id('prop1extractor').toString(),
multi_value: false,
metadata: {
extractor_name: 'prop1extractor',
property: 'property1',
templates: expect.anything(),
},
},
tenant: 'tenant1',
task: 'create_model',
});
Expand Down Expand Up @@ -369,6 +377,11 @@ describe('InformationExtraction', () => {
label: '1B',
},
],
metadata: {
extractor_name: 'extractorWithMultiselect',
property: 'property_multiselect',
templates: expect.anything(),
},
},
tenant: 'tenant1',
task: 'create_model',
Expand Down Expand Up @@ -396,6 +409,11 @@ describe('InformationExtraction', () => {
label: 'P3',
},
],
metadata: {
extractor_name: 'extractorWithRelationship',
property: 'property_relationship',
templates: expect.anything(),
},
},
tenant: 'tenant1',
task: 'create_model',
Expand Down Expand Up @@ -427,6 +445,11 @@ describe('InformationExtraction', () => {
label: `A${i + 1}`,
})),
],
metadata: {
extractor_name: 'extractorWithRelationshipToAny',
property: 'property_relationship_to_any',
templates: expect.anything(),
},
},
tenant: 'tenant1',
task: 'create_model',
Expand Down Expand Up @@ -711,7 +734,14 @@ describe('InformationExtraction', () => {
await informationExtraction.getSuggestions(factory.id('prop1extractor'));

expect(informationExtraction.taskManager?.startTask).toHaveBeenCalledWith({
params: { id: factory.id('prop1extractor').toString() },
params: {
id: factory.id('prop1extractor').toString(),
metadata: {
extractor_name: 'prop1extractor',
property: 'property1',
templates: expect.anything(),
},
},
tenant: 'tenant1',
task: 'suggestions',
});
Expand Down
2 changes: 1 addition & 1 deletion app/react/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { CleanInsights } from 'app/V2/Components/Analitycs';
import 'react-widgets/dist/css/react-widgets.css';
import 'bootstrap/dist/css/bootstrap.css';
import 'nprogress/nprogress.css';
import 'flag-icon-css/sass/flag-icons.scss';
import 'flag-icons/sass/flag-icons.scss';
import './scss/styles.scss';
import './styles/globals.css';
import 'flowbite';
Expand Down
218 changes: 109 additions & 109 deletions app/react/App/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,113 +1,5 @@
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(99 102 241 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(99 102 241 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

/*
! tailwindcss v3.4.12 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com
*/

/*
Expand Down Expand Up @@ -995,6 +887,114 @@ input[type="range"]::-ms-fill-lower {
font-family: 'Inter', sans-serif !important;
}

*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(99 102 241 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(99 102 241 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
--tw-contain-size: ;
--tw-contain-layout: ;
--tw-contain-paint: ;
--tw-contain-style: ;
}

.container {
width: 100%;
}
Expand Down
2 changes: 1 addition & 1 deletion app/react/Forms/components/IconSelectorItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class IconSelectorItem extends Component {
}

if (item.type === 'Flags') {
const className = `flag-icon flag-icon-${CountryList.get(item._id).cca2}`.toLowerCase();
const className = `fi fi-${CountryList.get(item._id).cca2}`.toLowerCase();
icon = (
<span style={style}>
<span className={className} />
Expand Down
2 changes: 1 addition & 1 deletion app/react/Forms/components/specs/IconSelectorItem.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('IconSelectorItem', () => {
props = { item: { _id: 'JPN', type: 'Flags', label: 'Flag Label' } };
render();

expect(component.find('span.flag-icon').props().className).toContain('flag-icon-jp');
expect(component.find('span.fi').props().className).toContain('fi-jp');
expect(component.text()).toContain('Flag Label');
});

Expand Down
2 changes: 1 addition & 1 deletion app/react/Layout/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class Icon extends Component {
}

if (_data.type === 'Flags') {
const flagClassName = `flag-icon flag-icon-${CountryList.get(_data._id).cca2}`.toLowerCase();
const flagClassName = `fi fi-${CountryList.get(_data._id).cca2}`.toLowerCase();
const componentClassName = `${className} ${flagClassName}`;
icon = <span className={componentClassName} />;
}
Expand Down
4 changes: 2 additions & 2 deletions app/react/Layout/specs/Icon.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('Icon', () => {

it('should render a Flag icon', () => {
render();
expect(component.find('span.flag-icon').props().className).toContain('passed-flag-classname');
expect(component.find('span.flag-icon').props().className).toContain('flag-icon-jp');
expect(component.find('span.fi').props().className).toContain('passed-flag-classname');
expect(component.find('span.fi').props().className).toContain('fi-jp');
});
});
});
2 changes: 1 addition & 1 deletion app/react/Library/components/specs/TableRow.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('TableRow', () => {
render();
const renderedColumns = screen.getAllByRole('cell');
const content = renderedColumns.map(col => col.textContent);
const icons = renderResult.container.getElementsByClassName('flag-icon-co');
const icons = renderResult.container.getElementsByClassName('fi-co');
const entityIcon = icons[0];
expect(icons.length).toBe(1);
expect(entityIcon.parentNode!.parentNode!.parentNode!).toEqual(renderedColumns[0]);
Expand Down
Loading

0 comments on commit 533eaa4

Please sign in to comment.