Skip to content

Commit

Permalink
chore: merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Dec 4, 2023
2 parents 5f4968b + e3600c1 commit 6d7a8a4
Show file tree
Hide file tree
Showing 63 changed files with 835 additions and 240 deletions.
5 changes: 5 additions & 0 deletions .changeset/chatty-plants-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/dapp': minor
---

Add better popover for filtering VCs on dashboard
5 changes: 5 additions & 0 deletions .changeset/chilled-bugs-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blockchain-lab-um/masca': patch
---

Replaced @metamask/snaps-types, snaps-utils and snaps-ui with @metamask/snaps-sdk
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
pnpm-version: 8.9.2
node-version: 18.18.2
pnpm-version: 8.11.0
node-version: 20.10.0
number-of-agents: 4
main-branch-name: 'develop'
init-commands: |
Expand All @@ -34,5 +34,5 @@ jobs:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
number-of-agents: 4
pnpm-version: 8.9.2
node-version: 18.18.2
pnpm-version: 8.11.0
node-version: 20.10.0
8 changes: 4 additions & 4 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
secrets:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
pnpm-version: 8.9.2
node-version: 18.18.2
pnpm-version: 8.11.0
node-version: 20.10.0
number-of-agents: 2
main-branch-name: 'develop'
parallel-commands-on-agents: |
Expand All @@ -26,5 +26,5 @@ jobs:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
with:
number-of-agents: 2
pnpm-version: 8.9.2
node-version: 18.18.2
pnpm-version: 8.11.0
node-version: 20.10.0
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0
- uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -58,10 +58,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0
- uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -147,10 +147,10 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0
- uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.9.2
version: 8.11.0

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.18.2
node-version: 20.10.0
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.18.2
v20.10.0
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:18.18.2-alpine3.16
FROM node:20.10.0-alpine3.18

WORKDIR /app

# Install pnpm
RUN npm i -g pnpm@8.9.2
RUN npm i -g pnpm@8.11.0

# Copy patches
COPY ./patches ./patches
Expand Down Expand Up @@ -37,8 +37,6 @@ COPY . .
# that depend on some of the files copied above
RUN pnpm install --frozen-lockfile

# Copy nx-cloud.env
COPY ./nx-cloud.env ./
ENV NODE_ENV=production

