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

Demo changes #42

Merged
merged 8 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class AppComponent implements OnDestroy, OnInit {
});
this.initializeNotificationService();
this.initWithConfigManager();
this.checkBrowser();
}

initalRequests() {
Expand Down Expand Up @@ -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 different than expected.\n\nFor the best experience we recommend using chrome."
alert(t);
}
localStorage.setItem("browser_info_checked", "1");
}
}


}
25 changes: 11 additions & 14 deletions src/app/base/components/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,24 @@
<a [routerLink]="['/notification-center']" class="flex mr-6 tooltip tooltip-left"
data-tip="Notification center">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-bell" width="24"
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M10 5a2 2 0 0 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6"></path>
<path d="M9 17v1a3 3 0 0 0 6 0v-1"></path>
</svg>
</a>
</div>
<div class="flex items-center justify-center">
<a href="https://github.com/code-kern-ai/refinery" target="_blank" data-tip="Star us on GitHub"
rel="noopener noreferrer" class="flex mr-6 tooltip tooltip-left">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-star" width="24"
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path
d="M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z">
d="M10 5a2 2 0 0 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6">
</path>
<path d="M9 17v1a3 3 0 0 0 6 0v-1"></path>
</svg>
</a>

</div>
<div class="flex items-center justify-center">
<div class="widget widget-lg"><a class="btnx" href="https://github.com/code-kern-ai/refinery"
rel="noopener" target="_blank" aria-label="Star code-kern-ai/refinery on GitHub"><svg
viewBox="0 0 16 16" width="16" height="16" class="octicon octicon-star" aria-hidden="true">
<path fill-rule="evenodd"
d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z">
</path>
</svg>&nbsp;<span>Star on GitHub</span></a></div>
</div>
<div class="flex justify-center overflow-visible" *ngIf="!hideLogout">
<div *ngIf="user" class=" mr-4">
Expand Down
45 changes: 45 additions & 0 deletions src/app/base/components/header/header.component.scss
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<div class="flex-shrink-0 flex py-6 justify-center">
<a data-tip="Changelog" target="_blank" rel="noopener noreferrer"
class="z-50 tooltip tooltip-right cursor-pointer select-none text-white"
href="https://docs.kern.ai/changelog">v1.1</a>
href="https://docs.kern.ai/changelog">v1.1.1</a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -1909,7 +1911,9 @@ export class DataBrowserComponent implements OnInit, OnDestroy {
}

alterUser(msgId) {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/projects/components/projects/projects.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ProjectsComponent implements OnInit, OnDestroy {
this.isManaged = ConfigManager.getIsManaged();
}
});
this.checkIfDemoUser();
this.checkIfDemoUser();
}

checkIfDemoUser() {
Expand All @@ -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;

Expand Down Expand Up @@ -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)
}
}

Expand Down