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

feat: (Platform) introduce Approval Flow component - Phase 1 #4059

Closed
wants to merge 29 commits into from

Conversation

IlyaSurmay
Copy link
Contributor

Please provide a link to the associated issue.

#3403
tech spec - https://app.gitbook.com/@fundamental-ngx/s/docs/platform-approval-flow

Please provide a brief summary of this pull request.

This PR introduces a new Approval Flow component (phase 1 implementation)
Functionality included in Phase 1:

  • render approval flow graph
  • show watchers
  • send reminder to single approver
  • send reminders to multiple approvers
  • show details of member of approval team
  • show details of watcher
  • carousel mode
  • keyboard navigation

Please check whether the PR fulfills the following requirements

Documentation checklist:

@IlyaSurmay IlyaSurmay added the platform platform label Dec 9, 2020
@IlyaSurmay IlyaSurmay self-assigned this Dec 9, 2020
@netlify
Copy link

netlify bot commented Dec 9, 2020

✔️ Deploy preview for fundamental-ngx ready!

🔨 Explore the source changes: 0d3f21e

🔍 Inspect the deploy logs: https://app.netlify.com/sites/fundamental-ngx/deploys/5fe1d53fd7360d000791e39d

😎 Browse the preview: https://deploy-preview-4059--fundamental-ngx.netlify.app

@IlyaSurmay IlyaSurmay marked this pull request as ready for review December 9, 2020 13:30
@InnaAtanasova InnaAtanasova requested a review from a team December 9, 2020 13:41
@InnaAtanasova InnaAtanasova added this to the Sprint 52 - Ariba milestone Dec 9, 2020
Copy link
Contributor

@dimamarksman dimamarksman left a comment

Choose a reason for hiding this comment

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

Looks good!
Added some comments.

@dimamarksman
Copy link
Contributor

Looks broken in RTL mode
image

<div class="approval-flow-node__info">
<div class="approval-flow-node__name">
<ng-container *ngIf="node.approvers.length === 1">{{ node.approvers[0].name }}</ng-container>
<ng-container *ngIf="node.approvers.length > 1">{{ node.approvers.length }} members</ng-container>
Copy link
Contributor

Choose a reason for hiding this comment

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

please add internalization

color: #0854A0;
color: var(--sapButton_IconColor, #0854A0);
position: relative;
top: 1px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have it rem

fdp-standard-list-item {
.fd-checkbox__label {
position: relative;
left: 5px;
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to try to avoid using px, it will impact responsiveness.

@Component({
selector: 'fdp-test-approval-flow',
template: `
<fdp-approval-flow [title]="title" [dataSource]="dataSource"></fdp-approval-flow>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a query, how datasource is helping here us comparing to using angular basic approaches(*ngFor, array etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using dataSource was a requirement from the tech spec.

I don't get why *ngFor, array is compared to the DataSource here, they work independently, DataSource provides methods for retrieving approval flow's data and manipulating that data in any way, *ngFor and etc are internal Angular tools that are used quite a lot in this component's code.

As far as I can tell, for a complex component like this one using DataSource is preferable way, otherwise the component's number of inputs and outputs would be quite big. Also using DataSource allows to have all data logic in one place

* Update watcher list. Called whenever there is a change
* to the watcher list.
*/
updateWatchers(watchers: ApprovalUser[]): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same query as above, how a datasource with abstract functions helping in workflow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

answered above

@sKudum
Copy link
Contributor

sKudum commented Dec 15, 2020

it seems RTL mode it is breaking.
2020-12-15_15-38-12

@Betrozov
Copy link
Contributor

Betrozov commented Dec 15, 2020

approval
approval2

is it correct?

@IlyaSurmay IlyaSurmay force-pushed the feat-approval-flow-phase-1 branch from ea80e4a to 1c80c9e Compare December 16, 2020 13:03
@IlyaSurmay
Copy link
Contributor Author

@Betrozov @sKudum
RTL has been fixed

@Betrozov no designs were provided for different themes so maybe need to clarify this with the designers. I've changed some variables so now it looks more or less OK with different themes

@sKudum changed px to rem, left only a few in places where rem isn't suitable such as fixed dimensions or border widths

@sKudum
Copy link
Contributor

sKudum commented Dec 16, 2020

@Betrozov @sKudum
RTL has been fixed

@Betrozov no designs were provided for different themes so maybe need to clarify this with the designers. I've changed some variables so now it looks more or less OK with different themes

@sKudum changed px to rem, left only a few in places where rem isn't suitable such as fixed dimensions or border widths

Thank you @IlyaSurmay for addressing the comments. Could you please have a look at this. (In RTL mode content is aligned to LTR)

2020-12-16_18-52-45

Copy link
Contributor

@dimamarksman dimamarksman left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments!
I left one more regarding translation.

@IlyaSurmay IlyaSurmay force-pushed the feat-approval-flow-phase-1 branch from 194abf0 to 8844dd4 Compare December 17, 2020 17:04
}

/** @hidden */
setListItems(items: ApprovalUser[]): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

all hidden methods should be prefixed with _

Copy link
Contributor

@InnaAtanasova InnaAtanasova left a comment

Choose a reason for hiding this comment

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

Impressive! LGTM

@JKMarkowski JKMarkowski changed the base branch from master to main December 18, 2020 17:26
@IlyaSurmay IlyaSurmay force-pushed the feat-approval-flow-phase-1 branch from 8844dd4 to 89b6222 Compare December 22, 2020 09:44
@IlyaSurmay
Copy link
Contributor Author

closed in favor of #4177

@IlyaSurmay IlyaSurmay closed this Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants