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

Commit d0c4ff9

Browse files
JWittmeyerlumburovskalinaJWittmeyer
authored
Release updates (#98)
* Version number to 1.7.0 * Increases page size for bricks integrator * Adds open issue button * Disable upload existing project if no project attached * Removes notification center initialization from role != engeneer * No hover box on dashed line * Not changeable text for uploaded attributes * Active learning buttons and embeddings arrangement * Console error removed * Closing notifications modal when the link is clicked * Remove function templates * Top offset reduced on models downloaded page * Top offset reduced on dropdown on embeddings * Changed href to router link * Added classifiers to bricks integration on attribute calculation page * Labeling task as text in bricks integratior * Release updates Co-authored-by: Lina <lina.lumburovska@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai>
1 parent d6768f3 commit d0c4ff9

File tree

18 files changed

+141
-99
lines changed

18 files changed

+141
-99
lines changed

src/app/base/components/bricks-integrator/bricks-integrator.component.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="flex items-center">
22
<div class="tooltip tooltip-left" data-tip="Open the bricks integrator">
33
<label (click)="openBricksIntegrator()" id="bricks-integrator-open-button"
4-
class="cursor-pointer bg-white text-gray-700 text-xs font-semibold px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none">
4+
class="cursor-pointer bg-white text-gray-700 text-xs font-semibold whitespace-nowrap px-4 py-2 rounded-md border border-gray-300 hover:bg-gray-50 focus:outline-none">
55
Search in bricks
66
</label>
77
</div>
@@ -63,7 +63,7 @@
6363
<!-- Empty state, show/hide based on command palette state -->
6464
<ng-template [ngIf]="config.search.nothingMatches" [ngIfElse]="showResults">
6565

66-
<div class="py-14 px-6 text-center text-sm sm:px-14">
66+
<div class="py-6 px-6 text-center text-sm">
6767
<svg class="mx-auto h-6 w-6 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none"
6868
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
6969
<path stroke-linecap="round" stroke-linejoin="round"
@@ -75,8 +75,21 @@
7575
similarity search.</p>
7676
</ng-template>
7777
<ng-template #noResultsBackend>
78-
<p class="mt-4 font-semibold text-gray-900">No results found</p>
79-
<p class="mt-2 text-gray-500">No components found for this search term. Please try again.</p>
78+
<p class="mt-2 font-semibold text-gray-900">No results found</p>
79+
<p class="mt-2 text-gray-500">No components found for this search term.</p>
80+
<p class="mt-6 text-sm text-gray-500">Feel free to open an issue on GitHub if you think we
81+
should add it.</p>
82+
<a href="https://github.com/code-kern-ai/bricks/issues" target="_blank"
83+
rel="noopener noreferrer" type="button"
84+
class="mt-2 inline-flex items-center rounded-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none"><svg
85+
xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-gray-900 mr-2" width="24"
86+
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
87+
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
88+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
89+
<path
90+
d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5">
91+
</path>
92+
</svg>Open an issue on GitHub</a>
8093
</ng-template>
8194
</div>
8295
</ng-template>
@@ -260,12 +273,7 @@
260273
<label class="font-bold">Value</label>
261274
<ng-template [ngIf]="codeParser.labelingTaskName">
262275
<label class="text-sm col-start-1">Labeling Task</label>
263-
<kern-dropdown [dropdownOptions]="{
264-
optionArray:[],
265-
buttonCaption:codeParser.labelingTaskName,
266-
isDisabled:true
267-
}">
268-
</kern-dropdown>
276+
<span class="text-sm text-gray-500 font-normal">{{codeParser.labelingTaskName}}</span>
269277
</ng-template>
270278
<div class="contents" *ngFor="let v of codeParser.variables;let i = index">
271279
<label class="text-sm col-start-1">{{v.displayName}}</label>

