Skip to content

Commit

Permalink
Merge branch 'staging' into arb-ltip
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Apr 24, 2024
2 parents 8abb8d0 + 8c03646 commit 3b71cba
Show file tree
Hide file tree
Showing 16 changed files with 277 additions and 238 deletions.
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
82 changes: 37 additions & 45 deletions package-lock.json

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

9 changes: 5 additions & 4 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 @@ -89,12 +90,12 @@
"xvfb-maybe": "^0.2.1"
},
"dependencies": {
"@powerhousedao/design-system": "1.0.0-alpha.97",
"@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.43",
"document-model": "^1.0.51",
"document-model-libs": "1.37.0-arbitrum.2",
"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
3 changes: 3 additions & 0 deletions src/components/modal/modals/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Button,
ClearStorageSettingsRow,
SettingsModal as ConnectSettingsModal,
DependencyVersions,
DocumentSelectSettingsRow,
} from '@powerhousedao/design-system';
import { DocumentModel } from 'document-model/document';
Expand All @@ -17,6 +18,7 @@ import {
useFilteredDocumentModels,
} from 'src/store/document-model';
import { useUser } from 'src/store/user';
import packageJson from '../../../../package.json';
import { Login } from '../../login';

const mapDocumentModelsToOptions = (documentModels: DocumentModel[]) =>
Expand Down Expand Up @@ -138,6 +140,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = props => {
'modals.connectSettings.clearStorage.description',
)}
/>
<DependencyVersions packageJson={packageJson} />
</ConnectSettingsModal>
);
};
Loading

0 comments on commit 3b71cba

Please sign in to comment.