Git Product home page Git Product logo

sba-angular's People

Contributors

akewea avatar chhamza1991 avatar christiansestier avatar dependabot[bot] avatar ericleib avatar gleibfried avatar gleroyc avatar guillaume-developer avatar guillaumelry avatar hebus avatar hermannseitz avatar hydhen avatar jimmy-yeh-sba avatar julieng-sinequa avatar justin-john-sinequa avatar lance-johnson-sinequa avatar larde avatar mathieu-steininger avatar meunierfrederic avatar peter-do-sinequa avatar rleclercq avatar sqtimbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sba-angular's Issues

Timeline not zooming on selection

I noticed a new issue of the timeline not zooming to the selected time area, which was introduced after the change made in the commit f3c7fabf.
I checked without the changes made in this commit and the problem disappeared.
I also noticed that this same issue appears (before and after this commit) when we're zooming on the timeline and then selecting a time area.

Find below a screenshot of the issue.

image

IE11 links in document preview iframe not opening

I have an issue with document preview containing links inside its html (using an html template, the document preview was constructed with href links inside it). In Chrome, the links open without any problem, but in IE11, it doesn't open whatever I do. I added the "allow-popups" and all "allow-..." from the "defaultSandbox", but it still doesn't work.

image

The link is a simple <a > tag inside the iframe:

<a style="left: 0px; top: 0px; width: 100%; height: 100%; position: absolute; cursor: pointer;" href="https://pubmed.ncbi.nlm.nih.gov/" target="_blank"></a>

Result selector broken since 11.6.1

Since the Update to 11.6.1 The sq-result-selector is broken.
It doesn't react to the user selecting documents and doesn't display the selected count any more. Also there are no Actions like the labels or baskets showing up, because it doesn't seem to register the selection changes. When I select all at once it shows the count but still no actions...

Performances issues caused by HostListener on facet-card

When many facet-card are used on the screen, some of the other click events on the screen are being delayed by the @HostListener('window:click', ['$event']).
Since this part of the code is only used conditionally, it might be good to initialize it only in the case where collapseOnClickOutside == true, using addEventListener instead of HostListener.

Issue with recent queries date revival for dates different from GMT+0

I've noticed recently while playing with the recent queries that the date revival code in the RecentQueriesService is actually making the dates of revived queries go backward.
For example, with GMT+9, the date built with const date = Utils.toDate(rq.date); will have the correct time and the correct timezone applied, but then when assigning it rq.date = date;, the rq.date will be in GMT+0, which means that the time will go 9 hours back and be saved as is.

EDIT

Nervermind, I realized that the code was fixed in the newest version, can you confirm?
Anyway, we are not using it at the moment so I'll just apply a workaround in the meantime.

Timeline scaling

Hi,

Would there be a way to make the timeline's height and width scale independently?
I'd like to use the timeline on top of the result's list, but since the height and width are linked, I either have something too big, or something that doesn't fit the length.

Good height but not fitting the length
image

Fit the length but too big:
image

Error when using a second label webservice

I tried recently to use more than one label webservice in my code but realized that the webservice placed in second position was always returning an error when used.
Moving the same webservice in first position will make the error disappear though. Find below a piece of code that I use to call the specific webservice I added.

``
let default_cclabels = this.appService.cclabels;

this.appService.cclabels = this.appService.getWebService("key_assets_labels");

if (this.keyAssetFlag) {
  this.labelsWebService
    .add([this.keyAssetsConfig.tag], [this.record.id], true)
    .pipe(takeUntil(this.ngUnsubscribe))
    .subscribe((res) => {
      this.appService.cclabels = default_cclabels;
    });
} else {
  this.labelsWebService
    .remove([this.keyAssetsConfig.tag], [this.record.id], true)
    .pipe(takeUntil(this.ngUnsubscribe))
    .subscribe((res) => {
      this.appService.cclabels = default_cclabels;
    });
}

``

The error that I am getting when using this label webservice is the following one:

image

