Fix for #8426 - Migration steps displayed in a different order than UI specifications
Changed the order of the whitelisted migrations in order to respect the UI specifications. Now using linked hash map instead of hash map for the whitelisted migrations so we can preserve the order of the steps upon status changing in the migration process.master
parent
d65bd4f7cd
commit
640d24974f
|
@ -91,29 +91,23 @@ class MigrationProgressActivity : AbstractMigrationProgressActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// These are the only items we want to show migrating in the UI.
|
// These are the only items we want to show migrating in the UI.
|
||||||
internal val whiteList = mapOf(
|
internal val whiteList = linkedMapOf(
|
||||||
Bookmarks to R.string.preferences_sync_bookmarks,
|
Settings to R.string.settings_title,
|
||||||
History to R.string.preferences_sync_history,
|
History to R.string.preferences_sync_history,
|
||||||
Logins to R.string.migration_text_passwords,
|
Bookmarks to R.string.preferences_sync_bookmarks,
|
||||||
Settings to R.string.settings_title
|
Logins to R.string.migration_text_passwords
|
||||||
)
|
)
|
||||||
|
|
||||||
internal fun MigrationResults.toItemList() = filterKeys {
|
internal fun MigrationResults.toItemList() = whiteList.keys
|
||||||
whiteList.keys.contains(it)
|
.map {
|
||||||
}.map { (type, status) ->
|
if (containsKey(it)) {
|
||||||
MigrationItem(
|
MigrationItem(it, getValue(it).success)
|
||||||
type,
|
} else {
|
||||||
status.success
|
MigrationItem(it)
|
||||||
)
|
}
|
||||||
}.toMutableList()
|
}
|
||||||
.plus(
|
|
||||||
whiteList
|
|
||||||
.filterKeys { !this.containsKey(it) }
|
|
||||||
.keys
|
|
||||||
.map { MigrationItem(it, false) }
|
|
||||||
).sortedBy { it.migration.javaClass.simpleName }
|
|
||||||
|
|
||||||
internal data class MigrationItem(val migration: Migration, val status: Boolean)
|
internal data class MigrationItem(val migration: Migration, val status: Boolean = false)
|
||||||
|
|
||||||
internal class MigrationStatusAdapter :
|
internal class MigrationStatusAdapter :
|
||||||
ListAdapter<MigrationItem, MigrationStatusAdapter.ViewHolder>(DiffCallback) {
|
ListAdapter<MigrationItem, MigrationStatusAdapter.ViewHolder>(DiffCallback) {
|
||||||
|
|
Loading…
Reference in New Issue