generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML4SE-234] Scenario config is ready.
- Loading branch information
mikrise2
committed
Nov 21, 2023
1 parent
ddc6a35
commit 036cf5f
Showing
9 changed files
with
245 additions
and
229 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
8 changes: 8 additions & 0 deletions
8
ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/survey/Survey.kt
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,8 @@ | ||
package org.jetbrains.research.tasktracker.config.survey | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Survey(val id: String, val htmlQuestions: List<HtmlQuestion>) { | ||
fun toHtml() = htmlQuestions.joinToString(System.lineSeparator()) { it.toHtml() } | ||
} |
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
14 changes: 3 additions & 11 deletions
14
...c/main/kotlin/org/jetbrains/research/tasktracker/ui/main/panel/template/SurveyTemplate.kt
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 |
---|---|---|
@@ -1,26 +1,18 @@ | ||
package org.jetbrains.research.tasktracker.ui.main.panel.template | ||
|
||
import org.jetbrains.research.tasktracker.TaskTrackerPlugin | ||
import org.jetbrains.research.tasktracker.config.survey.SurveyConfig | ||
import org.jetbrains.research.tasktracker.config.survey.Survey | ||
import org.jetbrains.research.tasktracker.requests.FileRequests | ||
import org.jetbrains.research.tasktracker.ui.main.panel.storage.MainPanelStorage | ||
|
||
class SurveyTemplate(val config: SurveyConfig) : HtmlBaseFileTemplate() { | ||
class SurveyTemplate(val survey: Survey) : HtmlBaseFileTemplate() { | ||
override val contentFilename: String | ||
get() = "survey" | ||
|
||
override val cssFilename: String | ||
get() = "survey" | ||
|
||
override val arguments: Array<String> | ||
get() = arrayOf(request(), config.toHtml()) | ||
get() = arrayOf(request(), survey.toHtml()) | ||
|
||
private fun request() = "${FileRequests.DOMAIN}/confirm-survey?id=${MainPanelStorage.currentResearchId}" | ||
|
||
companion object { | ||
fun loadCurrentTemplate(): SurveyTemplate { | ||
val config = TaskTrackerPlugin.mainConfig.surveyConfig ?: error("surveyConfig has not initialized yet!") | ||
return SurveyTemplate(config) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.