{methodresult: "error", errorCode: 4, errorCodeText: "invalid request",…}
errorCode: 4
errorCodeText: "invalid request"
errorMessage: "User cannot remove public labels"
methodresult: "error"

WEBAPP LOGS

2022-01-07 09:40:32 api url 'v1/labels'
2022-01-07 09:40:32 :ND:Session.DoLogin:sinequa|admin
2022-01-07 09:40:32 >>:ss:ResolveProfile
2022-01-07 09:40:32 user settings read for sinequa|admin
2022-01-07 09:40:32 >>:ss:GetUserRights
2022-01-07 09:40:32 >>:cc:CalculateSessionRights:sinequa|admin +F
2022-01-07 09:40:32 >>:nd:CalculateUserRightsV3(1,4192)
2022-01-07 09:40:32 <<:nd:CalculateUserRightsV3 : 0.12
2022-01-07 09:40:32 <<:cc:CalculateSessionRights:sinequa|admin +F : 63.959 ms
2022-01-07 09:40:32 <<:ss:GetUserRights : 64.027 ms
2022-01-07 09:40:32 <<:ss:ResolveProfile : 64.257 ms
2022-01-07 09:40:32 SessionUiLanguage=English
2022-01-07 09:40:32 SessionUiDateFormat=
2022-01-07 09:40:32 Sys.LangCode=English
2022-01-07 09:40:32 DoOverrideUser: no user specified in override user parameter
2022-01-07 09:40:32 error : labels error n° 4 (invalid request) : User cannot remove public labels
2022-01-07 09:40:32 http set status : 500
2022-01-07 09:40:32 xrest labels : 63 ms

Japanese dakuten ( ゙ ) and handakuten ( ゚ ) in filters are deleted by the API at query time

I noticed recently that the japanese characters using a dakuten ( ゙ ) or a handakuten ( ゚ ) in a filter are being transformed by the API at query time and the dakuten or handakuten are being deleted from the word.
This leads to sounds like 「ザ」( [za] ) ou 「パ」( [pa] ) becoming 「サ」( [sa] ) et 「は」( [ha] ), which then makes the searches returns 0 results since the word changed... This doesn't happen in a normal text search, only when the dakuten or handakuten is on a word of the filter applied. Also, this doesn't appear to be an issue with the processing of the words when creating the expression, as I could see with the following log of the query object:

query_pfizer

The above query object leads to the following query in the Sinequa engine:

select ... from ... where text contains 'ファイザー' and (company contains 'ファイサー') and collection contains '*' and ...

EDIT: this issue is extremely important since it causes almost half of the japanese words to be useless for filtering since they will always return 0 documents. Also, this doesn't happen in the profile search.

app.scss error on bootstrap 5 upgrade

Getting a build error on vanilla-search upgrade of bootstrap 5 update.

Bootstrap version 5.1.3

Error: ./projects/vanilla-search/src/styles/app.scss
Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/dist/cjs.js):
SassError: Undefined mixin.
  ╷
6 │ ┌     @include hover-focus {
7 │ │       background-color: darken(lightgrey, 10%);
8 │ │       color: black;
9 │ └     }
  ╵
  projects\components\metadata\metadata.scss 6:5    @import
  projects\vanilla-search\src\styles\app.scss 53:9  root stylesheet
    at C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\webpack\lib\NormalModule.js:316:20
    at C:\Shravan\SBA\sba-angular-master\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Shravan\SBA\sba-angular-master\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (C:\Shravan\SBA\sba-angular-master\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass-loader\dist\index.js:56:7
    at Function.call$2 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:89862:16)       
    at _render_closure1.call$2 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:79036:12)
    at _RootZone.runBinary$3$3 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:26612:18)
    at _FutureListener.handleError$1 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:25140:19)
    at _Future__propagateToListeners_handleError.call$0 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:25437:49)
    at Object._Future__propagateToListeners (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:4502:77)
    at _Future._completeError$2 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:25270:9)
    at _AsyncAwaitCompleter.completeError$2 (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:24613:12)
    at Object._asyncRethrow (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:4251:17)   
    at C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:13112:20
    at _wrapJsFunctionForAsync_closure.$protected (C:\Shravan\SBA\sba-angular-master\node_modules\@angular-devkit\build-angular\node_modules\sass\sass.dart.js:4276:15)

