Skip to content

Commit 0715057

Browse files
committed
Extract job-status-rotate to global circular-spin animation class
1 parent 7008c0e commit 0715057

File tree

8 files changed

+17
-19
lines changed

8 files changed

+17
-19
lines changed

templates/repo/actions/status.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{else if eq .status "blocked"}}
1717
{{svg "octicon-blocked" $size (printf "text yellow %s" $className)}}
1818
{{else if eq .status "running"}}
19-
{{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}}
19+
{{svg "octicon-meter" $size (printf "text yellow circular-spin %s" $className)}}
2020
{{else}}{{/*failure, unknown*/}}
2121
{{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}}
2222
{{end}}

web_src/css/base.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,3 +1192,13 @@ the "!important" is necessary to override Fomantic UI menu item styles, meanwhil
11921192
.svg.octicon-file-directory-symlink {
11931193
color: var(--color-secondary-dark-7);
11941194
}
1195+
1196+
.circular-spin {
1197+
animation: circular-spin-keyframes 1s linear infinite;
1198+
}
1199+
1200+
@keyframes circular-spin-keyframes {
1201+
100% {
1202+
transform: rotate(-360deg);
1203+
}
1204+
}

web_src/js/components/ActionRunStatus.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ withDefaults(defineProps<{
2424
<SvgIcon name="octicon-stop" class="text yellow" :size="size" :class="className" v-else-if="status === 'cancelled'"/>
2525
<SvgIcon name="octicon-clock" class="text yellow" :size="size" :class="className" v-else-if="status === 'waiting'"/>
2626
<SvgIcon name="octicon-blocked" class="text yellow" :size="size" :class="className" v-else-if="status === 'blocked'"/>
27-
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
27+
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class="'circular-spin ' + className" v-else-if="status === 'running'"/>
2828
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else/><!-- failure, unknown -->
2929
</span>
3030
</template>

web_src/js/components/RepoActionView.vue

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ export default defineComponent({
574574
<!-- If the job is done and the job step log is loaded for the first time, show the loading icon
575575
currentJobStepsStates[i].cursor === null means the log is loaded for the first time
576576
-->
577-
<SvgIcon v-if="isDone(run.status) && currentJobStepsStates[i].expanded && currentJobStepsStates[i].cursor === null" name="octicon-sync" class="tw-mr-2 job-status-rotate"/>
577+
<SvgIcon v-if="isDone(run.status) && currentJobStepsStates[i].expanded && currentJobStepsStates[i].cursor === null" name="octicon-sync" class="tw-mr-2 circular-spin"/>
578578
<SvgIcon v-else :name="currentJobStepsStates[i].expanded ? 'octicon-chevron-down': 'octicon-chevron-right'" :class="['tw-mr-2', !isExpandable(jobStep.status) && 'tw-invisible']"/>
579579
<ActionRunStatus :status="jobStep.status" class="tw-mr-2"/>
580580

@@ -895,17 +895,6 @@ export default defineComponent({
895895
</style>
896896

897897
<style> /* eslint-disable-line vue-scoped-css/enforce-style-type */
898-
/* some elements are not managed by vue, so we need to use global style */
899-
.job-status-rotate {
900-
animation: job-status-rotate-keyframes 1s linear infinite;
901-
}
902-
903-
@keyframes job-status-rotate-keyframes {
904-
100% {
905-
transform: rotate(-360deg);
906-
}
907-
}
908-
909898
.job-step-section {
910899
margin: 10px;
911900
}

web_src/js/components/RepoCodeFrequency.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const options: ChartOptions<'line'> = {
150150
<div class="tw-flex ui segment main-graph">
151151
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
152152
<div v-if="isLoading">
153-
<SvgIcon name="octicon-sync" class="tw-mr-2 job-status-rotate"/>
153+
<SvgIcon name="octicon-sync" class="tw-mr-2 circular-spin"/>
154154
{{ locale.loadingInfo }}
155155
</div>
156156
<div v-else class="text red">

web_src/js/components/RepoContributors.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export default defineComponent({
375375
<div class="tw-flex ui segment main-graph">
376376
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
377377
<div v-if="isLoading">
378-
<SvgIcon name="octicon-sync" class="tw-mr-2 job-status-rotate"/>
378+
<SvgIcon name="octicon-sync" class="tw-mr-2 circular-spin"/>
379379
{{ locale.loadingInfo }}
380380
</div>
381381
<div v-else class="text red">

web_src/js/components/RepoRecentCommits.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const options: ChartOptions<'bar'> = {
128128
<div class="tw-flex ui segment main-graph">
129129
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
130130
<div v-if="isLoading">
131-
<SvgIcon name="octicon-sync" class="tw-mr-2 job-status-rotate"/>
131+
<SvgIcon name="octicon-sync" class="tw-mr-2 circular-spin"/>
132132
{{ locale.loadingInfo }}
133133
</div>
134134
<div v-else class="text red">

web_src/js/components/ViewFileTreeItem.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ const doGotoSubModule = () => {
9797
>
9898
<!-- directory -->
9999
<div class="item-toggle">
100-
<!-- FIXME: use a general and global class for this animation -->
101-
<SvgIcon v-if="isLoading" name="octicon-sync" class="job-status-rotate"/>
100+
<SvgIcon v-if="isLoading" name="octicon-sync" class="circular-spin"/>
102101
<SvgIcon v-else :name="collapsed ? 'octicon-chevron-right' : 'octicon-chevron-down'" @click.stop="doLoadChildren"/>
103102
</div>
104103
<div class="item-content">

0 commit comments

Comments
 (0)