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

DREF Import template #828

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

frozenhelium
Copy link
Member

@frozenhelium frozenhelium commented Apr 3, 2024

TODO

  • Write tests
  • Update cover page and add instructions
  • Add support descriptions to the fields
  • Add descriptions for all fields

Copy link

changeset-bot bot commented Apr 3, 2024

🦋 Changeset detected

Latest commit: bd703a2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
go-web-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@frozenhelium frozenhelium changed the title WIP DREF Import template Apr 3, 2024
Comment on lines +77 to +80
const name = row.getCell(1)?.name;
const value = getValueFromCellValue(row.getCell(2)?.value);

Copy link
Member

Choose a reason for hiding this comment

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

We need to add NOTE why we are using cell 1 and cell 2.

Comment on lines 9 to 10
"drefImportFailedDescription": "Failed to process the selected import file, make sure you've downloaded the import template from the GO platform.",
"drefImportButtonDescription": "Failed to process the selected import file, make sure you've downloaded the import template from the GO platform."
Copy link
Member

Choose a reason for hiding this comment

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

Do we need two different strings with the same content?

export interface Props {
drefId: number;
id: number;
status: DrefStatus | null | undefined;
status: null | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Any reason that we have status that can be only null or undefined ?


export const headerRowStyle: Partial<Style> = {
font: {
name: 'Montserrat',
Copy link
Member

Choose a reason for hiding this comment

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

Don't we have a constant for the font name?

Comment on lines 247 to 270
const firstRow = row.getCell(col);
firstRow.style = {
...firstRow.style,
fill: {
...firstRow.style?.fill,
...alternateRowFill,
},
};
const secondRow = row.getCell(col + 1);
secondRow.style = {
...secondRow.style,
fill: {
...secondRow.style?.fill,
...alternateRowFill,
},
};
const thirdRow = row.getCell(col + 2);
thirdRow.style = {
...thirdRow.style,
fill: {
...thirdRow.style?.fill,
...alternateRowFill,
},
};
Copy link
Member

Choose a reason for hiding this comment

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

These should be renamed to firstCell, secondCell, thirdCell

SHEET_OPERATION_OVERVIEW,
{ properties: { tabColor: { argb: hexToArgb(COLOR_PRIMARY_RED, '10') } } },
);
// TODO: Add red color to all the sheet tabs
Copy link
Member

Choose a reason for hiding this comment

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

I think this has been fixed. We can remove the comment.


options.forEach((option: TypeOfDrefEnum, i: number) => {
const cell = optionsWorksheet.getCell(i + 2, column.number);
cell.name = `${key}____${option.key}`;
Copy link
Member

Choose a reason for hiding this comment

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

We should standardize this operation with a function or a constant.

listToGroupList(
templateActions,
(templateAction) => {
const fieldName = String(templateAction.name).split('__')[0];
Copy link
Member

Choose a reason for hiding this comment

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

We should standardize this operation with a function or a constant.

worksheet.mergeCells(i + ROW_OFFSET, 1, i + ROW_OFFSET, 3);
lastHeadingIndex = i + 1;
} else if (templateAction.type === 'input') {
const mode = (i - lastHeadingIndex) % 2 === 0 ? 'listHeading' : 'heading';
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a NOTE on how this logic works.

Comment on lines +367 to +381
<RadioInput
name={undefined}
label="Select type of DREF for template"
options={dref_dref_dref_type}
keySelector={typeOfDrefKeySelector}
labelSelector={stringValueSelector}
value={typeOfDref}
onChange={setTypeOfDref}
// Only response type is available for now
disabled
/>
Copy link
Member

Choose a reason for hiding this comment

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

We should disable everything except the "Response" type

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's a requirement from client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants