Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input-Validation #9

Merged
merged 135 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
601fde1
add formik & yup
chalabi2 Aug 30, 2024
047af63
proposal submisison form validaiton
chalabi2 Aug 30, 2024
75b21bb
add input tests | update proposal tests
chalabi2 Aug 31, 2024
f450bc6
prettier changes
chalabi2 Aug 31, 2024
92169f3
eslint/prettier integration
chalabi2 Aug 31, 2024
6ff8755
add validation to create gorup forms | update group form tests
chalabi2 Sep 1, 2024
7bc853e
remove duplicate tests
chalabi2 Sep 1, 2024
02f95ef
add validation to sendForms
chalabi2 Sep 1, 2024
798d93b
add misisng state to sendFormTest
chalabi2 Sep 1, 2024
2bda059
add validation and test for group update
chalabi2 Sep 2, 2024
dfabc0a
add profanity filter to exisitng validation
chalabi2 Sep 2, 2024
1b32348
fix profanity on yup when building
chalabi2 Sep 2, 2024
5187c96
fix: denom can be null
fmorency Sep 3, 2024
e69395d
add admin page validation
chalabi2 Sep 3, 2024
15eb0c2
factory tx form validation
chalabi2 Sep 4, 2024
19a8476
test: refactor and more tests
fmorency Sep 4, 2024
3709436
Merge remote-tracking branch 'chalabi/main' into more-more-more-tests
fmorency Sep 4, 2024
afd08f6
fix sidenav/add some colors
chalabi2 Sep 4, 2024
1616fec
validation on metabox
chalabi2 Sep 4, 2024
999c9bc
fix tests
chalabi2 Sep 4, 2024
96212c6
Merge branch 'main' into more-more-more-tests
chalabi2 Sep 4, 2024
0e9cdfd
Merge pull request #7 from fmorency/more-more-more-tests
chalabi2 Sep 4, 2024
aca7ad3
Resolve merge issues
chalabi2 Sep 4, 2024
c6e4581
Merge pull request #6 from fmorency/fix-denom-err
chalabi2 Sep 4, 2024
941b76a
fix sidenav tooltips
chalabi2 Sep 4, 2024
715096a
finish factory validaiton
chalabi2 Sep 4, 2024
417c454
begin sidenav redesign
chalabi2 Sep 5, 2024
37b49e0
update nav icons
chalabi2 Sep 5, 2024
1c068a2
finalize sidenav | start wallet
chalabi2 Sep 6, 2024
eaa40d0
wallet & toast redesign
chalabi2 Sep 6, 2024
155b8e0
side drawer toggle
chalabi2 Sep 6, 2024
0c56909
match figma colors
chalabi2 Sep 7, 2024
7b8229f
update deps
chalabi2 Sep 7, 2024
9c35a9b
start bank
chalabi2 Sep 7, 2024
61b8e32
chore: add missing autoprefixer package
fmorency Sep 9, 2024
ba29cec
fix: admin option component and test
fmorency Sep 9, 2024
91f52be
fix: tests
fmorency Sep 9, 2024
0474b92
chore: remove debug print
fmorency Sep 9, 2024
f91faf9
fix: jest-dom matcher
fmorency Sep 9, 2024
72f6894
fix: restore mock after test run
fmorency Sep 9, 2024
23a2115
fix: unmock denom image
fmorency Sep 9, 2024
eb6c73f
Revert "fix: unmock denom image"
fmorency Sep 9, 2024
2f4d06f
ci: run test serially
fmorency Sep 9, 2024
e765606
Revert "ci: run test serially"
fmorency Sep 9, 2024
9c49802
test: mark denom image tests as skipped for now
fmorency Sep 9, 2024
ef733d5
ci: run lcov version of coverage
fmorency Sep 9, 2024
4447f6d
Merge pull request #8 from fmorency/fix-package
chalabi2 Sep 9, 2024
fca6f37
Merge branch 'main' of https://github.com/chalabi2/manifest-app
chalabi2 Sep 9, 2024
afea82b
wallet and toast redesigns
chalabi2 Sep 10, 2024
a19ff85
send token box redesign
chalabi2 Sep 11, 2024
0b03ea5
update sendbox and send form tests
chalabi2 Sep 11, 2024
53729af
update validation in sendbox
chalabi2 Sep 11, 2024
6d33b2b
update stacking contexts
chalabi2 Sep 12, 2024
28b3bcd
update
chalabi2 Sep 12, 2024
f30a23f
tx history design update
chalabi2 Sep 13, 2024
6afba7d
bank page finsished | add mobile compat
chalabi2 Sep 16, 2024
5ad7391
better breakpoints
chalabi2 Sep 16, 2024
83f9364
fix bank component tests
chalabi2 Sep 16, 2024
49d1048
fix bank page modals
chalabi2 Sep 16, 2024
f7745ff
minor bug
chalabi2 Sep 16, 2024
d632433
begin group redesign
chalabi2 Sep 17, 2024
379babc
change proposal view
chalabi2 Sep 17, 2024
f9a2248
finish design conversion for proposals and groups
chalabi2 Sep 17, 2024
17f30ae
revert proposal submissio to older working version
chalabi2 Sep 18, 2024
0b469cd
add group info modal
chalabi2 Sep 18, 2024
0d71dfe
dark/light groups page
chalabi2 Sep 18, 2024
966a488
fix group info modal
chalabi2 Sep 19, 2024
b772dd0
start group skeletons
chalabi2 Sep 19, 2024
240efde
add info update & members modals
chalabi2 Sep 20, 2024
c3e4efa
better member validation
chalabi2 Sep 21, 2024
59f3699
details | policy, group creation form redesign
chalabi2 Sep 21, 2024
f59b492
group creation flow redesign
chalabi2 Sep 24, 2024
5986371
finish group creation flow
chalabi2 Sep 24, 2024
6b8fcfb
update message selection
chalabi2 Sep 25, 2024
8825126
update message editing
chalabi2 Sep 25, 2024
f0224b4
finish proposal
chalabi2 Sep 26, 2024
8cbb707
finish vote details modal
chalabi2 Sep 27, 2024
9057b08
convert admin page
chalabi2 Oct 3, 2024
8a58e47
remove unused hdr files
chalabi2 Oct 3, 2024
4d189bf
more landing page work
chalabi2 Oct 4, 2024
732571c
token factory page, token creation flow
chalabi2 Oct 7, 2024
d1829d6
token creation confirmation page
chalabi2 Oct 8, 2024
60e70da
lots of stuff
chalabi2 Oct 16, 2024
bb2aca6
swap to lifteds endpoints | add contacts
chalabi2 Oct 22, 2024
d602e78
fix contact colors
chalabi2 Oct 22, 2024
93c80d7
define any types | fix admin page
chalabi2 Oct 22, 2024
3cca870
fix send message validation
chalabi2 Oct 22, 2024
0ef9669
finish restyling payout shareholders modals
chalabi2 Oct 23, 2024
71b3940
finish multimint transactions
chalabi2 Oct 23, 2024
d057e21
Merge branch 'main' into main
chalabi2 Oct 23, 2024
7b5da4a
add endpoint selector | begin integrated contacts
chalabi2 Oct 29, 2024
e8523d2
Merge branch 'main' of https://github.com/chalabi2/manifest-app
chalabi2 Oct 29, 2024
960112f
add contacts to more inputs
chalabi2 Oct 29, 2024
eea0ef5
fix contact modal rendering
chalabi2 Nov 4, 2024
31083b1
integrate yaci
chalabi2 Nov 5, 2024
9e8f38e
integrate nodes guru explorer
chalabi2 Nov 5, 2024
c6693de
proper namespaces || coderabbit reviews || various fixes
chalabi2 Nov 6, 2024
54a1c06
simplify author render
chalabi2 Nov 6, 2024
b8b4dc5
fix: validatorList test
fmorency Nov 6, 2024
b26254d
fix: validator modal test
fmorency Nov 6, 2024
c68d989
fix: groupInfo tests
fmorency Nov 6, 2024
1b6b59c
fix: test mock types
fmorency Nov 6, 2024
c1804f0
fix: my group test
fmorency Nov 6, 2024
309975e
fix: step indicator test
fmorency Nov 6, 2024
0aed294
fix: mock apexcharts
fmorency Nov 6, 2024
e341ce3
fix: group proposal test
fmorency Nov 6, 2024
527729b
fix: type field in proposal message to accomodate FE
fmorency Nov 6, 2024
2aa6ff6
fix: update group modal test
fmorency Nov 6, 2024
ad450fe
fix: token list test
fmorency Nov 6, 2024
3df4a0c
fix: ibc send form test
fmorency Nov 6, 2024
f5b544a
fix: send form test
fmorency Nov 6, 2024
ec48891
fix: remove unused component and test
fmorency Nov 6, 2024
35fcd99
chore: remove unused component
fmorency Nov 6, 2024
c64b44c
fix: my denoms test
fmorency Nov 6, 2024
0d492c9
fix: ignore fonts with prettier
fmorency Nov 6, 2024
dc757e3
bank page breakpoints || wallet breakpoints
chalabi2 Nov 7, 2024
e7430df
chore: remove unused component
fmorency Nov 7, 2024
caf7a94
fix: token details form test
fmorency Nov 7, 2024
4ec7ea4
fix: tf burn test
fmorency Nov 7, 2024
7b7663e
fix: confirmation form test
fmorency Nov 7, 2024
fa0ebeb
fix: create denom test
fmorency Nov 7, 2024
a103b33
fix: mint form test
fmorency Nov 7, 2024
e3a535e
fix: group details form test
fmorency Nov 7, 2024
4b8aff3
fix: confirmation form test
fmorency Nov 7, 2024
967da28
fix: group policy form test
fmorency Nov 7, 2024
cdc8b98
fix: member info form test
fmorency Nov 7, 2024
6461f5d
fix: success test
fmorency Nov 7, 2024
3071081
fix: proposal confirmation form test
fmorency Nov 7, 2024
eaf76b3
fix: proposal details form test
fmorency Nov 7, 2024
85de75f
fix: message proposal test
fmorency Nov 7, 2024
21e3959
fix: proposal metadata form test
fmorency Nov 7, 2024
bafc402
fix: proposal success form test
fmorency Nov 7, 2024
342c675
fix: tests after merge
fmorency Nov 7, 2024
7677c77
fix: send box test
fmorency Nov 7, 2024
e110292
Merge pull request #10 from fmorency/fixes
chalabi2 Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install dependencies
run: bun install
- name: Run tests and generate coverage
run: bun run test:coverage
run: bun run test:coverage:lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Ignore artifacts:
build
coverage
public/fonts/*.json
11 changes: 10 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
{}
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"arrowParens": "avoid"
}
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.validate": ["typescript", "typescriptreact"],
"typescript.tsdk": "node_modules/typescript/lib"
}
Binary file modified bun.lockb
Binary file not shown.
219 changes: 219 additions & 0 deletions components/3js/animatedAsterisk.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
import { Canvas, useFrame } from '@react-three/fiber';
import { Suspense, useRef, useMemo, useEffect } from 'react';
import { Mesh, Vector3, BufferAttribute, BufferGeometry } from 'three';
import { Environment } from '@react-three/drei';
import * as THREE from 'three';

function createExtrudedGeometry(extrusion: number) {
const originalGeometry = new THREE.IcosahedronGeometry(3, 0);
const extrudedGeometry = new THREE.BufferGeometry();

const positions = originalGeometry.attributes.position.array as Float32Array;
const normals = originalGeometry.attributes.normal.array as Float32Array;

const vertices: number[] = [];
const vertexNormals: number[] = [];
const vertexIndices: number[] = [];

const vertexMap = new Map<string, number>();
let vertexCount = 0;

// Function to add a vertex and avoid duplicates
function addVertex(x: number, y: number, z: number, nx: number, ny: number, nz: number) {
const key = `${x},${y},${z}`;
if (vertexMap.has(key)) {
return vertexMap.get(key)!;
} else {
vertices.push(x, y, z);
vertexNormals.push(nx, ny, nz);
vertexMap.set(key, vertexCount);
return vertexCount++;
}
}

// Iterate over each face (triangle) in the non-indexed geometry
for (let i = 0; i < positions.length; i += 9) {
// Original vertices
const v0 = new Vector3(positions[i], positions[i + 1], positions[i + 2]);
const v1 = new Vector3(positions[i + 3], positions[i + 4], positions[i + 5]);
const v2 = new Vector3(positions[i + 6], positions[i + 7], positions[i + 8]);

// Compute the face normal
const n = new Vector3().subVectors(v1, v0).cross(new Vector3().subVectors(v2, v0)).normalize();

// Extruded vertices
const v0e = v0.clone().add(n.clone().multiplyScalar(extrusion));
const v1e = v1.clone().add(n.clone().multiplyScalar(extrusion));
const v2e = v2.clone().add(n.clone().multiplyScalar(extrusion));

// Add original face
const a = addVertex(v0.x, v0.y, v0.z, n.x, n.y, n.z);
const b = addVertex(v1.x, v1.y, v1.z, n.x, n.y, n.z);
const c = addVertex(v2.x, v2.y, v2.z, n.x, n.y, n.z);
vertexIndices.push(a, b, c);

// Add extruded face (reversed winding order)
const aE = addVertex(v0e.x, v0e.y, v0e.z, n.x, n.y, n.z);
const bE = addVertex(v1e.x, v1e.y, v1e.z, n.x, n.y, n.z);
const cE = addVertex(v2e.x, v2e.y, v2e.z, n.x, n.y, n.z);
vertexIndices.push(aE, cE, bE);

// Add side faces
function addSide(vStart: number, vEnd: number, vStartE: number, vEndE: number) {
// Compute normal for side face
const sideNormal = new Vector3()
.subVectors(
new Vector3(vertices[vEnd * 3], vertices[vEnd * 3 + 1], vertices[vEnd * 3 + 2]),
new Vector3(vertices[vStart * 3], vertices[vStart * 3 + 1], vertices[vStart * 3 + 2])
)
.cross(
new Vector3().subVectors(
new Vector3(
vertices[vStartE * 3],
vertices[vStartE * 3 + 1],
vertices[vStartE * 3 + 2]
),
new Vector3(vertices[vStart * 3], vertices[vStart * 3 + 1], vertices[vStart * 3 + 2])
)
)
.normalize();

// Add vertices and indices for side face
const a = vStart;
const b = vEnd;
const c = vEndE;
const d = vStartE;

vertexIndices.push(a, b, c);
vertexIndices.push(a, c, d);

// Override normals for side faces
for (const vi of [a, b, c, d]) {
vertexNormals[vi * 3] = sideNormal.x;
vertexNormals[vi * 3 + 1] = sideNormal.y;
vertexNormals[vi * 3 + 2] = sideNormal.z;
}
}

// Side face between v0 and v1
addSide(a, b, aE, bE);
// Side face between v1 and v2
addSide(b, c, bE, cE);
// Side face between v2 and v0
addSide(c, a, cE, aE);
}

extrudedGeometry.setAttribute('position', new BufferAttribute(new Float32Array(vertices), 3));
extrudedGeometry.setAttribute('normal', new BufferAttribute(new Float32Array(vertexNormals), 3));
extrudedGeometry.setIndex(vertexIndices);

return extrudedGeometry;
}

function AnimatedMesh({
scaleFactor,
extrusionMultiplier,
onLoad,
}: {
scaleFactor: number;
extrusionMultiplier: number;
onLoad?: () => void;
}) {
const meshRef = useRef<Mesh>(null);
const extrusionAmountRef = useRef(0);

const geometry = useMemo(() => {
return createExtrudedGeometry(2); // Start with no extrusion
}, []);

// Create material
const material = useMemo(() => {
return new THREE.MeshStandardMaterial({
color: '#A287FF',
metalness: 1,
roughness: 0.1,
envMapIntensity: 1,
side: THREE.DoubleSide, // Ensure both sides are rendered
});
}, []);

useFrame(({ mouse, scene }) => {
if (meshRef.current) {
meshRef.current.rotation.x += (-mouse.y * 0.5 - meshRef.current.rotation.x) * 0.1;
meshRef.current.rotation.y += (mouse.x * 0.5 - meshRef.current.rotation.y) * 0.1;

const distanceFromCenter = Math.sqrt(mouse.x * mouse.x + mouse.y * mouse.y);

// Update the extrusion amount
const newExtrusion = Math.max(distanceFromCenter * extrusionMultiplier, 0);

if (extrusionAmountRef.current !== newExtrusion) {
extrusionAmountRef.current = newExtrusion;
// Update geometry with new extrusion amount
const newGeometry = createExtrudedGeometry(newExtrusion);
meshRef.current.geometry.dispose();
meshRef.current.geometry = newGeometry;
}

const scale = 1 - distanceFromCenter * 0.01;
const finalScale = Math.max(scale, 0.5) * scaleFactor;
meshRef.current.scale.setScalar(finalScale);

// Ensure the environment map is set
if (material.envMap !== scene.environment) {
material.envMap = scene.environment;
material.needsUpdate = true;
}
}
});

useEffect(() => {
if (meshRef.current) {
// Mesh is loaded
onLoad?.();
}
}, [onLoad]);

return <mesh ref={meshRef} geometry={geometry} material={material} />;
}

export default function AnimatedAsterisk({ onLoad }: { onLoad?: () => void }) {
const levels = 3; // Number of nested icosahedrons
const meshes = [];
const loadedMeshes = useRef(0);

const handleMeshLoad = () => {
loadedMeshes.current += 1;
if (loadedMeshes.current === levels) {
onLoad?.();
}
};

for (let i = 0; i < levels; i++) {
const scaleFactor = 1 - i * 0.2; // Adjust scale for each level
const extrusionMultiplier = 2 / Math.pow(2, i); // Halve the multiplier at each level

meshes.push(
<AnimatedMesh
key={i}
scaleFactor={scaleFactor}
extrusionMultiplier={extrusionMultiplier}
onLoad={handleMeshLoad}
/>
);
}

return (
<Canvas
style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }}
camera={{ position: [0, 0, 10] }}
>
<ambientLight intensity={0.2} />

<Suspense fallback={null}>
{meshes}
<Environment files="/rosendal_park_sunset_puresky_4k.hdr" background={false} />
</Suspense>
</Canvas>
);
}
Loading
Loading