# For Dapp to build as Standalone
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"packageManager": "pnpm@8.9.2",
"packageManager": "pnpm@8.11.0",
"engines": {
"node": ">=18.18.2"
"node": ">=20.10.0"
},
"volta": {
"node": "18.18.2",
"pnpm": "8.9.2"
"node": "20.10.0",
"pnpm": "8.11.0"
},
"pnpm": {
"patchedDependencies": {
Expand All @@ -96,8 +96,7 @@
"[email protected]": "patches/[email protected]",
"@ceramicnetwork/[email protected]": "patches/@[email protected]",
"@changesets/[email protected]": "patches/@[email protected]",
"@metamask/[email protected]": "patches/@[email protected]",
"@metamask/[email protected]": "patches/@[email protected]"
"@metamask/[email protected]": "patches/@[email protected]"
},
"allowNonAppliedPatches": true
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM blockchain-lab-um/masca:latest as builder

FROM node:18.18.2-alpine3.16
FROM node:20.10.0-alpine3.18

# Create app directory
RUN mkdir -p /app
Expand Down
4 changes: 2 additions & 2 deletions packages/dapp/src/components/Controlbar/Controlbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import clsx from 'clsx';
import { useTranslations } from 'next-intl';

import ImportModal from '@/components/ImportModal';
import DataStoreCombobox from '@/components/VCTable/DataStoreCombobox';
import GlobalFilter from '@/components/VCTable/GlobalFilter';
import ViewTabs from '@/components/VCTable/ViewTabs';
import { stringifyCredentialSubject } from '@/utils/format';
import { useGeneralStore, useMascaStore, useToastStore } from '@/stores';
import FilterPopover from '../VCTable/FilterPopover';

// import PlaygroundModal from '../PlaygroundModal';

Expand Down Expand Up @@ -162,7 +162,7 @@ const Controlbar = () => {
<div className="mb-4 grid grid-cols-11 grid-rows-2 gap-y-4 md:grid-rows-1">
{vcs.length > 0 && (
<div className="col-span-11 col-start-1 row-start-2 flex gap-x-2 md:col-span-5 md:row-start-1">
<DataStoreCombobox isConnected={isConnected} vcs={vcs} />
<FilterPopover vcs={vcs} />
<GlobalFilter isConnected={isConnected} vcs={vcs} />
</div>
)}
Expand Down
25 changes: 25 additions & 0 deletions packages/dapp/src/components/VCTable/FilterPopover/CheckBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';

interface CheckBoxProps {
selected: boolean;
setSelected: (selected: boolean) => void;
children: React.ReactNode;
}

export const CheckBox = ({
selected,
setSelected,
children,
}: CheckBoxProps) => (
<div className="dark:text-navy-blue-200 flex items-center font-medium text-gray-700">
<input
className="dark:accent-orange-accent-dark h-4 w-4 accent-pink-500"
type="checkbox"
checked={selected}
onChange={() => {
setSelected(!selected);
}}
/>
<span className="ml-2 max-w-[190px] truncate">{children}</span>
</div>
);
111 changes: 111 additions & 0 deletions packages/dapp/src/components/VCTable/FilterPopover/CredentialTypes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import React, { useState } from 'react';
import { ChevronRightIcon } from '@heroicons/react/24/solid';
import clsx from 'clsx';
import { useTranslations } from 'next-intl';

import { useTableStore } from '@/stores';
import { CheckBox } from './CheckBox';

export const CredentialTypes = () => {
const t = useTranslations('FilterPopover');

const [open, setOpen] = useState(false);
const { credentialTypes, setCredentialTypes } = useTableStore((state) => ({
credentialTypes: state.credentialTypes,
setCredentialTypes: state.setCredentialTypes,
}));
const [filter, setFilter] = useState('');

return (
<div>
<div className="flex items-center justify-between pr-2">
<button
onClick={() => {
setOpen(!open);
}}
>
<div className="dark:text-navy-blue-100 my-1 ml-2 flex items-center gap-x-2 text-gray-700">
<ChevronRightIcon
className={clsx(
'animated-transition h-5 w-5 ',
`${open ? 'rotate-90' : ''}`
)}
/>
{t('type')}
</div>
</button>
{open &&
(credentialTypes.filter((type) => type.selected).length > 0 ? (
<button
className="text-sm text-red-500 hover:text-red-700 dark:text-red-300 hover:dark:text-red-500"
onClick={() => {
setCredentialTypes(
credentialTypes.map((type) => ({
...type,
selected: false,
}))
);
}}
>
clear ({credentialTypes.filter((type) => type.selected).length})
</button>
) : (
<button
className="text-sm text-red-500 hover:text-red-700 dark:text-red-300 hover:dark:text-red-500"
onClick={() => {
setCredentialTypes(
credentialTypes.map((type) => ({
...type,
selected: true,
}))
);
}}
>
select all
</button>
))}
</div>
{open && (
<div className="dark:bg-navy-blue-500/40 bg-[#FFF8F9] p-2">
<input
className="dark:bg-navy-blue-700 dark:text-navy-blue-50 dark:border-navy-blue-400 w-full rounded-md border border-gray-300 bg-white px-2 py-1 focus:outline-none"
placeholder="Search Types..."
onChange={(e) => {
setFilter(e.target.value);
}}
value={filter}
/>
<div className="scrollbar-thumb-rounded scrollbar-thumb-pink-500 dark:scrollbar-thumb-orange-accent-dark scrollbar-thin mt-2 max-h-[160px] overflow-scroll overflow-x-hidden">
{credentialTypes.map((type) => {
if (!type.type.toLowerCase().includes(filter.toLowerCase())) {
return null;
}

return (
<div key={type.type} className="my-2">
<CheckBox
selected={type.selected}
setSelected={(selected) => {
const newCredentialTypes = credentialTypes.map((tp) => {
if (tp.type === type.type) {
return {
...type,
selected,
};
}
return tp;
});
setCredentialTypes(newCredentialTypes);
}}
>
{type.type}
</CheckBox>
</div>
);
})}
</div>
</div>
)}
</div>
);
};
Loading

0 comments on commit 6d7a8a4

Please sign in to comment.