Jetpack: Move connection owner admin notice

Created on 25 Apr 2020  路  1Comment  路  Source: Automattic/jetpack

In the JITM package, there is some code for a notice that is displaying when attempting to disconnect the connection owner. Where that notice is hooked, the following comment was written:

// Not really a JITM. Don't know where else to put this :) .

I'd like to suggest that we move that to one of the classes in the connection package since, in any plugin that uses the connection package, we'd likely want that notice to be displayed.

Connect Flow JITM [Pri] Low [Status] In Progress [Type] Question

Most helpful comment

Yes, this definitely needs to be moved to the connection package!

We identified some issues that make moving the JITM::delete_user_update_connection_owner_notice() method a bit complex:

  • The method obtains the connected users that have the jetpack_disconnect capability. That capability is set up in the Jetpack class.

  • The method includes a call to the Jetpack API, which is set up by the Jetpack plugin. We will probably need to create an API package.

  • The method includes strings that can be translated. We鈥檝e worked on a POC for allowing consuming plugins to set their textdomain in the packages here, but we haven鈥檛 had a chance to finalize the approach and finish that work yet.

We have a task card for this here: 1146297891914257-as-1146698724415329

>All comments

Yes, this definitely needs to be moved to the connection package!

We identified some issues that make moving the JITM::delete_user_update_connection_owner_notice() method a bit complex:

  • The method obtains the connected users that have the jetpack_disconnect capability. That capability is set up in the Jetpack class.

  • The method includes a call to the Jetpack API, which is set up by the Jetpack plugin. We will probably need to create an API package.

  • The method includes strings that can be translated. We鈥檝e worked on a POC for allowing consuming plugins to set their textdomain in the packages here, but we haven鈥檛 had a chance to finalize the approach and finish that work yet.

We have a task card for this here: 1146297891914257-as-1146698724415329

Was this page helpful?
0 / 5 - 0 ratings