forked from github/wulkanowy-mirror
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
78849f0280 | |||
78add470ba | |||
b39b9f8bba | |||
a50dfb3ea7 |
4
.gitignore
vendored
4
.gitignore
vendored
@ -46,5 +46,5 @@ ehthumbs.db
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
.idea/codeStyles/
|
.idea/codeStyles/
|
||||||
.idea/caches/
|
.idea/caches/
|
||||||
./app/key.p12
|
app/key.p12
|
||||||
./app/upload-key.jks
|
app/upload-key.jks
|
||||||
|
@ -5,6 +5,7 @@ import io.github.wulkanowy.api.VulcanException
|
|||||||
import io.github.wulkanowy.api.generic.School
|
import io.github.wulkanowy.api.generic.School
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
import java.net.URL
|
||||||
|
|
||||||
class StartPage(val client: Client) {
|
class StartPage(val client: Client) {
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ class StartPage(val client: Client) {
|
|||||||
fun getSchools(startPage: Document): MutableList<School> {
|
fun getSchools(startPage: Document): MutableList<School> {
|
||||||
val schoolList = mutableListOf<School>()
|
val schoolList = mutableListOf<School>()
|
||||||
|
|
||||||
val snpLinks = startPage.select(".panel.linkownia.pracownik.klient a")
|
val snpLinks = startPage.select(".panel.linkownia.pracownik.klient a[href*=\"uonetplus-opiekun\"]")
|
||||||
|
|
||||||
logger.debug("SnP links: {}", snpLinks.size)
|
logger.debug("SnP links: {}", snpLinks.size)
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ class StartPage(val client: Client) {
|
|||||||
snpLinks.map {
|
snpLinks.map {
|
||||||
schoolList.add(School(
|
schoolList.add(School(
|
||||||
it.text(),
|
it.text(),
|
||||||
getExtractedIdFromUrl(it.attr("href")),
|
getExtractedSchoolSymbolFromUrl(it.attr("href")),
|
||||||
it == snpLinks.first()
|
it == snpLinks.first()
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@ -32,10 +33,10 @@ class StartPage(val client: Client) {
|
|||||||
return schoolList
|
return schoolList
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun getExtractedIdFromUrl(snpPageUrl: String): String {
|
internal fun getExtractedSchoolSymbolFromUrl(snpPageUrl: String): String {
|
||||||
val path = snpPageUrl.split(client.host).getOrNull(1)?.split("/")
|
val path = URL(snpPageUrl).path.split("/")
|
||||||
|
|
||||||
if (6 != path?.size) {
|
if (6 != path.size) {
|
||||||
logger.error("Expected snp url, got {}", snpPageUrl)
|
logger.error("Expected snp url, got {}", snpPageUrl)
|
||||||
throw VulcanException("Na pewno używasz konta z dostępem do Witryny ucznia i rodzica?")
|
throw VulcanException("Na pewno używasz konta z dostępem do Witryny ucznia i rodzica?")
|
||||||
}
|
}
|
||||||
|
@ -51,18 +51,18 @@ class StartPageTest {
|
|||||||
@Test
|
@Test
|
||||||
fun getExtractedIDStandardTest() {
|
fun getExtractedIDStandardTest() {
|
||||||
assertEquals("123456", StartPage(client)
|
assertEquals("123456", StartPage(client)
|
||||||
.getExtractedIdFromUrl("https://uonetplus-opiekun.fakelog.cf/powiat/123456/Start/Index/"))
|
.getExtractedSchoolSymbolFromUrl("https://uonetplus-opiekun.fakelog.cf/powiat/123456/Start/Index/"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun getExtractedIDDemoTest() {
|
fun getExtractedIDDemoTest() {
|
||||||
assertEquals("demo12345", StartPage(client)
|
assertEquals("demo12345", StartPage(client)
|
||||||
.getExtractedIdFromUrl("https://uonetplus-opiekun.fakelog.cf/demoupowiat/demo12345/Start/Index/"))
|
.getExtractedSchoolSymbolFromUrl("https://uonetplus-opiekun.fakelog.cf/demoupowiat/demo12345/Start/Index/"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = VulcanException::class)
|
@Test(expected = VulcanException::class)
|
||||||
fun getExtractedIDNotLoggedTest() {
|
fun getExtractedIDNotLoggedTest() {
|
||||||
assertEquals("123", StartPage(client)
|
assertEquals("123", StartPage(client)
|
||||||
.getExtractedIdFromUrl("https://uonetplus.NOTfakelog.cf/powiat/"))
|
.getExtractedSchoolSymbolFromUrl("https://uonetplus.NOTfakelog.cf/powiat/"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,14 +10,16 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="panel linkownia pracownik klient">
|
<div class="panel linkownia pracownik klient">
|
||||||
<div id="idAppUczen" class="subDiv">
|
<div id="idAppUczen" class="subDiv">
|
||||||
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/123456/Start/Index/">
|
<div class="appLink">
|
||||||
<span class="header directLink">GIMBB</span>
|
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/123456/Start/Index/">
|
||||||
</a>
|
<span class="header directLink">GIMBB</span>
|
||||||
<br>
|
</a>
|
||||||
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/123457/Start/Index/">
|
<br>
|
||||||
<span class="header directLink">SPBB</span>
|
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/123457/Start/Index/">
|
||||||
</a>
|
<span class="header directLink">SPBB</span>
|
||||||
<br>
|
</a>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,13 +9,26 @@
|
|||||||
<div class="holder">
|
<div class="holder">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="panel linkownia pracownik klient">
|
<div class="panel linkownia pracownik klient">
|
||||||
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/534213/Start/Index/">
|
<div class="appLink">
|
||||||
<div class="imagedHeader directLink">
|
<a href="http://uonetplus-opiekun.fakelog.localhost:3000/default/534213/Start/Index/">
|
||||||
<div id="idEmptyAppUczeń">
|
<div class="imagedHeader directLink">
|
||||||
<div class="name">Uczeń</div>
|
<div id="idEmptyAppUczen">
|
||||||
|
<div class="name">Uczeń</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="newAppLink">
|
||||||
|
<div class="link">
|
||||||
|
<a href="http://uonetplus-uczen.fakelog.localhost:3000/default/012345/">
|
||||||
|
<div class="imagedHeader directLink">
|
||||||
|
<div id="idEmptyAppUczenExt">
|
||||||
|
<div class="name">Uczeń</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,13 +14,15 @@
|
|||||||
<div class="holder">
|
<div class="holder">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="panel linkownia pracownik klient">
|
<div class="panel linkownia pracownik klient">
|
||||||
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/534213/Start/Index/">
|
<div class="appLink">
|
||||||
<div class="imagedHeader directLink">
|
<a href="https://uonetplus-opiekun.fakelog.cf/symbol/534213/Start/Index/">
|
||||||
<div id="idEmptyAppUczeń">
|
<div class="imagedHeader directLink">
|
||||||
<div class="name">Uczeń</div>
|
<div id="idEmptyAppUczeń">
|
||||||
|
<div class="name">Uczeń</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</a>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,8 +43,8 @@ android {
|
|||||||
testApplicationId "io.github.tests.wulkanowy"
|
testApplicationId "io.github.tests.wulkanowy"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 27
|
targetSdkVersion 27
|
||||||
versionCode 16
|
versionCode 18
|
||||||
versionName "0.5.2"
|
versionName "0.5.4"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
playAccountConfig = playAccountConfigs.defaultAccountConfig
|
playAccountConfig = playAccountConfigs.defaultAccountConfig
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
Wersja 0.5.1:
|
Wersja 0.5.4:
|
||||||
- dodano wagę ocen na liście
|
- naprawiono błąd logowania
|
||||||
- naprawiono błędy podczas logowania
|
|
||||||
- zmieniono nasycenie kolorów ocen
|
|
||||||
- wyłączenie synchronizacji podczas wakacji
|
|
||||||
|
Reference in New Issue
Block a user