-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional features for common validation options (#149)
* WIP presets dropdown * WIP ips au preset * Rename extension, ig, and profile state * Add update code for extensions * Add profiles to presets, add all required presets * Make pretty * Check IPS codes, add bundle validation rules to presets * Use i18n for presets * Add options checkbox for IPS codes * Rename re-used extension display * WIP add bundle validation rule widget, fix some session id update logic * Layout tweaks * Adjust font * Add help text for bundle validation, layout improvements * Refactor file upload buttons * Add preset widget to upload page * Adjust preset widget layout and description
- Loading branch information
Showing
34 changed files
with
1,263 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package constants | ||
|
||
const val ANY_EXTENSION = "any" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package model | ||
|
||
expect class BundleValidationRule() { | ||
fun getRule(): String | ||
fun setRule(rule: String): BundleValidationRule | ||
|
||
fun getProfile(): String | ||
fun setProfile(profile: String): BundleValidationRule | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package model | ||
|
||
import kotlinx.js.Object | ||
import kotlinx.serialization.Serializable | ||
import utils.Preset | ||
|
||
@Serializable | ||
actual class BundleValidationRule actual constructor() { | ||
|
||
private var rule: String = "" | ||
private var profile: String = "" | ||
|
||
actual fun getRule(): String { | ||
return rule | ||
} | ||
|
||
actual fun setRule(rule: String): BundleValidationRule { | ||
this.rule = rule | ||
return this | ||
} | ||
|
||
actual fun getProfile(): String { | ||
return profile | ||
} | ||
|
||
actual fun setProfile(profile: String): BundleValidationRule { | ||
this.profile = profile | ||
return this | ||
} | ||
|
||
override fun hashCode(): Int { | ||
return toDisplayString(this).hashCode() | ||
} | ||
|
||
override fun equals(other: Any?): Boolean { | ||
if (other !is BundleValidationRule) { | ||
return false | ||
} else { | ||
return rule.equals(other.getRule()) && profile.equals(other.getProfile()) | ||
} | ||
} | ||
|
||
companion object { | ||
fun toDisplayString(rule:BundleValidationRule): String { | ||
return "${rule.rule} ${rule.profile}" | ||
} | ||
|
||
fun findByDisplayString(displayString : String, collection : Collection<BundleValidationRule>) : BundleValidationRule? { | ||
for (rule in collection) { | ||
if (displayString == toDisplayString(rule)) { | ||
return rule | ||
} | ||
} | ||
return null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.