Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-31 15:09:12 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-31 15:09:12 +0300
commit8243505178033432b7fc6834eef425c9dcdfd7bc (patch)
tree0497dc786de7ae7563141055bc67d43645489f69 /app/assets/javascripts/vue_shared/components/runner_instructions
parentdcbe65b8b6d3be931c10a823d1271318f70b1507 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/runner_instructions')
-rw-r--r--app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue17
1 files changed, 12 insertions, 5 deletions
diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue b/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue
index 9eaaf7d1c18..1236cd900d1 100644
--- a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue
+++ b/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions_modal.vue
@@ -134,7 +134,10 @@ export default {
const { registerInstructions } = this.instructions || {};
if (this.registrationToken) {
- return registerInstructions.replace(REGISTRATION_TOKEN_PLACEHOLDER, this.registrationToken);
+ return registerInstructions?.replace(
+ REGISTRATION_TOKEN_PLACEHOLDER,
+ this.registrationToken,
+ );
}
return registerInstructions;
@@ -155,9 +158,13 @@ export default {
selectPlatform(platform) {
this.selectedPlatform = platform;
- if (!platform.architectures?.some(({ name }) => name === this.selectedArchitectureName)) {
- // Select first architecture when current value is not available
- this.selectArchitecture(platform.architectures[0]);
+ // Update architecture when platform changes
+ const architectures = platform.architectures || [];
+ const arch = architectures.find(({ name }) => name === this.selectedArchitectureName);
+ if (arch) {
+ this.selectArchitecture(arch);
+ } else {
+ this.selectArchitecture(architectures[0]);
}
},
selectArchitecture(architecture) {
@@ -220,7 +227,7 @@ export default {
v-for="platform in platforms"
:key="platform.name"
:ref="platform.name"
- :selected="selectedPlatform && selectedPlatform.name === platform.name"
+ :selected="selectedPlatformName === platform.name"
@click="selectPlatform(platform)"
>
{{ platform.humanReadableName }}