Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions assets/css/_card-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@
gap: 0.5rem;
}

.spinning {
animation: spin 1s linear infinite;
}

@keyframes spin {
0% {
transform: rotate(0deg);
}
60% {
transform: rotate(360deg);
}
100% {
transform: rotate(360deg);
}
}

a {
display: inline-flex;
cursor: pointer;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/components/respondents/RespondentIndex.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ class RespondentIndex extends Component<Props, State> {
const createdAtLabel = fileExists ? <TimeAgo date={(fileStatus?.created_at || 0) * 1000} formatter={this.timeFormatter} /> : null

const fileCreating = !!fileStatus?.creating
const generateButtonClass = fileCreating ? "grey-text" : "black-text"
const generateButtonClass = fileCreating ? "grey-text spinning" : "black-text"
const generateButtonOnClick = fileCreating ? null : item.onGenerate
const generatingFileLabel = fileCreating ? "Generating..." : ""

Expand Down
15 changes: 15 additions & 0 deletions assets/js/reducers/respondentsFiles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import * as actions from "../actions/survey"

const markAsCreating = (files, creatingFile) => ({
...files,
[creatingFile]: {
...files[creatingFile],
file_type: creatingFile,
creating: true,
created_at: null,
}
})

export default (state = {}, action) => {
switch (action.type) {
case actions.GENERATING_FILE:
return {
...state,
files: markAsCreating(state.files || {}, action.file),
}
case actions.FETCHING_FILES_STATUS:
if (action.surveyId != state.surveyId) {
return {
Expand Down