Copilot commented on code in PR #7819:
URL: https://github.com/apache/texera/pull/7819#discussion_r3833094727
##########
frontend/src/app/app-routing.module.ts:
##########
@@ -139,6 +140,10 @@ routes.push({
path: "compute",
component: UserComputingUnitComponent,
},
+ {
+ path: "warehouse",
+ component: UserWarehouseComponent,
+ },
Review Comment:
This route is always registered, so an authenticated user can navigate
directly to `/user/warehouse` even when the backend reports the feature
disabled. That contradicts the stated requirement that the route appear only
when `warehouseEnabled` and means flag-off deployments expose a new disabled
page. Add a route guard/canMatch check that redirects when status is disabled.
##########
frontend/src/app/dashboard/component/user/user-warehouse/user-warehouse-list-item/user-warehouse-list-item.component.html:
##########
@@ -0,0 +1,88 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<nz-card
+ [nzBodyStyle]="{padding: '3px'}"
+ class="warehouse-list-item-card">
+ <div
+ nz-row
+ nzAlign="middle"
+ class="warehouse-item-row">
+ <div
+ nz-col
+ nzFlex="20px"></div>
+
+ <div
+ nz-col
+ nzFlex="0"
+ class="type-icon">
+ <i
+ nz-icon
+ nzType="cloud-server"></i>
+ </div>
+
+ <div
+ nz-col
+ nzFlex="0"
+ class="warehouse-id">
+ <i>#{{ warehouse.whid }}</i>
+ </div>
+
+ <div
+ nz-col
+ nzFlex="1"
+ class="resource-name-group">
+ <div
+ class="resource-name truncate-single-line"
+ nz-tooltip
+ [nzTooltipTitle]="warehouse.name"
+ (click)="openWarehouseMetadataModal()">
Review Comment:
The warehouse name opens the details dialog only through a click handler on
a non-focusable `div`, so keyboard users cannot access the dialog. Use a
semantic button/link (styled as the current name) and support keyboard focus.
##########
frontend/src/app/dashboard/component/dashboard.component.html:
##########
@@ -109,6 +109,18 @@
nzType="deployment-unit"></span>
<span>Compute</span>
</li>
+ <li
+ *ngIf="warehouseEnabled"
+ nz-menu-item
+ nz-tooltip="Manage warehouses"
+ nzMatchRouter="true"
Review Comment:
This introduces a visible frontend navigation item, but the PR description
does not include the required before/after screenshots or GIF, and its test
section omits the exact `yarn test:ci` invocation. Please add both pieces of
verification evidence.
##########
frontend/src/app/dashboard/component/user/user-warehouse/user-warehouse-list-item/user-warehouse-list-item.component.scss:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@use "../../../section-style" as *;
+@use "../../../dashboard.component.scss" as *;
+
+.warehouse-list-item-card {
+ padding: 3px;
+ width: 100%;
+ background-color: white;
+ position: relative;
+ min-height: 65px;
+ height: auto;
+
+ &:hover {
+ background-color: #f0f0f0;
+ }
+}
+
+// The computing-unit row is 64px of content: its two 32px metric bars drive
+// the height. A warehouse row has no metrics, so pin the same content height
+// here — card paddings and borders already match, so the rows line up exactly.
+.warehouse-item-row {
+ min-height: 64px;
+}
+
+.warehouse-list-item-card:hover .button-group {
+ display: flex;
+ background-color: transparent;
+}
+
+.type-icon {
+ font-size: 30px;
+}
+
+.warehouse-id {
+ padding: 6px;
+}
+
+.resource-name-group {
+ min-width: 0;
+}
+
+.resource-name {
+ font-size: 17px;
+ font-weight: 600;
+ cursor: pointer;
+ text-decoration: none;
+}
+
+.resource-name:hover {
+ text-decoration: underline;
+}
+
+.resource-info {
+ font-size: 13px;
+ color: grey;
+}
+
+.truncate-single-line {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.button-group {
+ display: none;
Review Comment:
`display: none` removes the delete button from the tab order, and the group
is revealed only by mouse hover. A keyboard-only user therefore cannot delete a
warehouse. Keep the action focusable and reveal the group on both hover and
`:focus-within` (or render it visibly).
##########
frontend/src/app/dashboard/component/dashboard.component.ts:
##########
@@ -160,12 +168,35 @@ export class DashboardComponent implements OnInit {
this.isLogin = this.userService.isLogin();
this.isAdmin = this.userService.isAdmin();
this.forumLogin();
+ this.loadWarehouseEnabled();
});
});
this.loadLogos();
this.loadTabs();
+
+ this.loadWarehouseEnabled();
Review Comment:
`userChanged()` replays the current user synchronously, so the subscription
above already calls `loadWarehouseEnabled()` during initialization. This second
call makes every logged-in dashboard load issue two identical `GET
/warehouse/status` requests. Remove the duplicate call and rely on the replayed
user state.
##########
frontend/src/app/common/component/warehouse-create-modal/warehouse-create-modal.component.html:
##########
@@ -0,0 +1,52 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<nz-modal
+ [nzVisible]="visible"
+ nzTitle="Create Warehouse"
+ [nzContent]="createWarehouseModalContent"
+ [nzFooter]="createWarehouseModalFooter"
+ (nzOnCancel)="handleCreateWarehouseModalCancel()">
+ <ng-template #createWarehouseModalContent>
+ <input
+ nz-input
+ placeholder="Warehouse name"
Review Comment:
The text field has no persistent or programmatic label; a placeholder alone
is not a substitute for an accessible name and disappears after entry. Add a
visible `<label>` or at least an `aria-label`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]