Date formats in Timeline

Hello

We are currently using the Timeline and the side preview template for displaying metadata on top of the side document preview’s iframe. In both these things, the date format follows the US format. I noticed that the template on top of side preview document’s iframe is just displaying the modified date as it comes from the API (since we receive it as a string), so I guess there’s no changing it. But do you know if it’s possible to apply a different time format to the timeline?

image

For example, when I’m formatting the dates in my application, I always use the ToLocaleDateString() function, so that it will use the Locale date format. Is there a way to do the same with the Timeline?

Extracts locations CSS not applied

Hello,

I cannot explain why, but in some cases, the extracts locations CSS is not applied. In the screenshot below, for example, the matchlocations CSS is correctly applied, but not the extracts locations CSS.

image
image

The CSS of the extractslocations class not being applied, the fill property is not set in the CSS, and it is automatically set as black.
After some tests, I have noticed that in the stylesheet preview.scss, the code of @mixin svgHighlight($term) is not being applied for the extractslocations in this case. However, if I apply the CSS of @mixin svgHighlight($term) in @mixin svgHighlightCurrent($term), this time it is correctly applied.
This phenomenon being applied to all the extracts present in the preview, it seems to lead to the fact that the extractslocations are considered as current highlight, event though they are not the current highlight?

Would you have an explanation or a solution for this?
It doesn't seem appropriate to always apply the CSS in @mixin svgHighlightCurrent($term) since it is supposed to be for the current highlights only...

@mixin svgHighlight($term) {
$highlight: map-get($highlights, $term);
$color: map-get($highlight, "color");
$background-color: map-get($highlight, "background-color");
$border: map-get($highlight, "border");
@if $color != null {
tspan.#{$term}:not(.sq-inactive) {
fill: $color;
font-weight: bold;
}
}
@if $background-color == null {
$background-color: rgba(0, 0, 0, 0);
}
rect.#{$term}:not(.sq-inactive) {
fill: $background-color;
}
@if $border != null {
line.#{$term} {
border: $border;
}
}
}
@mixin svgHighlightCurrent($term) {
$highlight: map-get($highlights, $term);
$color: map-get($highlight, "color");
$background-color: map-get($highlight, "background-color");
$border: map-get($highlight, "border");
@if $color != null {
tspan.#{$term}:not(.sq-inactive) {
fill: $color;
font-weight: bold;
}
}
@if $background-color == null {
$background-color: rgba(0, 0, 0, 0);
}
rect.#{$term}:not(.sq-inactive).sq-current {
fill: $background-color;
}
@if $border != null {
line.#{$term} {
border: $border;
}
}
}

Heatmap: clear all filters not possible anymore

Context

We are currently upgrading an application from v11.9.0 to v11.10.0 and we are using the FacetHeatmapComponent.

Description

In previous versions, we had the possibility to clear the filters of a specific facet by using its name, using the Query method removeSelect.
In the newest version, it seems that the filter syntax only uses the fields to distinguish between filters and the use of the facet name to clear filters is not longer feasible.
This change makes us unable to clear filters from the Facet Heatmap like we would be able to do on any other facets.
It also makes us unable to fetch the specific Heatmap filters and differentiate them from other facets.
Do you have an idea how we could implement it in the newest version?

Previous implementation

this.clearFilters.action = () => {
      const fieldsX: string[] = this.fieldsX || [this.fieldXPref];
      const fieldsY: string[] = this.fieldsY || [this.fieldYPref];

      for (const x of fieldsX) {
        for (const y of fieldsY)
          this.searchService.query.removeSelect(`${this._name} - ${this.intl.formatMessage(this.appService.getPluralLabel(x))}/${this.intl.formatMessage(this.appService.getPluralLabel(y))}`, true);
      }
      this.searchService.search();
    };

