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

Add manage application button #4182

Open
wants to merge 9 commits into
base: feature/4126-sidebar-locked
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,20 @@

.title {
display: flex;
align-items: center;
align-items: baseline;
justify-content: space-between;
margin-bottom: 16px;
font-size: var(--size-smallish);
font-weight: var(--weight-bold);
color: color-mod(var(--dark) alpha(85%));
letter-spacing: var(--spacing-medium);
}

.titleIconWrapper {
display: flex;
align-items: center;
}

.label {
font-size: var(--size-smallish);
font-weight: var(--weight-bold);
Expand Down Expand Up @@ -143,3 +149,9 @@
.editIcon:hover {
cursor: pointer;
}

.manageButton {
composes: themeBlue from '~core/Button/Button.css';
font-size: var(--size-smallish);
letter-spacing: var(--spacing-medium);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export const nameInputs: string;
export const descriptionWrapper: string;
export const description: string;
export const title: string;
export const titleIconWrapper: string;
export const label: string;
export const namesWrapper: string;
export const slideDown: string;
export const editIcon: string;
export const manageButton: string;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useMemo } from 'react';
import { defineMessages, FormattedMessage } from 'react-intl';

import Button from '~core/Button';
import { FormSection, InputLabel, SelectHorizontal, Form } from '~core/Fields';
import Icon from '~core/Icon';
import { Stages } from '~pages/IncorporationPage/constants';
Expand Down Expand Up @@ -40,6 +41,10 @@ export const MSG = defineMessages({
id: `dashboard.Incorporation.IncorporationForm.LockedIncorporationForm.editApplication`,
defaultMessage: 'Edit application',
},
manageApplication: {
id: `dashboard.Incorporation.IncorporationForm.LockedIncorporationForm.manageApplication`,
defaultMessage: 'Manage application',
},
});

const displayName = `dashboard.Incorporation.IncorporationForm.LockedIncorporationForm`;
Expand All @@ -59,19 +64,32 @@ const LockedIncorporationForm = ({ formValues, activeStageId }: Props) => {
[altName1, altName2],
);

const hasPermissions = true; // add logic here to check if user has permissions to manage the application

return (
<div className={styles.container}>
<FormSection appearance={{ border: 'bottom' }}>
<div className={styles.title}>
<FormattedMessage {...MSG.incorporation} />
{activeStageId !== Stages.Complete && (
<span className={styles.editIcon}>
<Icon
name="edit"
appearance={{ size: 'medium' }}
title={MSG.editApplication}
/>
</span>
<div className={styles.titleIconWrapper}>
<FormattedMessage {...MSG.incorporation} />
{activeStageId !== Stages.Complete && (
<span className={styles.editIcon}>
<Icon
name="edit"
appearance={{ size: 'medium' }}
title={MSG.editApplication}
/>
</span>
)}
</div>
{hasPermissions && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add a comment here that this button needs to be wired up.

// This button now does nothing.
// It has to be connected wiht proper action (added in Stage 2).
<Button
text={MSG.manageApplication}
appearance={{ theme: 'blue' }}
className={styles.manageButton}
/>
)}
</div>
</FormSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { getMainClasses } from '~utils/css';
import { SpinnerLoader } from '~core/Preloaders';
import IncorporationForm from '~dashboard/Incorporation/IncorporationForm';
import Stages, { FormStages } from '~dashboard/ExpenditurePage/Stages';
import LockedIncorporationForm from '~dashboard/Incorporation/IncorporationForm/LockedIncorporationForm';
import VerificationBanner from '~dashboard/Incorporation/VerificationBanner';
import IncorporationPaymentDialog from '~dashboard/Dialogs/IncorporationPaymentDialog';
import { useDialog } from '~core/Dialog';
import LockedIncorporationForm from '~dashboard/Incorporation/IncorporationForm/LockedIncorporationForm';

import {
initialValues,
Expand Down