-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
06dec14
to
0173cb5
Compare
@@ -94,6 +94,15 @@ export const coreComponents = [ | |||
fetchTransformationPlansUrl: | |||
'/api/service_templates/?' + | |||
"filter[]=type='ServiceTemplateTransformationPlan'" + | |||
'&filter[]=deleted_on=nil' + |
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.
If I read @agrare's email correctly... "You shouldn't need to use the deleted on attribute directly, there is an active and an archived scope that you should be able to use."... this doesn't make sense?
@agrare can you confirm these two query filters for archived/unarchived are correctly constructed?
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.
@priley86 I can confirm that the following works:
>> ServiceTemplate.active
=> #<ActiveRecord::Relation [#<ServiceTemplate id: 1, name: nil, description: nil, guid: "ffd1a950-a007-49d8-891f-9c4741c5dbb9", type: nil, service_template_id: nil, options: {}, created_at: "2018-06-01 13:07:25", updated_at: "2018-06-01 13:07:25", display: nil, evm_owner_id: nil, miq_group_id: 1, service_type: "unknown", prov_type: nil, provision_cost: nil, service_template_catalog_id: nil, long_description: nil, tenant_id: 1, generic_subtype: nil, deleted_on: nil>]>
>> ServiceTemplate.archived
=> #<ActiveRecord::Relation []>
I can't confirm how that should be accessed through the API
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.
@agrare To be able to use ServiceTemplate.archived
in an API, we would need archived
to be a virtual column I think.
Accessing deleted_on
directly is working well in the API, and should be OK to use it directly since there are no other complexities involved with the archived
/ unarchived
logic.
deleted_on
== nil
is unarchived
deleted_on
!= nil
is archived
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.
Oh really having it as a scope isn't enough? Well if you can get it working through the API and put a PR to core in I'll merge it.
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.
@agrare I just created this core PR - ManageIQ/manageiq#17509
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.
@agrare Looks like we will need a PR to amend the virtual column to archived
,
since archived?
works for this case -
/api/service_templates/<id>?attributes=archived?
but not for this case -
/api/service_templates?filter[]=archived?=false
, what @michaelkro is using above
(There seems to be a bug with filter
in the API... not sure how easy it is to resolve. From what I can tell it's related to MiqExpression
)
@@ -176,8 +186,11 @@ class Overview extends React.Component { | |||
|
|||
createTransformationPlanRequestAction(url).then(() => { | |||
retryMigrationAction(planId); | |||
setMigrationsFilterAction('Migration Plans in Progress'); | |||
fetchTransformationPlansAction(fetchTransformationPlansUrl); | |||
setMigrationsFilterAction('In Progress Plans'); |
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.
Looking at these again... it would be nice to break the "In Progress Plans", "Migration Plans in Progress", "Migration Plans Not Started" strings out into constants across the board. It seems like "In Progress Plans" is the same as "Migration Plans in Progress" ?
'Migration Plans Not Started', | ||
'Migration Plans in Progress', | ||
'Migration Plans Completed' | ||
'Not Started Plans', |
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.
ahh you are renaming them in an array. Can we also reference the strings as constants?
@@ -81,15 +96,15 @@ const Migrations = ({ | |||
</Grid.Col> | |||
{transformationPlans.length > 0 && ( | |||
<React.Fragment> | |||
{activeFilter === 'Migration Plans Not Started' && ( | |||
{activeFilter === 'Not Started Plans' && ( |
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.
same here...constants preferred.
{failed && ( | ||
<p> | ||
{__( | ||
'This plan includes VMs that failed to migrate. If you archive the plan, you will not be able to retry the failed migrations' |
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.
Missing period at the end
"If you archive the plan, you will not be able to retry the failed migrations."
c544975
to
a935941
Compare
bd24d29
to
a935941
Compare
yes i'm fine w/ this... |
Our CI script runs builds using node 6 and 6.10. Please see node.green |
I'm not sure how important Node6 support is for v2v at this point. It's nice having the support, but doesn't seem required anymore. My guess is we should just stay in sync w/ ui-classic which appears to be @AparnaKarve @AllenBW can you confirm? |
@priley86 Agree, let's stay in sync with ui-classic |
6172381
to
93060c9
Compare
can you rebase #391 when you get a chance? there was a request to merge that one first just now... |
Yup, no worries! |
d8d602a
to
cb5962b
Compare
e5b1b17
to
2864998
Compare
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.
LGTM! @vconzola did you have a chance to review?
this looks good to me! will go ahead and rebase my branch locally... @AparnaKarve are we OK to merge this now or do we need to resolve the filter issue above on the backend first? |
@serenamarie125 I wasn't listed as a reviewer, but it looks good to me too. |
'There are no existing migration plans in a Completed state.' | ||
{sprintf( | ||
__('There are no existing migration plans in %s state.'), | ||
archived ? 'an Archived' : 'a Completed' | ||
)} |
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.
The archived
conditional needs to decide what message to display...
So if archived
is true, then
sprintf(__('There are no existing migration plans in an Archived state.'))
and likewise the other message for archived
= false
The only reason why I'm suggesting this change is because not all languages work like English.
For e.g. in a different language, the sentence construction rules or the grammar may not be the same as English and the %s
placeholder may not work grammatically.
Also there is no gettext for an Archived
and a Completed
, and we need that.
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.
Updated :)
I squashed my commit to help those working on the G backport
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.
Cool! :)
That looks good!
* Add archive button to Completed Migrations ListView * Set up fetching so that archived and active (unarchived) plans are returned separately. * Set up POST to archive a plan * Modify MigrationsCompletedList to also be used for display of archived plans ADDITIONAL CHANGES * Refactor to remove usage of Object.values() due to node support * Extract migrations filters strings to constants
2864998
to
37d3d34
Compare
Other than the above comment, everything else looks just great!! Thanks @michaelkro !! |
fetchArchivedTransformationPlansUrl: PropTypes.string, | ||
archivedTransformationPlans: PropTypes.array, | ||
allArchivedPlanRequestsWithTasks: PropTypes.array, | ||
isFetchingArchivedTransformationPlans: PropTypes.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.
Was the string intentional here?
I'm seeing...
miq_debug.self-1351f771c2cd2fab0d83069fd3f62aadbb7effc11a01ed4942f52308793453be.js?body=1:30 Warning: Failed prop type: Invalid prop `loading` of type `string` supplied to `Spinner`, expected `boolean`.
in Spinner (created by Overview)
in Overview (created by Connect(Overview))
and given the condition...
<Spinner
loading={
!requestsWithTasksPreviouslyFetched &&
!this.hasMadeInitialPlansFetch &&
(isFetchingAllRequestsWithTasks ||
isFetchingProviders ||
isFetchingTransformationPlans ||
isFetchingArchivedTransformationPlans ||
isFetchingTransformationMappings)
}
When isFetchingArchivedTransformationPlans
is the first truthy value, it gets passed to loading
.
Not sure if you want an explicit !! isFetchingArchivedTransformationPlans
to convert to bool, or if this should never have been a string.
Can you take a look please @michaelkro ?
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.
Hi @himdel, I've been noticing that error as well but just haven't had the time to fully investigate why that particular value is a string.
In some cases, we have used IDs as flags to isolate loading state, e.g., disable the migrate button for a specific migration plan ListItem after it is clicked.
However, that being said, I will take a look and at the very least put up a PR coercing it to a bool, since that is really all we need in this case.
Thanks for taking the time to report the issue!
Enable archiving of completed transformation plans (successful & errored)
returned separately.
archived plans
ADDITIONAL CHANGES
Closes #314, #315, #316
Notes
To quickly unarchive all your plans, use the following command in the rails console
Alternatively, use the
unarchive!
method on individual recordsBig thank you to @AparnaKarve for showing me how to set up filters when fetching plans!
Screens
Flow
Archive Button
Archive Modal (Plan with unmigrated VMs)
Archive List
Archive Details
Archive Empty