Type definition errors on SBA build

Hi there,

I am refactoring an app that was created using your Sinequa Angular SBA workspace to use your @sinequa/core and @sinequa/components npm packages.

I'm getting the following errors after building my app:

Error: node_modules/@sinequa/components/utils/pipes/relative-time-pipe.d.ts:1:23 - error TS2688: Cannot find type definition file for 'sq-extra-typings'.

1 /// <reference types="sq-extra-typings" />
                        ~~~~~~~~~~~~~~~~


Error: node_modules/@sinequa/components/utils/pipes/relative-time-pipe.d.ts:8:20 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeUnit'.

8         unit: Intl.RelativeTimeUnit;
                     ~~~~~~~~~~~~~~~~


Error: node_modules/@sinequa/core/intl/intl.service.d.ts:1:23 - error TS2688: Cannot find type definition file for 'sq-extra-typings'.

1 /// <reference types="sq-extra-typings" />
                        ~~~~~~~~~~~~~~~~


Error: node_modules/@sinequa/core/intl/intl.service.d.ts:271:79 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeUnit'.

271     formatRelativeTime(value: string | number | Date | undefined, unit?: Intl.RelativeTimeUnit, options?: Intl.RelativeTimeFormatOptions & {

Environment:

  • Angular CLI: 13.3.0
  • Node: 14.17.0
  • Package Manager: npm 6.14.13

Dependencies (taken from the project's package.json):

"dependencies": {
    "@agm/core": "^3.0.0-beta.0",
    "@angular-builders/custom-webpack": "^13.1.0",
    "@angular/animations": "13.3.0",
    "@angular/cdk": "13.3.0",
    "@angular/common": "13.3.0",
    "@angular/compiler": "13.3.0",
    "@angular/core": "13.3.0",
    "@angular/flex-layout": "10.0.0-beta.32",
    "@angular/forms": "13.3.0",
    "@angular/material": "13.3.0",
    "@angular/platform-browser": "13.3.0",
    "@angular/platform-browser-dynamic": "13.3.0",
    "@angular/router": "13.3.0",
    "@carbon/icons-angular": "^11.2.2",
    "@formatjs/intl-relativetimeformat": "^4.5.12",
    "@fortawesome/fontawesome-free": "^5.13.0",
    "@popperjs/core": "^2.11.4",
    "@sinequa/components": "^11.7.1",
    "@sinequa/core": "^11.7.1",
    "@swimlane/ngx-charts": "^14.0.0",
    "angular-fusioncharts": "^3.0.4",
    "angular-gridster2": "^10.1.4",
    "atomicjs": "^4.4.1",
    "bootstrap": "^4.4.1",
    "chart.js": "^2.9.4",
    "custom-event": "^1.0.1",
    "d3": "^5.15.1",
    "diacritics": "^1.3.0",
    "element-resize-detector": "^1.2.1",
    "fast-text-encoding": "^1.0.1",
    "focus-within": "^3.0.2",
    "fusioncharts": "^3.15.1-sr.1",
    "i": "^0.3.7",
    "intl": "^1.2.5",
    "intl-format-cache": "^4.2.24",
    "intl-messageformat": "^7.8.4",
    "intl-messageformat-parser": "^3.6.4",
    "intl-pluralrules": "^1.2.0",
    "jquery": "^3.5.0",
    "jquery-contextmenu": "^2.9.0",
    "js-polyfills": "^0.1.42",
    "jssha": "^2.4.2",
    "jstz": "^2.1.1",
    "karma-junit-reporter": "^2.0.1",
    "lodash": "^4.17.21",
    "matchmedia-polyfill": "^0.3.2",
    "material-design-icons-iconfont": "^5.0.1",
    "moment": "^2.24.0",
    "ng2-charts": "^2.4.2",
    "ng2-ui-auth": "^10.0.1",
    "ng5-slider": "^1.2.4",
    "ngx-bootstrap": "^5.6.1",
    "ngx-vis": "^3.1.0",
    "npm": "^8.5.5",
    "popper.js": "^1.16.1",
    "rxjs": "~6.6.3",
    "tslib": "^2.3.1",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "13.3.0",
    "@angular/cli": "13.3.0",
    "@angular/compiler-cli": "13.3.0",
    "@angular/language-service": "13.3.0",
    "@babel/core": "^7.17.8",
    "@compodoc/compodoc": "^1.1.14",
    "@types/d3": "^5.7.2",
    "@types/googlemaps": "^3.39.3",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/jquery": "^3.3.35",
    "@types/jquery.contextmenu": "^1.7.34",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.17",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "karma-mocha-reporter": "^2.2.5",
    "ng-packagr": "^13.3.0",
    "postcss-flexbugs-fixes": "^4.2.0",
    "postcss-focus-within": "^3.0.0",
    "protractor": "^7.0.0",
    "sass-asset-functions": "^0.1.1",
    "sass-color-helpers": "^2.1.1",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.6.2"
  }

My tsconfig.json file:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "es2020",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2017",
    "allowSyntheticDefaultImports": true,
    "preserveSymlinks": true,
    "noFallthroughCasesInSwitch": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noUnusedLocals": true,
    "strictFunctionTypes": true,
    "strictNullChecks": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2020",
      "dom"
    ],
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

My angular.json file:

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
      "my-app": {
        "projectType": "application",
        "schematics": {
          "@schematics/angular:component": {
            "style": "scss"
          }
        },
        "root": "projects/my-app",
        "sourceRoot": "projects/my-app/src",
        "prefix": "my-app",
        "architect": {
          "build": {
            "builder": "@angular-devkit/build-angular:browser",
            "options": {
              "outputPath": "dist/my-app",
              "index": "projects/my-app/src/index.html",
              "main": "projects/my-app/src/main.ts",
              "polyfills": "projects/my-app/src/polyfills.ts",
              "tsConfig": "projects/my-app/tsconfig.app.json",
              "assets": ["projects/my-app/src/favicon.ico", "projects/my-app/src/assets"],
              "styles": [
                "projects/my-app/src/styles/app.scss",
                "projects/my-app/src/styles/preview.scss",
                {
                  "input": "projects/my-app/src/styles/preview.scss",
                  "bundleName": "preview",
                  "inject": false
                }
              ],
              "scripts": [],
              "vendorChunk": true,
              "extractLicenses": false,
              "buildOptimizer": false,
              "sourceMap": true,
              "optimization": false,
              "namedChunks": true
            },
            "configurations": {
              "production": {
                "fileReplacements": [
                  {
                    "replace": "projects/my-app/src/environments/environment.ts",
                    "with": "projects/my-app/src/environments/environment.prod.ts"
                  }
                ],
                "optimization": true,
                "outputHashing": "all",
                "sourceMap": false,
                "namedChunks": false,
                "extractLicenses": true,
                "vendorChunk": false,
                "buildOptimizer": true,
                "budgets": [
                  {
                    "type": "initial",
                    "maximumWarning": "2mb",
                    "maximumError": "5mb"
                  },
                  {
                    "type": "anyComponentStyle",
                    "maximumWarning": "6kb",
                    "maximumError": "10kb"
                  }
                ]
              },
              "qualityAssurance": {
                "fileReplacements": [
                  {
                    "replace": "projects/my-app/src/environments/environment.ts",
                    "with": "projects/my-app/src/environments/environment.qa.ts"
                  }
                ],
                "optimization": true,
                "outputHashing": "all",
                "sourceMap": false,
                "namedChunks": false,
                "extractLicenses": true,
                "vendorChunk": false,
                "buildOptimizer": true,
                "budgets": [
                  {
                    "type": "initial",
                    "maximumWarning": "2mb",
                    "maximumError": "5mb"
                  },
                  {
                    "type": "anyComponentStyle",
                    "maximumWarning": "6kb",
                    "maximumError": "10kb"
                  }
                ]
              }
            },
            "defaultConfiguration": ""
          },
          "serve": {
            "builder": "@angular-devkit/build-angular:dev-server",
            "options": {
              "browserTarget": "my-app:build"
            },
            "configurations": {
              "production": {
                "browserTarget": "my-app:build:production"
              }
            }
          },
          "extract-i18n": {
            "builder": "@angular-devkit/build-angular:extract-i18n",
            "options": {
              "browserTarget": "my-app:build"
            }
          },
          "test": {
            "builder": "@angular-devkit/build-angular:karma",
            "options": {
              "main": "projects/my-app/src/test.ts",
              "polyfills": "projects/my-app/src/polyfills.ts",
              "tsConfig": "projects/my-app/tsconfig.spec.json",
              "karmaConfig": "projects/my-app/karma.conf.js",
              "assets": ["projects/my-app/src/favicon.ico", "projects/my-app/src/assets"],
              "styles": [
                "projects/my-app/src/styles/app.scss",
                "projects/my-app/src/styles/preview.scss",
                {
                  "input": "projects/my-app/src/styles/preview.scss",
                  "bundleName": "preview",
                  "inject": false
                }
              ],
              "scripts": [],
              "codeCoverage": true
            }
          },
          "e2e": {
            "builder": "@angular-devkit/build-angular:protractor",
            "options": {
              "protractorConfig": "projects/my-app/e2e/protractor.conf.js",
              "devServerTarget": "my-app:serve"
            },
            "configurations": {
              "production": {
                "devServerTarget": "my-app:serve:production"
              }
            }
          }
        }
      }
    },
    "defaultProject": "my-app"
  }

