-
Notifications
You must be signed in to change notification settings - Fork 14
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
consolidate add-edit-duplicate modals #1732
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, some questions and suggestions but nothing seems to be a blocker to not merge this PR.
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts
Outdated
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts
Outdated
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.model.ts
Outdated
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.data.service.ts
Outdated
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/feature-flags.service.ts
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/core/feature-flags/store/feature-flags.selectors.ts
Show resolved
Hide resolved
frontend/projects/upgrade/src/app/shared/services/common-text-helpers.service.ts
Outdated
Show resolved
Hide resolved
return { name, key, description, appContext, tags }; | ||
} | ||
|
||
deriveName(sourceFlag: FeatureFlag, action: string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why derive values separately for every property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's your suggested code improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u try this?
deriveInitialFormValues(sourceFlag: FeatureFlag, action: string) {
return {
name: action === UPSERT_FEATURE_FLAG_ACTION.EDIT ? sourceFlag?.name : '',
key: action === UPSERT_FEATURE_FLAG_ACTION.EDIT ? sourceFlag?.key : '',
description: sourceFlag?.description || '',
appContext: sourceFlag?.context?.[0] || '',
tags: sourceFlag?.tags || [],
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what I'd like to avoid doing, what's the benefit in jamming all that in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll ask in the dev mtg, I'm curious what others say, I guess I have a very different coding style than the rest of the team in general, I want to do what is comfortable for everyone.
} | ||
} | ||
|
||
createRequest(action: UPSERT_FEATURE_FLAG_ACTION, sourceFlag?: FeatureFlag): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of createRequest
, something like sendRequest
?
} | ||
|
||
a { | ||
text-decoration: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this removed? @zackcl The design show link shouldn't be underlined.
|
||
.learn-more-link { | ||
color: var(--blue); | ||
text-decoration: underline; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in figma we don't have underlines in learn more redirect links, can you confirm @zackcl ?
<mat-icon>file_upload</mat-icon> | ||
<p class="ft-14-600 drag-text">Drag & drop or</p> | ||
<button mat-flat-button color="primary" (click)="fileInput.click()"> | ||
<span class="material-symbols-outlined">upload</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how are you able to get the upload icon here without mat-icon @zackcl just curious.
Opening as draft, is dependent on the backend updates Ben has made, but otherwise should be good for review.
This consolidates the ADD, EDIT, and DUPLICATE modals into a common template modal
UpsertFeatureFlagModal
, as they are nearly identical except for a couple of straightforward params.This adds the DUPLICATE modal to the FF details menu. The only actual difference between ADD and DUPLICATE is the title and we add
_COPY_CHANGE_ME
to the name and key.