Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
cddb029
Add clone & edit button on detail page
GspikeHalo Oct 2, 2024
5ab607f
Merge branch 'master' into add-clone-button
GspikeHalo Oct 3, 2024
a37b759
Merge branch 'master' into add-clone-button
GspikeHalo Oct 3, 2024
f440ec1
Modify the clone button style
GspikeHalo Oct 4, 2024
e84ee16
fmt fix
GspikeHalo Oct 4, 2024
4a3ae5a
Add two new tables: workflow_user_clones and workflow_user_likes.
GspikeHalo Oct 4, 2024
5ebe2c2
add like button on list item
GspikeHalo Oct 4, 2024
2347c26
add live button in detail page
GspikeHalo Oct 4, 2024
09c9649
fmt fix
GspikeHalo Oct 4, 2024
43fdf26
quick fix
GspikeHalo Oct 5, 2024
01f0887
Implement statistics for cloneworkflow and add counts for like and cl…
GspikeHalo Oct 5, 2024
3c04c01
Disable the copy button for the owner preview detail interface
GspikeHalo Oct 5, 2024
eb29b7b
fmt fix
GspikeHalo Oct 5, 2024
298f1e4
quick fix
GspikeHalo Oct 6, 2024
479b8f0
Merge branch 'master' into add-clone-button
GspikeHalo Oct 8, 2024
6697f94
Merge branch 'master' into add-clone-button
GspikeHalo Oct 8, 2024
e5205cb
Merge branch 'master' into add-clone-button
GspikeHalo Oct 8, 2024
7a14364
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 8, 2024
5ec462b
add like count in list item
GspikeHalo Oct 8, 2024
b34c9f1
enable the like button on hub list item when user is not logged in
GspikeHalo Oct 9, 2024
7684f1c
display but disable like and clone button in detail page
GspikeHalo Oct 9, 2024
68259bc
A dialog box is displayed when the clone is successful.
GspikeHalo Oct 9, 2024
ef7bb9e
fmt fix
GspikeHalo Oct 9, 2024
b62f176
Merge branch 'master' into add-clone-button
GspikeHalo Oct 10, 2024
cdd4764
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 10, 2024
0174e78
Merge branch 'master' into add-clone-button
GspikeHalo Oct 10, 2024
b8c6fe8
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 10, 2024
1ead656
fmt fix
GspikeHalo Oct 10, 2024
4820c2b
quick start
GspikeHalo Oct 10, 2024
e91f217
Basic Design
GspikeHalo Oct 10, 2024
5ccd265
enable public workflow count and hyperlink
GspikeHalo Oct 11, 2024
450565e
Merge branch 'master' into add-clone-button
GspikeHalo Oct 11, 2024
c7acc8b
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 11, 2024
6f2d7ce
Merge branch 'master' into add-clone-button
sixsage Oct 11, 2024
2b81a8b
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 12, 2024
5a796a4
Merge branch 'master' into add-clone-button
GspikeHalo Oct 12, 2024
796c7d5
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 12, 2024
2e7d610
Merge branch 'master' into add-clone-button
GspikeHalo Oct 12, 2024
a35c765
Merge branch 'add-clone-button' into add-love-button
GspikeHalo Oct 12, 2024
f5ae49b
remove unused components.
GspikeHalo Oct 12, 2024
bf3fe04
refactor landing page
GspikeHalo Oct 12, 2024
55412fb
Merge branch 'master' into add-love-button
GspikeHalo Oct 12, 2024
275a2bf
fmt fix
GspikeHalo Oct 12, 2024
4c44f8f
add browse section to the landing page
GspikeHalo Oct 12, 2024
226d45d
Merge branch 'master' into add-love-button
GspikeHalo Oct 12, 2024
3da2031
fmt fix
GspikeHalo Oct 12, 2024
8343600
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 12, 2024
c3009f4
enable scroll bar in detail page
GspikeHalo Oct 13, 2024
fdb2a08
quick fix
GspikeHalo Oct 13, 2024
3c5d1eb
fmt fix
GspikeHalo Oct 13, 2024
2d04f9e
Merge branch 'master' into add-love-button
GspikeHalo Oct 15, 2024
b77e8f6
Fix the search bar to the top of the landing page
GspikeHalo Oct 15, 2024
156cc82
Limit the display length of the workflow title and description in the…
GspikeHalo Oct 15, 2024
fc39273
Merge branch 'master' into add-love-button
GspikeHalo Oct 16, 2024
25bf7b3
update database
GspikeHalo Oct 16, 2024
b047928
Add records for like, unlike, and clone in the user_activity table
GspikeHalo Oct 16, 2024
abb8732
fmt fix
GspikeHalo Oct 16, 2024
3b02c9c
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 16, 2024
d0f2136
fmt fix
GspikeHalo Oct 16, 2024
0cc798b
Merge branch 'master' into add-love-button
GspikeHalo Oct 17, 2024
76f34ac
quick fix
GspikeHalo Oct 18, 2024
e684ac7
Merge branch 'master' into add-love-button
GspikeHalo Oct 20, 2024
d1859ee
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 20, 2024
6fc0a0f
add animation to card
GspikeHalo Oct 21, 2024
743e55d
Merge branch 'master' into add-love-button
GspikeHalo Oct 22, 2024
8f3f98b
rename database
GspikeHalo Oct 22, 2024
64dd747
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 22, 2024
df4eb33
fmt fix
GspikeHalo Oct 22, 2024
12b8298
remove Github start in the top bar. fix unit test
GspikeHalo Oct 26, 2024
2c1a6d3
always display like button on public workflow interface
GspikeHalo Oct 26, 2024
271d62f
Merge branch 'master' into add-love-button
GspikeHalo Oct 26, 2024
92bf42f
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 26, 2024
aa5147d
Merge branch 'master' into add-love-button
GspikeHalo Oct 27, 2024
1832668
Merge branch 'add-love-button' into add-landing-page
GspikeHalo Oct 27, 2024
e3a8955
Merge branch 'master' into add-landing-page
GspikeHalo Oct 27, 2024
c3f8e1e
Merge branch 'master' into add-landing-page
GspikeHalo Oct 27, 2024
767d711
Merge branch 'master' into add-landing-page
GspikeHalo Oct 28, 2024
fdb4a8c
Merge branch 'master' into add-landing-page
GspikeHalo Oct 28, 2024
0c1bbe1
quick fix, format fix
GspikeHalo Oct 28, 2024
f6a548c
refactor resource info grid
GspikeHalo Oct 29, 2024
1139b8b
quick fix
GspikeHalo Oct 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ import edu.uci.ics.texera.web.model.jooq.generated.Tables._
import edu.uci.ics.texera.web.model.jooq.generated.enums.UserRole
import edu.uci.ics.texera.web.model.jooq.generated.tables.daos.WorkflowDao
import edu.uci.ics.texera.web.model.jooq.generated.tables.pojos.{User, Workflow}
import edu.uci.ics.texera.web.resource.dashboard.hub.workflow.HubWorkflowResource.fetchDashboardWorkflowsByWids
import edu.uci.ics.texera.web.resource.dashboard.hub.workflow.HubWorkflowResource.recordUserActivity
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowAccessResource
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.WorkflowWithPrivilege
import edu.uci.ics.texera.web.resource.dashboard.user.workflow.WorkflowResource.{
DashboardWorkflow,
WorkflowWithPrivilege
}
import org.jooq.impl.DSL