Has anyone faced this issue?

Preview extracts not displaying in IE11

Hello,

I recently found a bug with IE11 when trying to display the extracts of the document preview page.
The console only says that the 'forEach' function doesn't exist for the type.
After some research on the error, I found that the type mentioned in the error is probably the 'NodeList' type so I tried to add the corresponding polyfill to fix the issue (in the project file "polyfills.ts"), but without success.
I also tried to modify the code of the components object that is used at the loading of the extracts:

for (let i = 0; i < nodes.length; i++) { let n = nodes[i]; text += (n['innerHTML'] || n.textContent); } //nodes.forEach(n => text += (n['innerHTML'] || n.textContent));

This also didn't prove useful.
I am currently running out of ideas, and time, to fix this issue so I am opening a ticket here in case someone could find a fix or an explanation to this.
Note that every tests I did were done in production mode ng build project --prod, and I did build one more time the components after the modification I performed.

Thank you.

Issue in recent queries dates

Hi, I've recently noticed an issue in the recent queries ordering.
When looking at the user settings file, I could find that for every search I do, all my recent-queries are being updated with currentDateTime+9h.
Tracking down the cause of the issue, I realized that it came from a change performed 23 month ago in this commit 74e007d.
I think the commit was aiming to reverse some changes that removed the UTC to current time zone conversion, however it only added the conversion of program to file and didn't add the conversion file to program. Hence, whenever we perform a search, all recent-queries are updated with currentDateTime+timezoneTimeDifference.

