Skip to content

Commit

Permalink
Merge branch 'arb-ltip' into deployments/arbitrum
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Apr 24, 2024
2 parents 0cd5f3b + 3b71cba commit 6f1a995
Show file tree
Hide file tree
Showing 13 changed files with 245 additions and 220 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VITE_ENABLED_EDITORS=ARBLTIPGrantee
VITE_RENOWN_URL=http://localhost:3000
VITE_RENOWN_URL=https://renown.vercel.app/
VITE_DEFAULT_DRIVE_URL=https://apps.powerhouse.io/alpha/arbitrum/switchboard/d/arbitrum
VITE_BASE_HREF=/

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy-makerdao-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
email: ${{ secrets.HEROKU_EMAIL }}
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
docker_options: "--build-arg BASE_PATH=/alpha/makerdao/connect --build-arg VITE_BASE_HREF=/alpha/makerdao/connect/ --build-arg VITE_ROUTER_BASENAME=/alpha/makerdao/connect --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} --build-arg VITE_DEFAULT_DRIVE_URL=https://apps.powerhouse.io/alpha/makerdao/switchboard/d/monetalis"
docker_options: "--build-arg BASE_PATH=/alpha/makerdao/connect --build-arg VITE_BASE_HREF=/alpha/makerdao/connect/ --build-arg VITE_ROUTER_BASENAME=/alpha/makerdao/connect --build-arg VITE_SENTRY_DSN=${{ secrets.SENTRY_DSN }} --build-arg VITE_SENTRY_ENV=${{ secrets.SENTRY_ENV }} --build-arg VITE_DEFAULT_DRIVE_URL=https://apps.powerhouse.io/alpha/makerdao/switchboard/d/monetalis --build-arg VITE_CREATE_DOCUMENT_ALLOW_LIST=${{secrets.VITE_CREATE_DOCUMENT_ALLOW_LIST}}"
process_type: web
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ ENV VITE_DISABLE_DELETE_LOCAL_DRIVES=${VITE_DISABLE_DELETE_LOCAL_DRIVES}
ARG VITE_LOCAL_DRIVES_ENABLED=false
ENV VITE_LOCAL_DRIVES_ENABLED=${VITE_LOCAL_DRIVES_ENABLED}

ARG VITE_CREATE_DOCUMENT_ALLOW_LIST=""
ENV VITE_CREATE_DOCUMENT_ALLOW_LIST=${VITE_CREATE_DOCUMENT_ALLOW_LIST}

WORKDIR /opt/app
COPY . .
RUN npm install -g husky vite
Expand Down
75 changes: 33 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"lint": "eslint --ext .js,.ts,.tsx . && tsc --noemit --project tsconfig.spec.json",
"format": "prettier --write \"**/*.+(js|ts|jsx|tsx|json)\"",
"dev:web": "vite -c vite.renderer.config.ts",
"dev:nocache": "rm -rf node_modules/.vite && rm -rf node_modules/.cache && npm run dev:web",
"build:web": "vite build -c vite.renderer.config.ts",
"release": "semantic-release",
"prepare": "npm run prepare:scripts",
Expand Down Expand Up @@ -92,9 +93,9 @@
"@powerhousedao/design-system": "1.0.0-alpha.100",
"@sentry/react": "^7.109.0",
"did-key-creator": "^1.2.0",
"document-drive": "^1.0.0-alpha.46",
"document-model": "^1.0.52",
"document-model-libs": "^1.37.0-arbitrum.1",
"document-drive": "^1.0.0-alpha.50",
"document-model": "^1.0.53",
"document-model-libs": "1.39.0-arbitrum.1",
"electron-is-dev": "^3.0.1",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^8.1.0",
Expand Down
10 changes: 8 additions & 2 deletions src/components/file-item/file-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useIsAllowedToCreateDocuments } from 'src/hooks/useIsAllowedToCreateDoc
import { useOpenSwitchboardLink } from 'src/hooks/useOpenSwitchboardLink';
import { useModal } from '../modal';

const allowedItemOptions = ['delete', 'rename'];
const allowedItemOptions = ['delete', 'rename', 'duplicate'];

const defaultItemOptions = defaultDropdownMenuOptions.filter(option =>
allowedItemOptions.includes(option.id),
Expand All @@ -34,7 +34,7 @@ export const FileItem: React.FC<IProps> = ({ file, drive, onFileSelected }) => {
const [isWriteMode, setIsWriteMode] = useState(false);
const getReadableItemPath = useGetReadableItemPath();
const getDocumentById = useGetDocumentById();
const { updateNodeName } = useDrivesContainer();
const { updateNodeName, onSubmitInput } = useDrivesContainer();
const { showModal } = useModal();
const isAllowedToCreateDocuments = useIsAllowedToCreateDocuments();

Expand All @@ -51,6 +51,12 @@ export const FileItem: React.FC<IProps> = ({ file, drive, onFileSelected }) => {
type: 'file',
});
}
if (optionId === 'duplicate') {
await onSubmitInput({
...file,
action: 'UPDATE_AND_COPY',
});
}

if (optionId === 'rename') {
setIsWriteMode(true);
Expand Down
16 changes: 13 additions & 3 deletions src/components/folder-item/folder-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useDrivesContainer } from 'src/hooks/useDrivesContainer';
import { useIsAllowedToCreateDocuments } from 'src/hooks/useIsAllowedToCreateDocuments';
import { useOnDropEvent } from 'src/hooks/useOnDropEvent';

const allowedItemOptions = ['delete', 'rename'];
const allowedItemOptions = ['delete', 'rename', 'duplicate'];

const itemOptions = defaultDropdownMenuOptions.filter(option =>
allowedItemOptions.includes(option.id),
Expand All @@ -26,11 +26,14 @@ export const FolderItem: React.FC<FolderItemProps> = props => {
const isAllowedToCreateDocuments = useIsAllowedToCreateDocuments();

const { showModal } = useModal();
const { updateNodeName } = useDrivesContainer();
const { updateNodeName, onSubmitInput } = useDrivesContainer();
const [isWriteMode, setIsWriteMode] = useState(false);
const onDropEvent = useOnDropEvent();

const onFolderOptionsClick = (optionId: string, folderNode: TreeItem) => {
const onFolderOptionsClick = async (
optionId: string,
folderNode: TreeItem,
) => {
if (optionId === 'delete') {
showModal('deleteItem', {
driveId: decodedDriveID,
Expand All @@ -40,6 +43,13 @@ export const FolderItem: React.FC<FolderItemProps> = props => {
});
}

if (optionId === 'duplicate') {
await onSubmitInput({
...folder,
action: 'UPDATE_AND_COPY',
});
}

if (optionId === 'rename') {
setIsWriteMode(true);
}
Expand Down
Loading

0 comments on commit 6f1a995

Please sign in to comment.