src/app/base/components/bricks-integrator/bricks-integrator.component.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,21 @@ export class BricksIntegratorComponent implements OnInit, OnDestroy {
9090

9191
private buildSearchUrl(): string {
9292
let url = BricksIntegratorComponent.httpBaseLinkFilter;
93-
let filter = "";
94-
if (this.moduleTypeFilter) filter += (filter == "" ? '?' : '&') + "filters[moduleType][$eq]=" + this.moduleTypeFilter;
95-
if (this.executionTypeFilter) filter += (filter == "" ? '?' : '&') + "filters[executionType][$eq]=" + this.executionTypeFilter;
93+
let filter = "?pagination[pageSize]=99999";
94+
filter += this.extendUrl(this.moduleTypeFilter, "moduleType");
95+
filter += this.extendUrl(this.executionTypeFilter, "executionType");
9696
return url + filter;
9797
}
9898

99+
private extendUrl(value: string, attribute: string): string {
100+
if (!value) return "";
101+
let filter = "";
102+
const splitVal: string[] = value.split(',');
103+
for (let i = 0; i < splitVal.length; i++) {
104+
filter += "&filters[" + attribute + "][$eq]=" + splitVal[i].trim();
105+
}
106+
return filter;
107+
}
99108

100109
requestSearch(value: string = "") {
101110
this.config.search.requesting = true;

src/app/base/components/header/header.component.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@
155155
</div>
156156
</header>
157157

158-
<kern-modal [isOpen]="headerModals.notifications.open" [modalBoxStyle]="{'width':'45rem'}" closeButton="X"
159-
(optionClicked)="headerModals.notifications.open = false">
160-
<h1 class="text-lg text-gray-900 mb-2 font-bold text-center">Notification center</h1>
161-
<kern-notification-center></kern-notification-center>
162-
</kern-modal>
158+
<ng-template [ngIf]="user?.role == 'ENGINEER'">
159+
<kern-modal [isOpen]="headerModals.notifications.open" [modalBoxStyle]="{'width':'45rem'}" closeButton="X"
160+
(optionClicked)="headerModals.notifications.open = false">
161+
162+
<h1 class="text-lg text-gray-900 mb-2 font-bold text-center">Notification center</h1>
163+
<kern-notification-center (linkClicked)="headerModals.notifications.open = $event"></kern-notification-center>
164+
</kern-modal>
165+
</ng-template>

src/app/base/components/notification-center/notification-center.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<div class="ml-3 w-full">
9090
<div class="flex">
9191
<h3 class="{{'text-sm font-medium text-' + textColor +'-800'}}"><a class="underline"
92-
href="{{ notificationTypeList[0].docs }}" target="_blank"
92+
href="{{ notificationTypeList[0].docs }}" target="_blank" (click)="linkClicked.emit(false)"
9393
rel="noopener noreferrer">{{notificationTypeList[0].title}}</a>
9494
({{notificationTypeList[0].date}} <button *ngIf="notificationTypeList[0].projectId"
9595
(click)="navigateToProjectPage(notificationTypeList[0])" class="underline">

src/app/base/components/notification-center/notification-center.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, OnDestroy } from '@angular/core';
1+
import { Component, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';
22
import { NotificationApolloService } from 'src/app/base/services/notification/notification-apollo.service';
33
import { ProjectApolloService } from 'src/app/base/services/project/project-apollo.service';
44
import { Router } from '@angular/router';
@@ -34,6 +34,7 @@ export class NotificationCenterComponent implements OnInit, OnDestroy {
3434
setOutline: boolean = false;
3535
clickedNotificationId: string = null;
3636
static componentSingleton: NotificationCenterComponent = null;
37+
@Output() linkClicked = new EventEmitter<boolean>();
3738

3839
constructor(
3940
private auth: AuthApiService,
@@ -144,6 +145,7 @@ export class NotificationCenterComponent implements OnInit, OnDestroy {
144145

145146
navigateToProjectPage(notification): void {
146147
this.router.navigate(['projects', notification.projectId, notification.page]);
148+
this.linkClicked.emit(false);
147149
}
148150

149151
switchExpandedState(notification) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
<div class="flex-shrink-0 flex py-6 justify-center">
237237
<label data-tip="Version overview"
238238
(click)="requestVersionOverview(); sideBarPmModals.versionOverview.open = true;"
239-
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white flex items-center">v1.6.0
239+
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white flex items-center">v1.7.0
240240
<svg *ngIf="hasUpdates" xmlns="http://www.w3.org/2000/svg" data-tip="Newer version available"
241241
class="icon icon-tabler icon-tabler-alert-circle inline-block text-yellow-700 tooltip tooltip-right align-top ml-1"
242242
width="16" height="16" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"

src/app/model-download/components/model-download-component/model-download-component.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,13 @@
210210
(mouseleave)="setCurrentEmbeddingHandle(null)">
211211

212212
<label class="cursor-pointer label"
213-
[ngClass]="[checkIfModelIsDownloaded(modelHandle.configString) ? 'text-green-700' : '', k == downloadedModelsModals.addNewModel.indexSeparator ? 'line-separator' : '']"
213+
[ngClass]="[checkIfModelIsDownloaded(modelHandle.configString) ? 'text-green-700' : '']"
214214
(click)="selectEmbeddingHandle(modelHandle,inputEmbeddingHandle)">
215215
{{modelHandle.configString}}
216216
</label>
217+
218+
<hr class="my-1" *ngIf=" k == downloadedModelsModals.addNewModel.indexSeparator"
219+
(mouseenter)="setCurrentEmbeddingHandle(null)">
217220
</li>
218221
</ul>
219222
</div>
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
.line-separator {
2-
border-bottom: 1px gray dashed;
1+
hr {
2+
border: none;
3+
border-top: 1px dashed gray;
4+
color: #fff;
5+
background-color: #fff;
6+
height: 1px;
37
}
48

59
.height-dropdown {
6-
max-height: calc(100vh - 500px);
10+
max-height: 45vh;
711
}

src/app/model-download/components/model-download-component/model-download-component.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class ModelDownloadComponentComponent implements OnInit {
148148
this.downloadedModelsModals.deleteModel.currentModelHandle = modelHandle;
149149
if (modelHandle) {
150150
const dataBoundingBox: DOMRect = listElement.getBoundingClientRect();
151-
hoverBox.style.top = (dataBoundingBox.top) + "px"
151+
hoverBox.style.top = (dataBoundingBox.top - 60) + "px"
152152
hoverBox.style.left = (dataBoundingBox.left + dataBoundingBox.width) + "px"
153153
}
154154
}

src/app/project-overview/components/project-overview/project-overview.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ <h2 class="text-3xl font-bold tracking-tight text-white sm:text-4xl">
293293
version in
294294
the cloud, as well as an enterprise solution for on-premises deployment.
295295
</p>
296-
<a href="./users"
296+
<a [routerLink]="['/users']"
297297
class="mt-8 inline-flex items-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 shadow hover:bg-indigo-50">See
298298
our options</a>
299299
</div>

src/app/project-overview/components/project-overview/project-overview.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class ProjectOverviewComponent implements OnInit, OnDestroy {
342342
dataSliceId
343343
).pipe(first()).subscribe((labelDist) => {
344344
this.labelDistribution = this.matchAndMergeLabelDistributionData(labelDist);
345-
this.graphsHaveValues = labelDist.length > 0;
345+
this.graphsHaveValues = labelDist?.length > 0;
346346
});
347347
}
348348

@@ -360,6 +360,7 @@ export class ProjectOverviewComponent implements OnInit, OnDestroy {
360360

361361
private matchAndMergeLabelDistributionData(data) {
362362
let returnData = [];
363+
if (!data) return returnData;
363364
data.forEach(e => {
364365
let found = returnData.find(x => x.labelId == e.id);
365366
if (!found) {
@@ -393,7 +394,7 @@ export class ProjectOverviewComponent implements OnInit, OnDestroy {
393394
labelingTaskId,
394395
dataSlice
395396
).pipe(first()).subscribe((values) => {
396-
this.confusionMatrix = values.map(e => {
397+
this.confusionMatrix = values?.map(e => {
397398
return {
398399
counts: e.count_absolute,
399400
labelIdManual: e.label_name_manual == '@@OUTSIDE@@' ? 'Outside' : e.label_name_manual,

src/app/projects/components/create-new-attribute/create-new-attribute.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<div class="text-sm leading-5 font-medium text-gray-700 inline-block mr-2">Editor</div>
123123
<div class="flex flex-row flex-nowrap">
124124
<kern-bricks-integrator (preparedCode)="codeFormCtrl.setValue($event);isInitial=false"
125-
moduleTypeFilter="generator">
125+
moduleTypeFilter="generator,classifier">
126126
</kern-bricks-integrator>
127127
<div class="tooltip tooltip-left" data-tip="See available libraries for this attribute calculation">
128128

src/app/projects/components/project-settings/project-settings.component.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<td class="text-center px-3 py-2 text-sm text-gray-500">
106106
<button type="button"
107107
[routerLink]="['../attributes/' + attributeContainer.get('id').value]"
108-
*ngIf="attributeContainer.get('userCreated').value"
108+
*ngIf="attributeContainer.get('userCreated').value; else notChangeable"
109109
class="text-green-800 text-sm font-medium">
110110
<span class="leading-5">Details</span>
111111
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 inline-block"
@@ -114,6 +114,9 @@
114114
d="M13 7l5 5m0 0l-5 5m5-5H6" />
115115
</svg>
116116
</button>
117+
<ng-template #notChangeable>
118+
<label class="text-gray-500 italic">Not changeable</label>
119+
</ng-template>
117120
</td>
118121
</tr>
119122
</tbody>
@@ -967,7 +970,8 @@
967970
(keydown.enter)="selectFirstUnhiddenEmbeddingHandle(inputEmbeddingHandle)"
968971
(input)="checkEmbeddingHandles($event.target)">
969972
</div>
970-
<ul tabindex="0" class="p-2 w-full menu dropdown-content bg-base-100 shadow max-h-80 overflow-y-auto">
973+
<ul tabindex="0"
974+
class="p-2 w-full menu dropdown-content bg-base-100 shadow height-dropdown overflow-y-auto">
971975
<li #me *ngFor="let embeddingHandle of suggestions; let k = index"
972976
[ngClass]="embeddingHandle.hidden || embeddingHandle.forceHidden?'hidden':null"
973977
(mouseenter)="setCurrentEmbeddingHandle(embeddingHandle,hoverBox,me)"

src/app/projects/components/project-settings/project-settings.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@
3535

3636
.rotate_transform_270 svg {
3737
transform: rotate(270deg);
38+
}
39+
40+
.height-dropdown {
41+
max-height: calc(45vh - 50px);
3842
}

src/app/projects/components/project-settings/project-settings.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ export class ProjectSettingsComponent implements OnInit, OnDestroy, AfterViewIni
684684
this.settingModals.embedding.create.currentEmbeddingHandle = embeddingHandle;
685685
if (embeddingHandle) {
686686
const dataBoundingBox: DOMRect = listElement.getBoundingClientRect();
687-
hoverBox.style.top = (dataBoundingBox.top) + "px"
687+
hoverBox.style.top = (dataBoundingBox.top - 60) + "px"
688688
hoverBox.style.left = (dataBoundingBox.left + dataBoundingBox.width) + "px"
689689
}
690690
}

src/app/projects/components/projects/projects.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="h-screen bg-gray-100 flex overflow-hidden">
2-
<kern-sidebar-pm (firstName)="getFirstName($event)">
2+
<kern-sidebar-pm (firstName)="setFirstName($event)">
33
</kern-sidebar-pm>
44
<!-- Content area -->
55
<div class="h-full w-full flex-1 flex flex-col overflow-hidden">
@@ -349,7 +349,7 @@
349349
<kern-modal [isOpen]="projectsModals.uploadProject.open" closeButton="X" [modalBoxStyle]="{'width':'35rem'}"
350350
[acceptButton]="{
351351
closeAfterClick:false,
352-
disabled:projectsModals.uploadProject.doingSomething,
352+
disabled:projectsModals.uploadProject.doingSomething || !file,
353353
buttonCaption:'Upload'
354354
}" (optionClicked)="$event == 'CLOSE'?projectsModals.uploadProject.open = false:importExistingProject();">
355355
<h1 class="flex flex-grow justify-center text-lg text-gray-900 font-bold">Upload Project Data
@@ -359,7 +359,7 @@ <h1 class="flex flex-grow justify-center text-lg text-gray-900 font-bold">Upload
359359
</div>
360360
<div>
361361
<kern-upload *ngIf="projectsModals.uploadProject.open" [projectId]="null" [init]="true"
362-
(fileAttached)="getFile($event)">
362+
(fileAttached)="setFile($event)">
363363
</kern-upload>
364364
</div>
365365
</kern-modal>

src/app/projects/components/projects/projects.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ export class ProjectsComponent implements OnInit, OnDestroy {
313313
}
314314
}
315315

316-
getFirstName(userName) {
316+
setFirstName(userName) {
317317
this.user$ = userName;
318318
}
319319

320-
getFile(file: File) {
320+
setFile(file: File) {
321321
this.file = file;
322322
}
323323

0 commit comments

Comments
 (0)