The fix to this is to modify the line 66 from

rq.date = new Date(rq.date); 

to

const date = Utils.toDate(rq.date);
if (date) {
    rq.date = date;
}

vanilla start fails with node 17

The "Getting started" falis with current version of node (17.1.0) when starting vanilla-search (see below).
Maybe you should add a .nvmrc file to the project and specify which version of node is embedded in the Sinequa distribution.

Thanks

Fred

npm run ng serve vanilla-search -- --ssl=true --proxyConfig=./projects/vanilla-search/src/proxy.conf.json

/ Generating browser application bundles (phase: building)...node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\util\createHash.js:145:18)
    at BulkUpdateDecorator.update (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\util\createHash.js:46:50)
    at RawSource.updateHash (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\node_modules\webpack-sources\lib\RawSource.js:70:8)
    at NormalModule._initBuildHash (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\NormalModule.js:880:17)
    at handleParseResult (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\NormalModule.js:946:10)
    at C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\NormalModule.js:1040:4
    at processResult (C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\NormalModule.js:755:11)
    at C:\sinequa\data\sba\sinequa-sba-angular\node_modules\webpack\lib\NormalModule.js:819:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.1.0

How can we customize export of documents to include non-column related data?

Recently, we've been trying to add the search performed (text search + filters) to the export file obtained when downloading the documents' metadata.
Unfortunately, we've come to realize that this endeavor was not possible due to the fact that the download file is prepared in the backend, and only the final file ready for download is sent back to the frontend.
We thought that we could intercept the file before it being downloaded and change the filename through the header 'content-disposition' but it was unsuccessful.

