mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
stop pushing rowRef to user
This commit is contained in:
@@ -38,13 +38,10 @@ export default function SideDrawer() {
|
||||
|
||||
const handleNavigate = (direction: "up" | "down") => () => {
|
||||
if (!tableState?.rows) return;
|
||||
|
||||
let row = cell!.row;
|
||||
if (direction === "up" && row > 0) row -= 1;
|
||||
if (direction === "down" && row < tableState.rows.length - 1) row += 1;
|
||||
|
||||
setCell!((cell) => ({ column: cell!.column, row }));
|
||||
|
||||
const idx = tableState?.columns[cell!.column]?.index;
|
||||
dataGridRef?.current?.selectCell({ rowIdx: row, idx }, false);
|
||||
};
|
||||
@@ -68,13 +65,6 @@ export default function SideDrawer() {
|
||||
|
||||
useEffect(() => {
|
||||
if (cell && tableState?.rows[cell.row]) {
|
||||
window.history.pushState(
|
||||
"",
|
||||
`${tableState?.config.id}`,
|
||||
`${window.location.pathname}?rowRef=${encodeURIComponent(
|
||||
tableState?.rows[cell.row].ref.path
|
||||
)}`
|
||||
);
|
||||
if (urlDocState.doc) {
|
||||
urlDocState.unsubscribe();
|
||||
dispatchUrlDoc({ path: "", doc: null });
|
||||
|
||||
@@ -4,6 +4,7 @@ import { getFieldProp } from "@src/components/fields";
|
||||
import MenuContents from "./MenuContent";
|
||||
import DuplicateIcon from "@src/assets/icons/CopyCells";
|
||||
import DeleteIcon from "@mui/icons-material/DeleteOutlined";
|
||||
import LinkIcon from "@mui/icons-material/Link";
|
||||
|
||||
import { useProjectContext } from "@src/contexts/ProjectContext";
|
||||
import { useContextMenuAtom } from "@src/atoms/ContextMenu";
|
||||
@@ -47,8 +48,18 @@ export default function ContextMenu() {
|
||||
}
|
||||
|
||||
const row = tableState?.rows[selectedCell!.rowIndex];
|
||||
if (userRoles.includes("ADMIN") && row) {
|
||||
if (row) {
|
||||
const rowActions = [
|
||||
{
|
||||
label: "Copy link to row",
|
||||
icon: <LinkIcon />,
|
||||
onClick: () => {
|
||||
const rowRef = encodeURIComponent(row.ref.path);
|
||||
navigator.clipboard.writeText(
|
||||
window.location.href + `?rowRef=${rowRef}`
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Duplicate row",
|
||||
icon: <DuplicateIcon />,
|
||||
|
||||
Reference in New Issue
Block a user