From ab81a81bd4ff9756fcef72e54cbdc83a8938a0ec Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Tue, 23 Aug 2022 13:32:17 +0200 Subject: [PATCH 1/8] Checks for demo flag for local org creation --- .../projects/components/projects/projects.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/projects/components/projects/projects.component.ts b/src/app/projects/components/projects/projects.component.ts index 00c78085..7f72c201 100644 --- a/src/app/projects/components/projects/projects.component.ts +++ b/src/app/projects/components/projects/projects.component.ts @@ -128,7 +128,7 @@ export class ProjectsComponent implements OnInit, OnDestroy { this.isManaged = ConfigManager.getIsManaged(); } }); - this.checkIfDemoUser(); + this.checkIfDemoUser(); } checkIfDemoUser() { @@ -145,7 +145,7 @@ export class ProjectsComponent implements OnInit, OnDestroy { return; } this.isManaged = ConfigManager.getIsManaged(); - if (!this.isManaged) { + if (!this.isManaged && !ConfigManager.getIsDemo()) { this.subscriptions$.push(this.organizationApolloService.canCreateLocalOrg().pipe(first()).subscribe((canCreateOrg) => { this.canCreateOrg = canCreateOrg; @@ -342,10 +342,10 @@ export class ProjectsComponent implements OnInit, OnDestroy { } executeOption(value: string) { - if(value=='Further sample projects') { + if (value == 'Further sample projects') { window.open("https://github.com/code-kern-ai/refinery-sample-projects", "_blank"); } else { - this.importSampleProject(this.isProjectInitial ? this.previousValue+' - initial' : value) + this.importSampleProject(this.isProjectInitial ? this.previousValue + ' - initial' : value) } } From 5d86811c73d265f28bf613144be72bf4b3ca7a77 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Tue, 23 Aug 2022 13:50:26 +0200 Subject: [PATCH 2/8] Adds timeout for databrowser alert --- .../data/components/data-browser/data-browser.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/data/components/data-browser/data-browser.component.ts b/src/app/data/components/data-browser/data-browser.component.ts index 559d8243..7df3d58e 100644 --- a/src/app/data/components/data-browser/data-browser.component.ts +++ b/src/app/data/components/data-browser/data-browser.component.ts @@ -182,6 +182,8 @@ export class DataBrowserComponent implements OnInit, OnDestroy { currentSearchRequest: CurrentSearchRequest; + alertLastVisible: number; + getSearchFormArray(groupKey: string): FormArray { return this.fullSearch.get(groupKey).get('groupElements') as FormArray; } @@ -1440,7 +1442,7 @@ export class DataBrowserComponent implements OnInit, OnDestroy { } else return; if (this.filteredSliceIds.has(idToDelete)) this.filteredSliceIds.delete(idToDelete); - this.projectApolloService.deleteDataSlice(this.projectId, idToDelete).pipe(first()).subscribe(() => this.clearFilters()); + this.projectApolloService.deleteDataSlice(this.projectId, idToDelete).pipe(first()).subscribe(() => this.clearFilters()); } filterAvailableSlices() { @@ -1909,7 +1911,10 @@ export class DataBrowserComponent implements OnInit, OnDestroy { } alterUser(msgId) { + console.log(Date.now()) + if (this.alertLastVisible && Date.now() - this.alertLastVisible < 1000) return; alert("Settings were changed (msgId: " + msgId + ")\nFilter will be reloaded."); + this.alertLastVisible = Date.now(); } websocketFilterRefresh(currentFilterData: string) { From 0169c9daef74f532bf5a21dde1c53788157bb498 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Tue, 23 Aug 2022 13:56:38 +0200 Subject: [PATCH 3/8] Adds chrome check --- src/app/app.component.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9a41aa8f..f3bf4a60 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -45,6 +45,7 @@ export class AppComponent implements OnDestroy, OnInit { }); this.initializeNotificationService(); this.initWithConfigManager(); + this.checkBrowser(); } initalRequests() { @@ -175,4 +176,18 @@ export class AppComponent implements OnDestroy, OnInit { ConfigManager.refreshConfig(); } } + + checkBrowser() { + const wasChecked = localStorage.getItem("browser_info_checked"); + if (!wasChecked) { + const agent = window.navigator.userAgent; + if (!(agent.indexOf("Chrome/") != -1 && agent.indexOf("Chromium/") == -1) || agent.indexOf("Edg/") != -1) { + const t = "This application was built with chrome. Some things might look differnt than expected.\n\nFor the best experience we recommend using chrome." + alert(t); + } + localStorage.setItem("browser_info_checked", "1"); + } + } + + } From e180f511b24cdc71d71570a21ce3d6a38874ba22 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Tue, 23 Aug 2022 14:17:49 +0200 Subject: [PATCH 4/8] Adds star button with call to action --- .../components/header/header.component.html | 25 +++++------ .../components/header/header.component.scss | 45 +++++++++++++++++++ 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/app/base/components/header/header.component.html b/src/app/base/components/header/header.component.html index 18ce1a2f..19848fa9 100644 --- a/src/app/base/components/header/header.component.html +++ b/src/app/base/components/header/header.component.html @@ -83,27 +83,24 @@ - - - - - - - +
diff --git a/src/app/base/components/header/header.component.scss b/src/app/base/components/header/header.component.scss index e69de29b..ad796e77 100644 --- a/src/app/base/components/header/header.component.scss +++ b/src/app/base/components/header/header.component.scss @@ -0,0 +1,45 @@ +.widget-lg .btnx, +.widget-lg .social-count { + padding: 5px 10px; + font-size: 12px; + line-height: 16px; +} + +.btnx:not(:last-child) { + border-radius: 0.25em 0 0 0.25em; +} + +.btnx { + color: #24292f; + background-color: #ebf0f4; + border-color: #ccd1d5; + border-color: rgba(27, 31, 36, .15); + background-image: -moz-linear-gradient(top, #f6f8fa, #ebf0f4 90%); + background-image: linear-gradient(180deg, #f6f8fa, #ebf0f4 90%); + filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF6F8FA', endColorstr='#FFEAEFF3'); +} + +.btnx { + border-radius: 0.25em; +} + +.btnx, +.social-count { + position: relative; + display: inline-flex; + padding: 2px 5px; + font-size: 11px; + font-weight: 600; + line-height: 14px; + vertical-align: bottom; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-repeat: repeat-x; + background-position: -1px -1px; + background-size: 110% 110%; + border: 1px solid; + margin-right: 1rem; +} \ No newline at end of file From 1dabff42c61e2edc2dfaec65a89bcdb0f843c842 Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Tue, 23 Aug 2022 14:35:53 +0200 Subject: [PATCH 5/8] Fixes no label AND filter bug --- .../data-browser/helper-classes/filter-parser.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/data/components/data-browser/helper-classes/filter-parser.ts b/src/app/data/components/data-browser/helper-classes/filter-parser.ts index 2141d931..5cfd78f4 100644 --- a/src/app/data/components/data-browser/helper-classes/filter-parser.ts +++ b/src/app/data/components/data-browser/helper-classes/filter-parser.ts @@ -89,7 +89,6 @@ export class DataBrowserFilterParser { array: any[], drillDown: boolean = false ): any { - if (drillDown) { for (const l of array) { this.appendBlackAndWhiteListUserForArray(appendTo, [l], false); @@ -208,12 +207,16 @@ export class DataBrowserFilterParser { appendTo: string[], array: any[], labelSource: LabelSource, - drillDown: boolean = false + drillDown: boolean = false, + onlyNoLabel: boolean = false //for recursion of NO_LABEL only ): any { - if (drillDown) { for (const l of array) { - this.appendBlackAndWhiteListLabelingTaskForArray(appendTo, [l], labelSource, false); + if (l.id == 'NO_LABEL') { + this.appendBlackAndWhiteListLabelingTaskForArray(appendTo, array, labelSource, false, true); + } else { + this.appendBlackAndWhiteListLabelingTaskForArray(appendTo, [l], labelSource, false); + } } return; } @@ -233,7 +236,7 @@ export class DataBrowserFilterParser { for (let c of array) { if (c.active) { if (c.id == 'NO_LABEL') addNoLabel = true; - else { + else if (!onlyNoLabel) { if (c.negate) notInValues.push(c.id); else inValues.push(c.id); } From fa373d58c8369fc671b55cff90127539581a7e5a Mon Sep 17 00:00:00 2001 From: felix0496 Date: Wed, 24 Aug 2022 10:10:58 +0200 Subject: [PATCH 6/8] increases version to v1.1.1 --- src/app/base/components/sidebar-pm/sidebar-pm.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/base/components/sidebar-pm/sidebar-pm.component.html b/src/app/base/components/sidebar-pm/sidebar-pm.component.html index 95a4f931..f5f52b23 100644 --- a/src/app/base/components/sidebar-pm/sidebar-pm.component.html +++ b/src/app/base/components/sidebar-pm/sidebar-pm.component.html @@ -194,7 +194,7 @@
v1.1 + href="https://docs.kern.ai/changelog">v1.1.1
From 70fc99fe283b75eb3c72912170adfffe1502c307 Mon Sep 17 00:00:00 2001 From: Felix Kirsch <40427105+FelixKirsch@users.noreply.github.com> Date: Wed, 24 Aug 2022 10:18:48 +0200 Subject: [PATCH 7/8] Fix typo in browser check --- src/app/app.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f3bf4a60..54ef1892 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -182,7 +182,7 @@ export class AppComponent implements OnDestroy, OnInit { if (!wasChecked) { const agent = window.navigator.userAgent; if (!(agent.indexOf("Chrome/") != -1 && agent.indexOf("Chromium/") == -1) || agent.indexOf("Edg/") != -1) { - const t = "This application was built with chrome. Some things might look differnt than expected.\n\nFor the best experience we recommend using chrome." + const t = "This application was built with chrome. Some things might look different than expected.\n\nFor the best experience we recommend using chrome." alert(t); } localStorage.setItem("browser_info_checked", "1"); From 654106a4341ef0efadae03eeb2d047b833755043 Mon Sep 17 00:00:00 2001 From: Lina Date: Wed, 24 Aug 2022 10:32:49 +0200 Subject: [PATCH 8/8] Removed console log --- src/app/data/components/data-browser/data-browser.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/data/components/data-browser/data-browser.component.ts b/src/app/data/components/data-browser/data-browser.component.ts index 7df3d58e..8701c8bd 100644 --- a/src/app/data/components/data-browser/data-browser.component.ts +++ b/src/app/data/components/data-browser/data-browser.component.ts @@ -1911,7 +1911,6 @@ export class DataBrowserComponent implements OnInit, OnDestroy { } alterUser(msgId) { - console.log(Date.now()) if (this.alertLastVisible && Date.now() - this.alertLastVisible < 1000) return; alert("Settings were changed (msgId: " + msgId + ")\nFilter will be reloaded."); this.alertLastVisible = Date.now();