Do you have any idea how this could be implemented with the existing export query component or is this something that we would need to create a new component to implement?

Remove a specific field on new suggest strategy

I am currently implementing the newest version of the SBA for a customer, and I am having troubles with the new strategy for the autocomplete.

When using the autocomplete, if no suggestions are returned, a new suggestion query is sent using only the last word.
This works fine, but it then returns suggestions for the last word in all fields of my suggestions service, including the Title field.
The Title field is not really a good fit for this kind of autocompletion, and I would like to remove it from my suggestion results, but I couldn't find a way to do that.

I have tried the following changes in the get(suggestQuery: string | undefined, text: string, fields?: string | string[], query?: Query, maxCount = 10) of the suggestions.service.ts but none of them worked.

Add a filter() on the suggests results

else {
  // Fall back to a strategy of autocompleting only the last token
  const i = text.lastIndexOf(" ")+1;
  if(i > 0) {
    const prefix = text.substring(0, i);
    return this.suggestQueryWebService.get(sugQuery, text.substring(i), ccquery).pipe(
      tap(suggests => suggests?.filter(suggest => suggest.category.toLowerCase() !== "title").forEach(s => s.display = prefix + s.display))
    );
  }
}

Add the kinds parameter when fetching the suggestions

else {
  // Fall back to a strategy of autocompleting only the last token
  const i = text.lastIndexOf(" ")+1;
  if(i > 0) {
    const prefix = text.substring(0, i);
    return this.suggestQueryWebService.get(sugQuery, text.substring(i), ccquery, "concepts").pipe(
      tap(suggests => suggests?.forEach(s => s.display = prefix + s.display))
    );
  }
}

Demo projects in IE

Hello,

I am currently learning to use the SBA functionality in Sinequa, and I seem to have walked upon an issue when running the vanilla-search app in IE.
I have carefully installed all the necessary dependencies to use angular in IE11, and I also made the appropriate modifications in the tsconfig.json file, but I get the error below when I serve the vanilla-search project in IE11.

image

image

This error is specific to the vanilla-search project, it doesn't appear in the hello-search project or any other angular projects I created.
I thought it might be a missing polyfill for a the implementation of a specific "for" loop in IE11, so I imported the full "core-js" package, but this didn't fix it.

EDIT: After careful investigation and debugging, I could find that the modules below are the ones that are causing IE to bug.

  • "@sinequa/components/baskets"
  • "@sinequa/components/facet"
  • "@sinequa/components/heatmap"
  • "@sinequa/components/metadata"
  • "@sinequa/components/preview"
  • "@sinequa/components/result"
  • "@sinequa/components/saved-queries"

Parsing of expression from heatmap filtered item not accurate

I noticed recently that the breadcrumbs produced for the Heatmap items are not really accurate to what's happening.
I think it is the fault of the expression not being parsed correctly due to the filtering being on two columns at once, or maybe the filtering itself is not done correctly?

In the image below, I applied two filters from the Heatmap: "ALCOHOL/United States" and "NICOTINE/United States", which is then transformed into 3 filters for the breadcrumbs.
image

Here's how it looks like if we check in the console:
image

