theforeman / foreman_rh_cloud

a plugin to Foreman that generates and uploads reports to the Red Hat cloud
GNU General Public License v3.0
6 stars 32 forks source link

Set autoupload when cloud connector is requested #767

Closed ShimShtein closed 2 years ago

ShimShtein commented 2 years ago

@Ron-Lavi can you take a look?

Ron-Lavi commented 2 years ago

@ShimShtein does it need to be cherry-picked?

ShimShtein commented 2 years ago

No, it's a new feature, we don't have to. Although it makes the configuration less prone to errors, so I would vote for cherry-picking.

Ron-Lavi commented 2 years ago

Well, we have the confirm modal in Foreman since Foreman 3.1 so it would be better to use that, here's an example usage: https://github.com/theforeman/foreman/blob/122f5378a5fbdc6f1946f72c47069be59012681b/webpack/assets/javascripts/react_app/components/HostDetails/Status/StatusTable.js#L17

so on button click, you will:

dispatch(
      openConfirmModal({
        title: 'some title',
        message: 'some message',
        isWarning: true, // better in our case
        onConfirm: () => {
          dispatch(configureCloudConnector());
        },
      })
    );
ShimShtein commented 2 years ago

@Ron-Lavi what about now?

Ron-Lavi commented 2 years ago

Thanks @ShimShtein !