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
# frozen_string_literal: true | |
module AutoTranslate | |
module Callbacks | |
class AfterCommit | |
attr_reader :original_attribute_name, :translated_attribute_name | |
def initialize(original_attribute_name, translated_attribute_name) | |
@original_attribute_name = original_attribute_name | |
@translated_attribute_name = translated_attribute_name |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => { | |
if (event.type !== 'SEARCH_REQUEST_SUCCESS') { | |
throw new Error( | |
`Unexpected event type for handleRequestSuccess: "${event.type}"` | |
); | |
} | |
return event.results; | |
}, |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => { | |
if (event.type !== 'SEARCH_REQUEST_SUCCESS') { | |
throw new Error( | |
`Unexpected event type for handleRequestSuccess: "${event.type}"` | |
); | |
} | |
return event.results; | |
}, | |
pagination: (_ctx, event) => { |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results, | |
pagination: (_ctx, event) => event.pagination | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
pagination: null, |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results, | |
pagination: (_ctx, event) => event.pagination | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { |
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
Closed* | |
report anomaly -> Opened | |
Opened | |
close -> Closed | |
Ilmoita muu tilanne* | |
Initial* | |
Asiakkaalle on vastattu toisessa keskustelussa -> Button | |
Tilaisuus on jo raportoitu toisessa keskustelussa -> Button |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const handleHistoryPopState = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchFSM = Machine({ | |
id: 'search', |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
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
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
NewerOlder