Here's the expression in the URL:
select":[["(geo`United States/ALCOHOL`:`UNITED STATES`) AND (compounds`United States/ALCOHOL`:`ALCOHOL`) AND (`United States/NICOTINE`:(geo:`UNITED STATES` AND compounds:`NICOTINE`))","Heatmap"]]

Here's the expression as a string:
text:(geo`United States/ALCOHOL`:`UNITED STATES` AND compounds`United States/ALCOHOL`:`ALCOHOL` AND `United States/NICOTINE`:(geo`United States/NICOTINE`:`UNITED STATES` AND compounds`United States/NICOTINE`:`NICOTINE`))

Furthermore, when we start having more than 2 filters, then the heatmap filters will not be considered as structured filters, because only the 1st and last filters are considered structured (when I say 1st filter, it is considering filter applied, not displayed. So in the display it is geo`United States/ALCOHOL`:`UNITED STATES` AND compounds`United States/ALCOHOL`:`ALCOHOL`).

Audit personalized events

Hello,

Is it possible to add personalized audit events outside the available events in AuditEventType?
For example, I'd like to register a new audit event for the views clicked by the user, to have an insight of which views are the most used. However, with the current state of the audit web service, there is no way of doing such thing.

Thank you.

Zoom in/out on the timeline doesn't work if opened in a modal

I'm currently running into an issue with the zoom in/out function not working on a timeline opened in a modal.
The error I am getting in the console is the following one:

core.js:6479 ERROR TypeError: Cannot read properties of null (reading 'ctrlKey')
at SVGGElement.defaultFilter (zoom.js:13)
at SVGGElement.wheeled (zoom.js:215)
at SVGGElement. (on.js:27)
at ZoneDelegate.push.46026.ZoneDelegate.invokeTask (zone.js:434)
at Object.onInvokeTask (core.js:28659)
at ZoneDelegate.push.46026.ZoneDelegate.invokeTask (zone.js:433)
at Zone.push.46026.Zone.runTask (zone.js:205)
at ZoneTask.push.46026.ZoneTask.invokeTask [as invoke] (zone.js:516)
at invokeTask (zone.js:1656)
at SVGGElement.globalZoneAwareCallback (zone.js:1682)

Do you have any idea of why this error might happen? I am using the Modal component of ng-bootstrap

I just want to add that other than this issue, the timeline is running correctly.

Search on spelling correction does not update the query analysis

Hi,

I noticed while working with the spelling correction (sq-did-you-mean) component that when clicking on a proposed correction, the query correctly updates, but the content of the query analysis is not updated.
Not sure if this is an issue on the SBA side or backend side though...

Build error for @sinequa/components/results-view

Getting a build build error while building sinequa components. Trying to build it via devops

ERROR: projects/components/results-view/results-scatter-view/results-scatter-view.ts:234:9 - error TS2769: No overload matches this call.
Overload 1 of 4, '(name: string, value: null): Selection<SVGCircleElement, ValueItem, SVGGElement, ValueItem[]>', gave the following error.

the other components are getting built, but when it reaches result-view it gives an error.

Could you please help with this?

Breadcrumbs parsing issue

I noticed a problem in the parsing of the breadcrumbs in the latest version where the separator is surrounded by apostrophes. For example, a filter on the term Death from the facet Meddra will give me the following breadcrumb display: MedDra': 'Death.

While digging through the code to find the source of this display error, I realized that it might be a global issue on the processFormatMessage(message: string, values = {}) function in core\intl\intl.service.ts. The html produced by the function looks like this <span class="sq-field">MedDra</span>'<span class="sq-separator">: </span>'<span class="sq-value">Death</span> and the value passed to the formatter looks like this '<span class="sq-field">'{value0}'</span>''<span class="sq-separator">'{value1}'</span>''<span class="sq-value">'{value2}'</span>'.
So, looking at these, it feels like the double single-quotes are not treated correctly by the formatter, and one of the two quotes is not being deleted in the final message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.