fleet/orbit/pkg/useraction/mdm_migration.go
Roberto Dip e57f90fbac
fix display issues with screenshot in MDM migration flow (#11866)
For #11858, I reproduced the issue by running a local server behind
ngrok, _with the exact_ same path as the one in the website:
`https://server-url/images/permanent/mdm-migration-screenshot-768x180@2x.png`

I tried multiple combinations, but at the end, removing the `@` made the
trick. My guess is that's something to do with the markdown parser
library used by swiftDIalog.

I also removed a rogue `\` that was being displayed.
2023-05-23 14:29:42 -03:00

35 lines
1.2 KiB
Go

package useraction
import "github.com/fleetdm/fleet/v4/server/fleet"
// MDMMigrator represents the minimum set of methods a migration must implement
// in order to be used by Fleet Desktop.
type MDMMigrator interface {
// CanRun indicates if the migrator is able to run, for example, for macOS it
// checks if the swiftDialog executable is present.
CanRun() bool
// SetProps sets/updates the props.
SetProps(MDMMigratorProps)
// Show displays the dialog if there's no other dialog running.
Show() error
// ShowInterval is used to display dialogs at an interval. It displays
// the dialog if there's no other dialog running and a given interval
// (defined by the migrator itself) has passed since the last time the
// dialog was shown.
ShowInterval() error
// Exit tries to stop any processes started by the migrator.
Exit()
}
// MDMMigratorProps are props required to display the dialog. It's akin to the
// concept of props in UI frameworks like React.
type MDMMigratorProps struct {
OrgInfo fleet.DesktopOrgInfo
IsUnmanaged bool
}
// MDMMigratorHandler handles remote actions/callbacks that the migrator calls.
type MDMMigratorHandler interface {
NotifyRemote() error
ShowInstructions()
}