import scala.jdk.CollectionConverters._
import java.util
import javax.ws.rs._
import javax.ws.rs.core.MediaType
import org.jooq.types.UInteger

import java.util.Collections
import java.util.regex.Pattern
import javax.servlet.http.HttpServletRequest
import javax.ws.rs.core.Context
Expand All @@ -26,6 +32,53 @@ object HubWorkflowResource {
"^([0-9]{1,3}\\.){3}[0-9]{1,3}$"
)

def fetchDashboardWorkflowsByWids(wids: Seq[UInteger]): util.List[DashboardWorkflow] = {
if (wids.nonEmpty) {
context
.select(
WORKFLOW.NAME,
WORKFLOW.DESCRIPTION,
WORKFLOW.WID,
WORKFLOW.CREATION_TIME,
WORKFLOW.LAST_MODIFIED_TIME,
USER.NAME.as("ownerName"),
WORKFLOW_OF_USER.UID.as("ownerId")
)
.from(WORKFLOW)
.join(WORKFLOW_OF_USER)
.on(WORKFLOW.WID.eq(WORKFLOW_OF_USER.WID))
.join(USER)
.on(WORKFLOW_OF_USER.UID.eq(USER.UID))
.where(WORKFLOW.WID.in(wids: _*))
.fetch()
.asScala
.map(record => {
val workflow = new Workflow(
record.get(WORKFLOW.NAME),
record.get(WORKFLOW.DESCRIPTION),
record.get(WORKFLOW.WID),
null,
record.get(WORKFLOW.CREATION_TIME),
record.get(WORKFLOW.LAST_MODIFIED_TIME),
null
)

DashboardWorkflow(
isOwner = false,
accessLevel = "",
ownerName = record.get("ownerName", classOf[String]),
workflow = workflow,
projectIDs = List(),
ownerId = record.get("ownerId", classOf[UInteger])
)
})
.toList
.asJava
} else {
Collections.emptyList[DashboardWorkflow]()
}
}

