Skip to content

Commit

Permalink
Release to stage 03122024 (#477)
Browse files Browse the repository at this point in the history
* feat: added new selectors

* feat: Upload button selector ids

* feat: Input and Select  selector ids

* feat: User List table selector ids

* fix: MultipleSelect rename selector ids

* fix: Rename Upload component selctor ids

* feat: Modal action buttons selector ids-Add member and Upload constitution

* feat: AdminTopNav Search component selector id

* feat: Admin signout & modal selector ids

* feat: AdminTopNav buttons selector ids

* feat: Navigation links selector ids

* Feat: Footer selector ids

* feat: Constitution page selector ids

* feat: Latest updates and votes selector ids

* feat: GA table selector ids

* fix dockle scan on ci

* fix registry login

* debug imgs

* scan tar imgs

* test

* add tar cleanup

* test

* pr workflow fix

* declutter dockle

* add comment

* add microservice in pr comment

* test w/ individual service failing

* fix dockerfile

* fix: vote table row responsiveness

* Refactor/change logic for file upload to S3 (#328)

* refactor: changed getFileUrl function in order to display images on website for longer than 7 days

* refactor: changed getFileUrl function in order to display images on website for longer than 7 days

* feat: dht-queue (#336)

Added persistent dht-queue which will be responsible for publishing cid to dht

* refactor: image upload to S3 (#337)

* fitx/rationale-governance-format

Rationale - Removed body.references since it will be empty until CC-portal enables that feature
GAP title and abstract is now parsing in compatibility with CIP-0108 (body.title, body.abstract)

* chore: change guides btn link

* fix: rm-gap-title-abstract-len-constraint

Remove len constraints for gap.title and gap.abstract (was 80 and 2500 char length)
fixed error if db data is undefined when fetching from db sync

* refactor: add redis username

Added username env variable within backend/worker-service/ipfs-service

* Fix add redis creds (#343)

* feat: add redis user

* fix: add config to worker-service

* fix-add-redis-creds: fixed order within example.env

* fix: add docker compose args

---------

Co-authored-by: nike-getto <[email protected]>
Co-authored-by: BEDev24 <[email protected]>

* Fix add redis creds (#344)

* feat: add redis user

* fix: add config to worker-service

* fix-add-redis-creds: fixed order within example.env

* fix: add docker compose args

* refactor: cache docker-compose

---------

Co-authored-by: nike-getto <[email protected]>
Co-authored-by: BEDev24 <[email protected]>

* fix: typo

* fix: typo

* refactor: cache service

* refactor/redis-auth (#345)

* fix: plural grammar corrections

* refactor: pruning worker processors (#346)

* fix: latest updates content overlaping

* refactor: ipfs service path and minor refactoring

* fix: usersnap remove other buttons (#323)

* fix: Overlapping on tables

* fix: don't show top banner on mainnet

* fix: show more btn not loading more content, update env example

* refactor: renamed migration name for gap len constraint removal

* refactor: ipfs volume

* add correct vars (#352)

Co-authored-by: nike-getto <[email protected]>

* fix: ipfs-redis-service (#360)

* fix/ipfs-redis-service: tls connection to redis

* fix/ipfs-redis-service: tls connection to redis

* fix/gov-search-rationale-votes: user votes and rationale are being checked when data is fetched (#359)

Co-authored-by: BEDev24 <[email protected]>

* fix: usersnap showing all on path change

* fix: Remove comments for selector ids

* fix: Usersnap query params issue

* fix/logging-magic-link: disabled mailing on local (#363)

* fix: search not unchecking filters after clicking on clear

* fix/add-indexes-to-searchable-columns: added indexes to searcable columns in the database (#394)

* feat: resend register invite (#397)

* feature/resend-register-invite: added endpoint for resending the register invite

* feature/resend-register-invite: minor changes

* feature/resend-register-invite: minor changes

* feat: resend invitation, inactive/active, hard delete

* feature/hard-delete-user: added hard delete user ability (#398)

* Feat: hard delete user (#400)

* feature/hard-delete-user: added hard delete user ability

* feature/hard-delete-user: updated swagger

* feat: hard delete user (#401)

* feature/hard-delete-user: added hard delete user ability

* feature/hard-delete-user: updated swagger

* feature/hard-delete-user: try catch for removing profile photo

* feat: implement delete user

* chore: refactor delete button component

* test/remove-users: added unit tests (#406)

* fix/sorting-users: sorted users by name in ascending order (#408)

* feat: add switch user modal and remove X button from role bar on admin dashboard

* fix: allow super admin to change status of cc memeber

* fix/sync-votes: sync vote rationale url (#412)

* fix: sync votes (#418)

* fix/sync-votes: sync vote rationale url

* fix/sync-votes: fixed unit tests

* feat: constitution page design improvements

* refactor/open-port-3002

* added rationale link on latest updates table

* refactor/worker-bull-borad

* feat: implemented new contents design

* fix: contents scroll

* fix: navigation side bar visual known issues

* fix: tooltip not showing on accordion summary

* fix: tooltip not showing on accordion summary

* fix/change-user-name-validation: Endabled character | (pipe) in the user name (#443)

* fix: highlight selected heading in contents and fix layout issues on small device screens

* feat: add loader and registration username validation

* feat: merge ga and rationale modals and add links to footer

* chore: return deleted modal

* fix/bullmq-redis-reconnect: added option reconnect on error (#449)

* fix: changed tabs design, date formating, removed cta on memebers card, add guardrails btn on landing page

* fix: ga modal showing wrong date

* fix: handle date foramting types

* fix: resolve vertical shifting of table rows in the latest updates

* fix: members card description overlapping

* feat: add guardrails rationale button

* fix: constitution upload btn text overlap

* fix: toc overlapping constitution on smaller screens

* fix: lengthen user profile name

* feat: rationale cip-136 (#462)

* feature/rationale-cip-136: rationale json according cip-136

* feature/reationale-cip-136: polish unit test

* chore: rationale cip-136 (#464)

* feature/rationale-cip-136: rationale json according cip-136

* feature/reationale-cip-136: polish unit test

* feature/reationale-cip-136: minor changes

* fix: limit for users name (#465)

* fix/limit-for-users-name: users name limited to 64 characters

* fix/limit-for-users-name: users name limited to 64 characters

* fix: redirect admin to main home page after signing out

* Revert rationale-cip-136 (#467)

* feature/rationale-cip-136: rationale json according cip-136

* feature/reationale-cip-136: polish unit test

* feature/reationale-cip-136: minor changes

* Revert "feature/rationale-cip-136: rationale json according cip-136"

This reverts commit c5d3b8a.

* Revert "Revert "feature/rationale-cip-136: rationale json according cip-136""

This reverts commit 4201690.

* Revert "Revert "Revert "feature/rationale-cip-136: rationale json according cip-136"""

This reverts commit 148ebbb.

* fix: app error when multiple browser tabs are open

* chore: standardize latest updates close modal btn

* feat: add version history page

* fix: voting rationale should be CIP-136 compliant

* feat: change users role and permissions (#475)

* feature/change-users-role-and-permissions: provided endpoint for changing the user's role and permissions

* feature/change-users-roles-and-permissions: added postman collection

* feature/change-users-roles-and-permissions: changed post method to patch

* feature/change-users-roles-and-permissions: superadmin cannot be changed

* Revert "feat: change users role and permissions (#475)" (#476)

This reverts commit e32957e.

---------

Co-authored-by: nikolajovancevic <[email protected]>
Co-authored-by: Kristina <[email protected]>
Co-authored-by: Baja-KS <[email protected]>
Co-authored-by: Lazar Lukić <[email protected]>
Co-authored-by: Vojimirovich <[email protected]>
Co-authored-by: Vojimirovich <[email protected]>
Co-authored-by: nike-getto <[email protected]>
Co-authored-by: BEDev24 <[email protected]>
Co-authored-by: kubet <[email protected]>
Co-authored-by: Kristina <[email protected]>
Co-authored-by: Vojimirovich <[email protected]>
  • Loading branch information
12 people authored Dec 3, 2024
1 parent e0ce14c commit 2dbeb7b
Show file tree
Hide file tree
Showing 29 changed files with 587 additions and 397 deletions.
10 changes: 6 additions & 4 deletions frontend/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"title": "Cardano-Verfassung",
"drawer": {
"compare": "Vergleichen",
"latestRevisions": "Latest Revisions",
"versionHistory": "Version History",
"tableOfContents": "Contents",
"latest": "Latest"
"latest": "Latest",
"uploadNewVersion": "Upload new version",
"backToContents": "Back to contents"
}
},
"Members": {
Expand Down Expand Up @@ -204,10 +206,10 @@
"description": "Please provide rationale for your vote on specific governance action.",
"fields": {
"title": {
"label": "Title"
"label": "Summary"
},
"rationale": {
"label": "Rationale"
"label": "Rationale Statement"
}
},
"alerts": {
Expand Down
10 changes: 6 additions & 4 deletions frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"title": "Interim Constitution",
"drawer": {
"compare": "Compare",
"latestRevisions": "Latest Revisions",
"versionHistory": "Version History",
"tableOfContents": "Contents",
"latest": "Latest"
"latest": "Latest",
"uploadNewVersion": "Upload new version",
"backToContents": "Back to contents"
}
},
"Members": {
Expand Down Expand Up @@ -204,10 +206,10 @@
"description": "Please provide rationale for your vote on specific governance action.",
"fields": {
"title": {
"label": "Title"
"label": "Summary"
},
"rationale": {
"label": "Rationale"
"label": "Rationale Statement"
}
},
"alerts": {
Expand Down
3 changes: 3 additions & 0 deletions frontend/public/icons/DocumentSearch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions frontend/public/icons/Eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion frontend/src/app/[locale]/interim-constitution/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ export default function ConstitutionLayout({
}: {
children: React.ReactNode;
}) {
return <Box sx={{ backgroundColor: customPalette.bgWhite }}>{children}</Box>;
return (
<Box sx={{ backgroundColor: customPalette.bgWhite, minHeight: "100vh" }}>
{children}
</Box>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { ContentWrapper } from "@/components/atoms";
import { VersionHistory } from "@/components/organisms/Constitution/VersionHistory";
import { getConstitutionMetadata } from "@/lib/api";
import { Loading } from "@molecules";
import { Footer, NotFound, TopNav } from "@organisms";
import { isResponseErrorI } from "@utils";
import { Suspense } from "react";

export default async function VersionHistoryPage() {
const metadata = await getConstitutionMetadata();

return (
<>
<TopNav />
<Suspense fallback={<Loading />}>
{metadata && !isResponseErrorI(metadata) ? (
<ContentWrapper>
<VersionHistory metadata={metadata.reverse()} />
</ContentWrapper>
) : (
<>
<ContentWrapper>
<NotFound
title="constitution.title"
description="constitution.description"
/>
</ContentWrapper>
<Footer />
</>
)}
</Suspense>
</>
);
}
12 changes: 5 additions & 7 deletions frontend/src/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React from "react";

import { Footer, Hero, HeroActions, TopNav } from "@organisms";
import { unstable_setRequestLocale } from "next-intl/server"; // Import function to set the request-specific locale (unstable API).
import ClientRedirect from "@/components/molecules/ClientRedirect";
import { decodeUserToken } from "@/lib/api";
import { redirect } from "next/navigation";
import { PATHS } from "@consts";
import { ContentWrapper } from "@atoms";
import { PATHS } from "@consts";
import { Footer, Hero, HeroActions, TopNav } from "@organisms";
import { unstable_setRequestLocale } from "next-intl/server"; // Import function to set the request-specific locale (unstable API).

export default async function Home({ params: { locale } }) {
unstable_setRequestLocale(locale); // Sets the locale for the request. Use cautiously due to its unstable nature.
const user = await decodeUserToken();

if (user) {
redirect(`/${locale}/${PATHS.constitution}`);
return <ClientRedirect href={`/${locale}/${PATHS.constitution}`} />;
}
return (
<>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/atoms/TextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
import { TextareaAutosize, styled } from "@mui/material";
import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";

import { TextAreaProps } from "./types";
import { poppins } from "@consts";
import { TextAreaProps } from "./types";

const TextAreaBase = styled(TextareaAutosize)(
() => `
Expand All @@ -20,7 +20,7 @@ const TextAreaBase = styled(TextareaAutosize)(
);

export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
({ errorMessage, maxLength = 500, onBlur, onFocus, ...props }, ref) => {
({ errorMessage, maxLength, onBlur, onFocus, ...props }, ref) => {
const textAraeRef = useRef<HTMLTextAreaElement>(null);

const handleFocus = useCallback(
Expand All @@ -45,7 +45,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
({
focus: handleFocus,
blur: handleBlur,
...textAraeRef.current,
...textAraeRef.current
} as unknown as HTMLTextAreaElement),
[handleBlur, handleFocus]
);
Expand All @@ -61,7 +61,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
outline: "none",
padding: "12px 14px",
resize: "none",
overflow: "scroll",
overflow: "scroll"
}}
maxLength={maxLength}
ref={textAraeRef}
Expand Down
31 changes: 31 additions & 0 deletions frontend/src/components/molecules/ClientRedirect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client";
import type { Route } from "next";
import { useRouter } from "next/navigation";
import { useEffect } from "react";

/**
* For client-side redirects in React Server Components (RSC)
*
* Trying to redirect in server using `redirect` from `next/navigation`
* gives an odd error "Rendered more hooks than during the previous render"
* which seems impossible to debug, as we don't have any hooks that are
* conditionally rendered or skipped. There's no solution available for this
* specific problem; most solutions point to checking for conditional hooks.
*
* At present, client-based redirection works correctly, therefore we are
* creating a client component whose function is purely to redirect. It
* doesn't return any JSX.Element. Note that we should return this component
* early, otherwise the other components will flash while redirecting.
*
* @param {Route} href - The route path to which the client will be redirected.
* @returns {null} - Returns null as void is not assignable to JSX.Element.
*/
export default function ClientRedirect({ href }: { href: Route }): null {
const router = useRouter();

useEffect(() => {
router.push(href);
}, [href, router]);

return null;
}
12 changes: 6 additions & 6 deletions frontend/src/components/molecules/Field/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
FormErrorMessage,
FormHelpfulText,
TextArea as TextAreaBase,
Typography,
Typography
} from "@atoms";

import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
Expand All @@ -21,7 +21,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(
label,
labelStyles,
layoutStyles,
maxLength = 500,
maxLength,
onBlur,
onFocus,
...props
Expand Down Expand Up @@ -52,7 +52,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(
({
focus: handleFocus,
blur: handleBlur,
...textAreaRef.current,
...textAreaRef.current
} as unknown as HTMLTextAreaElement),
[handleBlur, handleFocus]
);
Expand All @@ -63,7 +63,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(
flexDirection: "column",
width: "100%",
position: "relative",
...layoutStyles,
...layoutStyles
}}
>
{label && (
Expand Down Expand Up @@ -95,11 +95,11 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(
sx={{
bottom: errorMessage ? 35 : 14,
position: "absolute",
right: 15,
right: 15
}}
variant="caption"
>
{props?.value?.toString()?.length ?? 0}/{maxLength}
{maxLength && `${props?.value?.toString()?.length ?? 0}/${maxLength}`}
</Typography>
</Box>
);
Expand Down
20 changes: 7 additions & 13 deletions frontend/src/components/organisms/Constitution/Constitution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { useScreenDimension } from "@hooks";
import { Box, Grid, IconButton } from "@mui/material";
import { useTranslations } from "next-intl";
import { MDXRemote } from "next-mdx-remote";
import { useEffect, useState } from "react";
import { useState } from "react";
import { Footer } from "../Footer";
import { DrawerMobile } from "../TopNavigation";
import { ConstitutionProps } from "../types";
import { ConstitutionSidebar } from "./ConstitutionSidebar";
import { ContentsSidebar } from "./ContentsSidebar";
import {
Code,
Heading1,
Expand All @@ -27,16 +27,10 @@ import TOCLink from "./TOCLink";

export function Constitution({ constitution, metadata }: ConstitutionProps) {
const { screenWidth } = useScreenDimension();
const [isOpen, setIsOpen] = useState(true);
const [isOpen, setIsOpen] = useState(false);
const isMobile = screenWidth < 1025;
const t = useTranslations("Constitution");

useEffect(() => {
if (isMobile) {
setIsOpen(false);
}
}, [isMobile]);

const onTOCLinkClick = () => {
if (isMobile) {
setIsOpen(false);
Expand All @@ -52,11 +46,11 @@ export function Constitution({ constitution, metadata }: ConstitutionProps) {
sx={TABLE_OF_CONTENTS_WRAPPER_STYLE_PROPS}
rowGap={0}
>
<ConstitutionSidebar tableOfContents={children} metadata={metadata} />
<ContentsSidebar tableOfContents={children} />
</DrawerMobile>
) : (
<NavDrawerDesktop top={{ xxs: 0, md: 85 }} left={0}>
<ConstitutionSidebar tableOfContents={children} metadata={metadata} />
<ContentsSidebar tableOfContents={children} />
</NavDrawerDesktop>
),
h1: Heading1,
Expand Down Expand Up @@ -102,9 +96,9 @@ export function Constitution({ constitution, metadata }: ConstitutionProps) {
md={isOpen ? 8 : 11}
ml={{ xxs: 0, lg: "404px" }}
>
<Box display="flex" flexDirection="column" flex={1}>
<Box display="flex" flexDirection="column" flex={1} gap={1}>
<ContentWrapper>
<Box px={{ xxs: 3, lg: 5 }}>
<Box px={{ xxs: 2, lg: 5 }}>
<Box
display="flex"
justifyContent="space-between"
Expand Down
Loading

0 comments on commit 2dbeb7b

Please sign in to comment.