Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit bd81771

Browse files
lumburovskalinaFelixKirschKernJWittmeyerSirDegrafJWittmeyer
authored
Release updates (#87)
* Version number to 1.5.1 * fixes different button sizes on data browser page * adds cursor pointer to case-sensitive checkbox on data browser page * Adds cancel option to zero shot run * New attributes reset name fixed * Removes fixed width from settings modals for task & embedding creation * Adds info for proejct without knowledge bases * Removes cancel project creation form issue * Adds restriction for to_names without equivalent * Removes checkbox for prioritizeExisting in Label Studio import if it is project creation * Added notice to take a look into restrictions * Filter text preserved on change fix * Removes duplicated tooltip for record ide run button * Remove websocket logs from console * Scrollable only part with labeling tasks on heuristics overview * Max height fixed for dropdown with names on models downloaded page * Changes link to sales ocntact * Adds save & load buttons for record ide * Change tooltip of crowd labeling icon on heuristic * Prevents capitalized kexcodes for hotkeys * Build optimizer set to true * Modal when resizing screen * Padding bottom for filter block * Version number changed from 1.5.1 to 1.6.0 * Notifications are not truncated anymore * Adds route highlight logic to route manager * Should solve redirect issue * Compilation for production reverted * Set fullrecord to null to prevent flickering * Fix issue flickering * Modal resizing * Readds fix for cursor repositionng in ac * label renaming findings * Finalch changes for test finidngs Co-authored-by: felix0496 <felix.kirsch@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Co-authored-by: SirDeGraf <simon.degraf@icloud.com> Co-authored-by: root <root@LAPTOP-Q0DKKSQ0.localdomain>
1 parent 65bf36d commit bd81771

30 files changed

+406
-181
lines changed

angular.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,12 @@
6161
}
6262
],
6363
"optimization": true,
64-
"outputHashing": "none",
65-
"sourceMap": true,
64+
"outputHashing": "all",
65+
"sourceMap": false,
6666
"namedChunks": false,
67-
"showCircularDependencies": false,
68-
"aot": true,
69-
"extractLicenses": false,
70-
"statsJson": false,
71-
"progress": false,
67+
"extractLicenses": true,
7268
"vendorChunk": false,
73-
"buildOptimizer": false,
74-
"subresourceIntegrity": false,
69+
"buildOptimizer": true,
7570
"budgets": [
7671
{
7772
"type": "initial",

src/app/app.component.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<div class="h-screen bg-gray-50 flex flex-col overflow-hidden">
1+
<div class="h-screen bg-gray-50 flex flex-col overflow-hidden"
2+
[ngStyle]="{'width':windowWidth < minWidth ?minWidth+'px':'100%', 'overflow-x':windowWidth < minWidth? 'auto': 'hidden'}">
23
<router-outlet></router-outlet>
34
</div>
45

5-
<div class="absolute flex flex-col z-50 bottom-0 lg:left-24 left-2 mb-7 content-start">
6+
<div class="absolute flex flex-col z-50 bottom-0 left-24 mb-7 content-start">
67
<div *ngFor="let notification of notificationList">
78

89
<div *ngIf="notification.level === 'INFO'">
@@ -76,4 +77,16 @@
7677
</div>
7778
</div>
7879
</div>
79-
</div>
80+
</div>
81+
<kern-modal [isOpen]="sizeWarningOpen" [acceptButton]="{
82+
buttonCaption:'Continue'}" [modalBoxStyle]="{'width':'600px'}">
83+
<div class="flex flex-row justify-center text-lg leading-6 text-gray-900 font-medium mb-2">
84+
Information </div>
85+
86+
<div class="mt-3 flex flex-row justify-between">
87+
<div class="flex flex-row-reverse justify-start text-sm">
88+
The application is designed for certain screen sizes (> {{minWidth}}px width). If you continue, the
89+
application is provided with a global scrollbar.
90+
</div>
91+
</div>
92+
</kern-modal>

src/app/app.component.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnDestroy, OnInit } from '@angular/core';
1+
import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostListener, OnDestroy, OnInit, ViewChild } from '@angular/core';
22
import { Subscription, timer } from 'rxjs';
33
import { NotificationApolloService } from './base/services/notification/notification-apollo.service';
44
import { interval } from 'rxjs';
@@ -18,8 +18,9 @@ import { RouteManager } from './util/route-manager';
1818
selector: 'app-root',
1919
templateUrl: './app.component.html',
2020
styleUrls: ['./app.component.scss'],
21+
changeDetection: ChangeDetectionStrategy.OnPush,
2122
})
22-
export class AppComponent implements OnDestroy, OnInit {
23+
export class AppComponent implements OnDestroy, OnInit, AfterViewInit {
2324
test = false;
2425
title = 'kern-frontspine';
2526
notificationList: any = [];
@@ -30,6 +31,9 @@ export class AppComponent implements OnDestroy, OnInit {
3031
notificationsSub$: any;
3132
notificationsQuery$: any;
3233
refetchTimer: any;
34+
windowWidth: number;
35+
sizeWarningOpen: boolean = false;
36+
minWidth: number = 1250;
3337

3438
constructor(
3539
private notificationApolloService: NotificationApolloService,
@@ -38,6 +42,7 @@ export class AppComponent implements OnDestroy, OnInit {
3842
private configService: ConfigApolloService,
3943
private router: Router,
4044
private http: HttpClient,
45+
private cfRef: ChangeDetectorRef
4146
) { }
4247

4348
ngOnInit(): void {
@@ -51,6 +56,14 @@ export class AppComponent implements OnDestroy, OnInit {
5156
this.checkBrowser();
5257
}
5358

59+
ngAfterViewInit() {
60+
this.onResize();
61+
}
62+
63+
ngAfterViewChecked() {
64+
this.cfRef.detectChanges();
65+
}
66+
5467
initialRequests() {
5568
CommentDataManager.initManager(this.organizationService);
5669
RouteManager.initRouteManager(this.router, this.organizationService);
@@ -177,5 +190,15 @@ export class AppComponent implements OnDestroy, OnInit {
177190
}
178191
}
179192

193+
@HostListener('window:resize', ['$event'])
194+
onResize() {
195+
this.windowWidth = window.innerWidth;
196+
if (window.innerWidth < this.minWidth) {
197+
this.sizeWarningOpen = true;
198+
} else {
199+
this.sizeWarningOpen = false;
200+
}
201+
}
202+
180203

181204
}

src/app/base/components/sidebar-pm/sidebar-pm.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
</div>
216216
<div class="flex-shrink-0 flex py-6 justify-center">
217217
<label data-tip="Version overview" for="version-overview" (click)="requestVersionOverview()"
218-
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white flex items-center">v1.5.0
218+
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white flex items-center">v1.6.0
219219
<svg *ngIf="hasUpdates" xmlns="http://www.w3.org/2000/svg" data-tip="Newer version available"
220220
class="icon icon-tabler icon-tabler-alert-circle inline-block text-yellow-700 tooltip tooltip-right align-top ml-1"
221221
width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"

src/app/base/components/sidebar-pm/sidebar-pm.component.ts

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ProjectApolloService } from '../../services/project/project-apollo.serv
1616
import { ConfigApolloService } from '../../services/config/config-apollo.service';
1717
import { dateAsUTCDate } from 'src/app/util/helper-functions';
1818
import { ConfigManager } from '../../services/config-service';
19+
import { RouteManager } from 'src/app/util/route-manager';
1920

2021

2122
@Component({
@@ -68,22 +69,12 @@ export class SidebarPmComponent implements OnInit, OnDestroy {
6869
hasUpdates: boolean;
6970
private static initialConfigRequest: boolean = false;
7071

71-
// model-download isn't checked for since the page is accessed from different routes
72-
// e.g. lastPage=settings => settings is checked for so settings is highlighted
73-
routeColor = {
74-
overview: { active: false, checkFor: ['overview'] },
75-
data: { active: false, checkFor: ['data'] },
76-
labeling: { active: false, checkFor: ['labeling', 'record-ide'] },
77-
heuristics: { active: false, checkFor: ['heuristics', 'lookup-lists', 'model-callbacks', 'zero-shot', 'crowd-labeler'] },
78-
settings: { active: false, checkFor: ['settings', 'attributes', 'add'] },
79-
}
80-
72+
routeColor: any;
8173

8274
constructor(
8375
private organizationService: OrganizationApolloService,
8476
private activatedRoute: ActivatedRoute,
8577
private auth: AuthApiService,
86-
private router: Router,
8778
private projectApolloService: ProjectApolloService,
8879
private configService: ConfigApolloService,
8980
@Inject(DOCUMENT) private document: any
@@ -100,7 +91,6 @@ export class SidebarPmComponent implements OnInit, OnDestroy {
10091
}
10192

10293
this.firstName.emit(this.user$);
103-
this.checkRouteHighlight(this.router.url);
10494
this.logoutUrl$ = this.auth.getLogoutOut();
10595
this.subscriptions$.push(this.organizationService
10696
.getUserOrganization()
@@ -116,26 +106,8 @@ export class SidebarPmComponent implements OnInit, OnDestroy {
116106
SidebarPmComponent.initialConfigRequest = true;
117107
}
118108
this.checkIfManagedVersion();
119-
this.initRouterListener();
120-
121-
}
109+
this.routeColor = RouteManager.routeColor;
122110

123-
initRouterListener() {
124-
this.subscriptions$.push(this.router.events.subscribe((val) => {
125-
if (val instanceof RoutesRecognized) {
126-
const values = { old: this.router.url, new: val.url };
127-
if (values.old != values.new) {
128-
this.checkRouteHighlight(val.url);
129-
}
130-
}
131-
}));
132-
133-
}
134-
135-
checkRouteHighlight(url: string) {
136-
for (const key in this.routeColor) {
137-
this.routeColor[key].active = this.routeColor[key].checkFor.some(s => url.includes(s));
138-
}
139111
}
140112

141113
requestVersionOverview() {

src/app/base/components/upload-assistant/label-studio/label-studio-assistant.component.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
<label
2222
class="bg-gray-100 text-gray-800 rounded-lg text-xs px-2.5 py-0.5 cursor-default border border-gray-300">Beta</label>
2323
</div>
24+
<div class="flex flex-row items-center justify-center gap-x-2">
25+
<span class="text-sm leading-6 text-gray-900 font-medium">
26+
Please take a look into the restrictions
27+
</span>
28+
</div>
2429

2530

2631
<div class="flex justify-center">
@@ -64,7 +69,8 @@
6469
<div class="whitespace-nowrap">External User: {{annotations.key}}</div>
6570
<div class="whitespace-nowrap">Annotations: {{annotations.value}}</div>
6671
</div>
67-
<div *ngIf="info.errors.length==0" class="flex items-center col-span-full cursor-pointer tooltip"
72+
<div *ngIf="info.errors.length==0 && isProjectAdd"
73+
class="flex items-center col-span-full cursor-pointer tooltip"
6874
[attr.data-tip]="'If a record already has a user annotation it will be ' + (mappings.prioritizeExisting? 'preserved':'removed')"
6975
(click)="states.preparation == PreparationStepType.MAPPING_TRANSFERRED?null:mappings.prioritizeExisting=!mappings.prioritizeExisting">
7076
<input type="checkbox"
@@ -330,6 +336,19 @@ <h3 class="text-sm font-semibold text-gray-800">
330336
</p>
331337
</div>
332338
</li>
339+
<li class="py-5">
340+
<div class="relative">
341+
<h3 class="text-sm font-semibold text-gray-800">
342+
Attribute specific tasks - name equivalent
343+
</h3>
344+
<p class="mt-1 text-sm text-gray-600">If you want to create attribute specific labeling tasks, the
345+
"to_name"
346+
in the annotations of your file needs to be set to the attributes equivalent in records data. If
347+
for an "to_name" no
348+
equivalent attribute name is found, the labeling task gets created as a full record task.
349+
</p>
350+
</div>
351+
</li>
333352
</ul>
334353

335354
</div>

src/app/base/services/notification.service.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class NotificationService {
2020
private notifications = new Subject<UserNotification[]>();
2121
private ws_subject;
2222

23-
private static registedNotificationListeners: Map<string, Map<Object, NotificationSubscription>> = new Map<string, Map<Object, NotificationSubscription>>();
23+
private static registeredNotificationListeners: Map<string, Map<Object, NotificationSubscription>> = new Map<string, Map<Object, NotificationSubscription>>();
2424

2525
private timeOutIteration: number = 0;
2626

@@ -63,8 +63,6 @@ export class NotificationService {
6363
closeObserver: {
6464
next: (closeEvent) => {
6565
const timeout = this.getTimeout(this.timeOutIteration);
66-
console.log("Websocket closed", closeEvent);
67-
console.log("Trying to reconnect in " + timeout + " ms");
6866
timer(timeout).subscribe(() => { this.timeOutIteration++; this.initWsNotifications(); })
6967
}
7068
}
@@ -92,7 +90,7 @@ export class NotificationService {
9290
}
9391

9492
private handleWebsocketNotificationMessage(msg: string) {
95-
if (NotificationService.registedNotificationListeners.size == 0) return;
93+
if (NotificationService.registeredNotificationListeners.size == 0) return;
9694
if (msg.includes("\n")) {
9795
msg.split("\n").forEach(element => this.handleWebsocketNotificationMessage(element));
9896
return;
@@ -101,9 +99,9 @@ export class NotificationService {
10199

102100
const msgParts = msg.split(":");
103101
const projectId = msgParts[0];
104-
if (!NotificationService.registedNotificationListeners.has(projectId)) return;
102+
if (!NotificationService.registeredNotificationListeners.has(projectId)) return;
105103

106-
NotificationService.registedNotificationListeners.get(projectId).forEach((params, key) => {
104+
NotificationService.registeredNotificationListeners.get(projectId).forEach((params, key) => {
107105
if (!params.whitelist || params.whitelist.includes(msgParts[1])) {
108106
params.func.call(key, msgParts);
109107
}
@@ -113,17 +111,17 @@ export class NotificationService {
113111

114112
public static subscribeToNotification(key: Object, params: NotificationSubscription) {
115113
if (!params.projectId) params.projectId = "GLOBAL";
116-
if (!NotificationService.registedNotificationListeners.has(params.projectId)) {
117-
NotificationService.registedNotificationListeners.set(params.projectId, new Map<Object, NotificationSubscription>());
114+
if (!NotificationService.registeredNotificationListeners.has(params.projectId)) {
115+
NotificationService.registeredNotificationListeners.set(params.projectId, new Map<Object, NotificationSubscription>());
118116
}
119-
const innerMap = NotificationService.registedNotificationListeners.get(params.projectId);
117+
const innerMap = NotificationService.registeredNotificationListeners.get(params.projectId);
120118
innerMap.set(key, params);
121119
}
122120

123121
public static unsubscribeFromNotification(key: Object, projectId: string = null) {
124122
if (!projectId) projectId = "GLOBAL"
125-
if (NotificationService.registedNotificationListeners.has(projectId)) {
126-
NotificationService.registedNotificationListeners.get(projectId).delete(key);
123+
if (NotificationService.registeredNotificationListeners.has(projectId)) {
124+
NotificationService.registeredNotificationListeners.get(projectId).delete(key);
127125
}
128126
}
129127

src/app/base/services/weak-source/weak-source-apollo.service.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ export class WeakSourceApolloService {
155155
}
156156
});
157157
}
158+
cancelZeroShotRun(projectId: string, informationSourceId: string, payloadId: string) {
159+
return this.apollo.mutate({
160+
mutation: mutations.CANCEL_ZERO_SHOT_RUN,
161+
variables: {
162+
projectId: projectId,
163+
informationSourceId: informationSourceId,
164+
payloadId: payloadId,
165+
}
166+
});
167+
}
168+
169+
158170

159171
getInformationSourcesOverviewData(projectId: string) {
160172
const query = this.apollo

src/app/base/services/weak-source/weak-source-mutations.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ export const mutations = {
8989
}
9090
}
9191
92+
`,
93+
CANCEL_ZERO_SHOT_RUN: gql`
94+
mutation ($projectId: ID!, $informationSourceId: ID!, $payloadId: ID!) {
95+
cancelZeroShotRun(projectId: $projectId, informationSourceId: $informationSourceId, payloadId: $payloadId) {
96+
ok
97+
}
98+
}
9299
`,
93100

94101
SET_ALL_INFORMATION_SOURCES: gql`

src/app/data/components/data-browser/data-browser.component.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,11 @@
282282
</div>
283283

284284
<label
285-
class="text-xs text-gray-500 cursor-pointer flex items-center"
285+
class="text-xs text-gray-500 cursor-pointer flex items-center pb-2"
286286
*ngIf="groupItem.get('operator').value == 'BEGINS WITH' || groupItem.get('operator').value == 'ENDS WITH' || groupItem.get('operator').value == 'CONTAINS' || groupItem.get('operator').value == 'IN WC'">
287287
<input type="checkbox"
288-
formControlName="caseSensitive" class="mr-1">
288+
formControlName="caseSensitive"
289+
class="mr-1 cursor-pointer">
289290
Case sensitive
290291
</label>
291292
</div>
@@ -863,10 +864,10 @@
863864
</ng-template>
864865
<div class="flex items-center">
865866
<button *ngIf="activeSlice || activeSearchParams.length > 0 || similarSearchHelper.recordsInDisplay"
866-
class="mr-1 inline-flex items-center px-2.5 py-1.5 border border-gray-200 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 cursor-pointer"
867+
class="mr-1 inline-flex items-center px-2.5 py-2 border border-gray-300 shadow-sm text-xs font-semibold rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none cursor-pointer"
867868
(click)="clearFilters()">
868869
<svg xmlns="http://www.w3.org/2000/svg" class="mr-2 icon icon-tabler icon-tabler-filter-off"
869-
width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
870+
width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"
870871
fill="none" stroke-linecap="round" stroke-linejoin="round">
871872
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
872873
<line x1="3" y1="3" x2="21" y2="21"></line>
@@ -881,9 +882,9 @@
881882
<div data-tip="Change the data browser configurations"
882883
class="tooltip tooltip-left relative flex items-center">
883884
<label for="config-modal"
884-
class=" opacity-100 cursor-pointer mr-1 inline-flex items-center px-2.5 py-1.5 border border-gray-200 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 cursor-pointer">
885+
class="cursor-pointer mr-1 inline-flex items-center px-2.5 py-2 border border-gray-300 shadow-sm text-xs font-semibold rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none">
885886
<svg xmlns="http://www.w3.org/2000/svg"
886-
class="mr-2 icon icon-tabler icon-tabler-adjustments inline-block" width="20" height="20"
887+
class="mr-2 icon icon-tabler icon-tabler-adjustments inline-block" width="16" height="16"
887888
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
888889
stroke-linecap="round" stroke-linejoin="round">
889890
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>

src/app/data/components/data-browser/data-browser.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,13 +2044,18 @@ export class DataBrowserComponent implements OnInit, OnDestroy {
20442044

20452045
selectValueDropdown(value: string, i: number, field: string, key: any) {
20462046
const formControlsIdx = this.getSearchFormArray(key).controls[i];
2047-
const prevOperator = formControlsIdx.get('operator').value;
20482047
formControlsIdx.get(field).setValue(value);
2049-
if (field == 'name' || prevOperator == SearchOperator.IN || prevOperator == "IN WC") {
2048+
if (field == 'name') {
2049+
const attributeType = getAttributeType(this.attributesSortOrder, value);
20502050
this.saveDropdonwAttribute = value;
2051-
if (formControlsIdx.get("searchValue").value != "") {
2051+
if (attributeType == "BOOLEAN" && formControlsIdx.get("searchValue").value != "") {
20522052
formControlsIdx.get("searchValue").setValue("");
20532053
formControlsIdx.get("searchValueBetween").setValue("");
2054+
} else if (attributeType == 'INTEGER' || attributeType == 'FLOAT') {
2055+
if (isNaN(parseInt(formControlsIdx.get('searchValue').value))) {
2056+
formControlsIdx.get("searchValue").setValue("");
2057+
formControlsIdx.get("searchValueBetween").setValue("");
2058+
}
20542059
}
20552060
}
20562061
this.searchOperatorDropdownArray = [];

0 commit comments

Comments
 (0)