def recordUserActivity(
request: HttpServletRequest,
userId: UInteger = UInteger.valueOf(0),
Expand Down Expand Up @@ -71,9 +124,10 @@ class HubWorkflowResource {

@GET
@Path("/count")
def getWorkflowCount: Integer = {
def getPublishedWorkflowCount: Integer = {
context.selectCount
.from(WORKFLOW)
.where(WORKFLOW.IS_PUBLISHED.eq(1.toByte))
.fetchOne(0, classOf[Integer])
}

Expand Down Expand Up @@ -264,6 +318,44 @@ class HubWorkflowResource {
cloneCount
}

@GET
@Path("/topLovedWorkflows")
@Produces(Array(MediaType.APPLICATION_JSON))
def getTopLovedWorkflows: util.List[DashboardWorkflow] = {
val topLovedWorkflowsWids = context
.select(WORKFLOW_USER_LIKES.WID)
.from(WORKFLOW_USER_LIKES)
.groupBy(WORKFLOW_USER_LIKES.WID)
.orderBy(DSL.count(WORKFLOW_USER_LIKES.WID).desc())
.limit(8)
.fetchInto(classOf[UInteger])
.asScala
.toSeq

println(fetchDashboardWorkflowsByWids(topLovedWorkflowsWids))

fetchDashboardWorkflowsByWids(topLovedWorkflowsWids)
}

@GET
@Path("/topClonedWorkflows")
@Produces(Array(MediaType.APPLICATION_JSON))
def getTopClonedWorkflows: util.List[DashboardWorkflow] = {
val topClonedWorkflowsWids = context
.select(WORKFLOW_USER_CLONES.WID)
.from(WORKFLOW_USER_CLONES)
.groupBy(WORKFLOW_USER_CLONES.WID)
.orderBy(DSL.count(WORKFLOW_USER_CLONES.WID).desc())
.limit(8)
.fetchInto(classOf[UInteger])
.asScala
.toSeq

println(fetchDashboardWorkflowsByWids(topClonedWorkflowsWids))

fetchDashboardWorkflowsByWids(topClonedWorkflowsWids)
}

@POST
@Path("/view")
@Consumes(Array(MediaType.APPLICATION_JSON))
Expand Down
14 changes: 7 additions & 7 deletions core/gui/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { AdminGmailComponent } from "./dashboard/component/admin/gmail/admin-gma
import { UserDatasetExplorerComponent } from "./dashboard/component/user/user-dataset/user-dataset-explorer/user-dataset-explorer.component";
import { UserDatasetComponent } from "./dashboard/component/user/user-dataset/user-dataset.component";
import { HubWorkflowSearchComponent } from "./hub/component/workflow/search/hub-workflow-search.component";
import { HubWorkflowResultComponent } from "./hub/component/workflow/result/hub-workflow-result.component";
import { HubWorkflowComponent } from "./hub/component/workflow/hub-workflow.component";
import { HubWorkflowDetailComponent } from "./hub/component/workflow/detail/hub-workflow-detail.component";
import { LandingPageComponent } from "./hub/component/landing-page/landing-page.component";

const routes: Routes = [];

Expand All @@ -31,6 +31,10 @@ if (environment.userSystemEnabled) {
children: [
{
path: "home",
component: LandingPageComponent,
},
{
path: "about",
component: HomeComponent,
},
{
Expand All @@ -41,15 +45,11 @@ if (environment.userSystemEnabled) {
component: HubWorkflowComponent,
children: [
{
path: "search",
path: "result",
component: HubWorkflowSearchComponent,
},
{
path: "search/result",
component: HubWorkflowResultComponent,
},
{
path: "search/result/detail/:id",
path: "result/detail/:id",
component: HubWorkflowDetailComponent,
},
],
Expand Down
8 changes: 4 additions & 4 deletions core/gui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ import { ListItemComponent } from "./dashboard/component/user/list-item/list-ite
import { HubComponent } from "./hub/component/hub.component";
import { HubWorkflowSearchComponent } from "./hub/component/workflow/search/hub-workflow-search.component";
import { GoogleLoginComponent } from "./dashboard/component/user/google-login/google-login.component";
import { HubWorkflowResultComponent } from "./hub/component/workflow/result/hub-workflow-result.component";
import { HubWorkflowComponent } from "./hub/component/workflow/hub-workflow.component";
import { HubWorkflowSearchBarComponent } from "./hub/component/workflow/search-bar/hub-workflow-search-bar.component";
import { HubWorkflowDetailComponent } from "./hub/component/workflow/detail/hub-workflow-detail.component";
import { LandingPageComponent } from "./hub/component/landing-page/landing-page.component";
import { BrowseSectionComponent } from "./hub/component/browse-section/browse-section.component";
import { BreakpointConditionInputComponent } from "./workspace/component/code-editor-dialog/breakpoint-condition-input/breakpoint-condition-input.component";
import { CodeDebuggerComponent } from "./workspace/component/code-editor-dialog/code-debugger.component";

Expand Down Expand Up @@ -224,10 +224,10 @@ registerLocaleData(en);
HubComponent,
HubWorkflowComponent,
HubWorkflowSearchComponent,
HubWorkflowSearchBarComponent,
HubWorkflowDetailComponent,
HubWorkflowResultComponent,
GoogleLoginComponent,
LandingPageComponent,
BrowseSectionComponent,
BreakpointConditionInputComponent,
CodeDebuggerComponent,
],
Expand Down
12 changes: 9 additions & 3 deletions core/gui/src/app/dashboard/component/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,27 @@
<ul
class="nav-links"
[ngClass]="{ 'hidden': isLogin }">
<li class="nav-item">
<li
class="nav-item"
[hidden]="!showLinks">
<a
class="nav-link"
href="https://github.com/Texera/texera/wiki/Getting-Started"
>Getting Started</a
>
</li>
<li class="nav-item">
<li
class="nav-item"
[hidden]="!showLinks">
<a
class="nav-link"
href="https://texera.github.io/blog/"
>Blogs</a
>
</li>
<li class="nav-item">
<li
class="nav-item"
[hidden]="!showLinks">
<iframe
style="margin-top: 2px"
src="https://ghbtns.com/github-btn.html?user=Texera&repo=texera&type=star&count=true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ nz-content {

.nav-links {
list-style-type: none;
min-height: 70px;
height: 70px;
padding: 10px;
margin: 0;
Expand Down
33 changes: 22 additions & 11 deletions core/gui/src/app/dashboard/component/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UserService } from "../../common/service/user/user.service";
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
import { FlarumService } from "../service/user/flarum/flarum.service";
import { HttpErrorResponse } from "@angular/common/http";
import { ActivatedRoute, Router } from "@angular/router";
import { ActivatedRoute, NavigationEnd, Router } from "@angular/router";
import { HubComponent } from "../../hub/component/hub.component";
import { GoogleAuthService } from "../../common/service/user/google-auth.service";
import { NotificationService } from "../../common/service/notification/notification.service";
Expand All @@ -26,7 +26,8 @@ export class DashboardComponent implements OnInit {
displayForum: boolean = true;
displayNavbar: boolean = true;
isCollpased: boolean = false;
routesWithoutNavbar: string[] = ["/workspace", "/home"];
routesWithoutNavbar: string[] = ["/workspace", "/home", "/about"];
showLinks: boolean = false;

constructor(
private userService: UserService,
Expand All @@ -39,16 +40,10 @@ export class DashboardComponent implements OnInit {
) {}

ngOnInit(): void {
this.isCollpased = false;
this.isLogin = this.userService.isLogin();
this.isAdmin = this.userService.isAdmin();

this.userService
.userChanged()
.pipe(untilDestroyed(this))
.subscribe(() => {
this.isLogin = this.userService.isLogin();
this.isAdmin = this.userService.isAdmin();
this.cdr.detectChanges();
});
this.isCollpased = false;

if (!this.isLogin) {
this.googleAuthService.googleAuthInit(document.getElementById("googleButton"));
Expand Down Expand Up @@ -88,6 +83,22 @@ export class DashboardComponent implements OnInit {
this.router.events.pipe(untilDestroyed(this)).subscribe(() => {
this.checkRoute();
});

this.router.events.pipe(untilDestroyed(this)).subscribe(event => {
if (event instanceof NavigationEnd) {
this.checkRoute();
this.showLinks = event.url.includes("about");
}
});

this.userService
.userChanged()
.pipe(untilDestroyed(this))
.subscribe(() => {
this.isLogin = this.userService.isLogin();
this.isAdmin = this.userService.isAdmin();
this.cdr.detectChanges();
});
}

checkRoute() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,33 @@
</div>
<div class="resource-info-grid">
<div class="resource-info">
{{ entry.type==='workflow' ? formatViewCount(viewCount) + " " + (viewCount === 1 ? "view" : "views") : ''}}
<ng-container *ngIf="entry.type === 'workflow'; else sizeInfo">
{{ formatCount(viewCount) }} {{ viewCount === 1 ? 'view' : 'views' }}
</ng-container>
<ng-template #sizeInfo> Size: {{ formatSize(entry.size) }} </ng-template>
</div>
<div class="resource-info">{{ entry.type === 'dataset' ? 'Size: ' + formatSize(entry.size) : '' }}</div>
<div class="resource-info">Created: {{ formatTime(entry.creationTime) }}</div>
<div class="resource-info">Edited: {{ formatTime(entry.lastModifiedTime) }}</div>

<button
*ngIf="!isPrivateSearch && entry.type==='workflow'"
nz-button
nzType="text"
class="resource-info like-button"
title="Like"
[ngClass]="{ liked: isLiked, 'disabled-like': !currentUid }"
(click)="toggleLike(this.entry.id, this.currentUid)"
(click)="$event.stopPropagation()"
[attr.disabled]="!currentUid ? true : null">
<i
nz-icon
[nzTheme]="isLiked ? 'fill' : 'outline'"
[nzType]="'like'"
[ngClass]="isLiked ? 'liked' : 'not-liked'"
class="like-icon">
</i>
<span>{{ formatCount(likeCount) }}</span>
</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -189,25 +211,4 @@
nzType="delete"></i>
</button>
</div>
<div
*ngIf="!isPrivateSearch"
class="button-group">
<button
nz-button
nzType="text"
class="dropdown-item like-button"
title="Like"
[ngClass]="{ liked: isLiked, 'disabled-like': !currentUid }"
(click)="toggleLike(this.entry.id, this.currentUid)"
[attr.disabled]="!currentUid ? true : null">
<i
nz-icon
[nzTheme]="isLiked ? 'fill' : 'outline'"
[nzType]="'like'"
[ngClass]="isLiked ? 'liked' : 'not-liked'"
class="like-icon">
</i>
<span>{{ formatLikeCount(likeCount) }}</span>
</button>
</div>
</nz-card>
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
color: black;
width: auto;
min-width: 70px;
max-width: 90px;
height: 30px;
border-radius: 6px;
padding: 0 8px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ListItemComponent implements OnInit, OnChanges {
ROUTER_WORKFLOW_BASE_URL = "/dashboard/user/workspace";
ROUTER_USER_PROJECT_BASE_URL = "/dashboard/user/project";
ROUTER_DATASET_BASE_URL = "/dashboard/user/dataset";
ROUTER_WORKFLOW_DETAIL_BASE_URL = "/dashboard/hub/workflow/search/result/detail";
ROUTER_WORKFLOW_DETAIL_BASE_URL = "/dashboard/hub/workflow/result/detail";
entryLink: string[] = [];
public iconType: string = "";
isLiked: boolean = false;
Expand Down Expand Up @@ -367,14 +367,7 @@ export class ListItemComponent implements OnInit, OnChanges {
}
}

formatLikeCount(count: number): string {
if (count >= 1000) {
return (count / 1000).toFixed(1) + "k";
}
return count.toString();
}

formatViewCount(count: number): string {
formatCount(count: number): string {
if (count >= 1000) {
return (count / 1000).toFixed(1) + "k";
}
Expand Down
Loading