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

Bulk unassign data policy for application #894

Merged

Conversation

GowthamShanmugam
Copy link
Contributor

@GowthamShanmugam GowthamShanmugam commented Jun 8, 2023

On top of: #892

@GowthamShanmugam GowthamShanmugam changed the title Rhstor 4655 Bulk unassign data policy for application Jun 8, 2023
@GowthamShanmugam
Copy link
Contributor Author

Bulk_un_assign8.mp4

title={title}
variant={variant}
isInline
className="odf-alert"
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this style defined? Please import the relevant files or add the declaration to a new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

);
};

export const ListViewMessages: React.FC<ListViewMessagesType> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const ListViewMessages: React.FC<ListViewMessagesType> = ({
export const ListViewMessages: React.FC<ListViewMessagesProps> = ({

const { t } = useCustomTranslation();
const { message, modalActionContext } = state;
return (
<React.Fragment>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<React.Fragment>
<>

t={t}
>
<Button variant={ButtonVariant.link} onClick={OnConfirm}>
{t('Confirm unassign')}{' '}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{t('Confirm unassign')}{' '}
{t('Confirm unassign')}

<React.Fragment>
{(modalActionContext === ModalActionContext.UN_ASSIGNING_POLICIES && (
<AlertMessage
title={message?.title}
Copy link
Contributor

Choose a reason for hiding this comment

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

When can message be undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

at the very beginning in the redux state, I am assigning a message as an empty object {}, also when the model action context is changed the message will be assigned, at least title wont be empty, description can be empty.

Comment on lines 50 to 56
([
ModalActionContext.UN_ASSIGN_POLICIES_SUCCEEDED,
ModalActionContext.UN_ASSIGN_POLICIES_FAILED,
].includes(modalActionContext) && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
([
ModalActionContext.UN_ASSIGN_POLICIES_SUCCEEDED,
ModalActionContext.UN_ASSIGN_POLICIES_FAILED,
].includes(modalActionContext) && (
(hasAssignFailedOrSuceeded(modalActionContext) && (

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reason I kept it like this, the list will keep growing in upcoming PRs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

but we can initialise this list outside the FC or create a helper function (with switch case) which will just return true/false based upon checks ??

Comment on lines 12 to 13
const AlertMessage: React.FC<AlertMessageType> = (props) => {
const { title, variant, children, t } = props;
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar Jun 21, 2023

Choose a reason for hiding this comment

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

nits: (since I have seen these types of comments on other PRs)

Suggested change
const AlertMessage: React.FC<AlertMessageType> = (props) => {
const { title, variant, children, t } = props;
const AlertMessage: React.FC<AlertMessageType> = ({ title, variant, children }) => {

title: string;
variant: AlertVariant;
children?: React.ReactNode;
t: TFunction;
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to pass t function as a prop...

searchText={searchText}
isActionDisabled={!state.policies.length}
onSearchChange={onSearchChange}
setModalActionContext={setModalActionContext}
setMessage={setMessage}
t={t}
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to pass t as a prop...

@GowthamShanmugam GowthamShanmugam force-pushed the RHSTOR-4655 branch 2 times, most recently from d84be53 to 9a4e5cf Compare June 21, 2023 16:26
Signed-off-by: Gowtham Shanmugasundaram <[email protected]>
@SanjalKatiyar
Copy link
Collaborator

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GowthamShanmugam, SanjalKatiyar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit a3160af into red-hat-storage:master Jun 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants