-
Notifications
You must be signed in to change notification settings - Fork 31
Bugfix/FOUR-5159: Summary screen is not displayed in sub process #1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9787560
Get next task when you have interstitial. Show parent summary screen
agustinbusso c84fe5e
Removed comment
agustinbusso 60bb5b5
Emit completed when no tasks
agustinbusso c7e06be
Redirect when no tasks to summary
agustinbusso c239bf4
Avoiding redirect if process not completed yet
agustinbusso 7751eaf
Go to next task in parent if exist
agustinbusso 1594a27
Emit instead redirect with force redirect in true
agustinbusso d9243c5
Added test cases
agustinbusso 5a5c7c7
Removed unnecessary socket mocks. Removed skips. Changed url port to …
agustinbusso ac1ac59
Merge branch 'develop' of https://github.com/ProcessMaker/screen-buil…
agustinbusso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,160 @@ | ||
| <template> | ||
| <b-row> | ||
| <b-col cols="8"> | ||
| <b-tabs> | ||
| <b-tab active title="Form"> | ||
| <task | ||
| :initial-task-id="task.id" | ||
| v-model="data" | ||
| @submit="submit" | ||
| :initialRequestId="1" | ||
| :userId="1" | ||
| @completed="completed" | ||
| @closed="closed" | ||
| @redirect="redirectToTask" | ||
| /> | ||
| </b-tab> | ||
| <b-tab title="Data"> | ||
| <monaco-editor | ||
| class="data-editor" | ||
| language="json" | ||
| :value="JSON.stringify(data, null, 4)" | ||
| :options="{automaticLayout: true, minimap: {enabled: false}}" | ||
| /> | ||
| <div class="text-right"> | ||
| <b-button variant="secondary">{{ __('Save') }}</b-button> | ||
| </div> | ||
| </b-tab> | ||
| </b-tabs> | ||
| </b-col> | ||
| <b-col cols="4"> | ||
| <b-card | ||
| no-body | ||
| header="Open" | ||
| header-bg-variant="success" | ||
| header-text-variant="white" | ||
| > | ||
| <b-list-group flush> | ||
| <b-list-group-item> | ||
| <i class="far fa-calendar-alt"/> | ||
| <small> | ||
| {{ __('Due') }} | ||
| {{ moment(task.due_at).fromNow() }} | ||
| </small> | ||
| <div>{{ formatDate(task.due_at) }}</div> | ||
| </b-list-group-item> | ||
| <b-list-group-item> | ||
| <h5>{{ __('Assigned To') }}</h5> | ||
| <b-avatar/> | ||
| {{ task.user.fullname }} | ||
| </b-list-group-item> | ||
| <b-list-group-item> | ||
| <i class="far fa-calendar-alt"/> | ||
| <small> | ||
| {{ __('Assigned') }} | ||
| {{ moment(task.created_at).fromNow() }} | ||
| </small> | ||
| <div>{{ formatDate(task.created_at) }}</div> | ||
| </b-list-group-item> | ||
| <b-list-group-item> | ||
| <h5>{{ __('Request') }}</h5> | ||
| <div> | ||
| <a :href="`/requests/${task.process_request.id}`"> | ||
| #{{ task.process_request.id }} {{ task.process.name }} | ||
| </a> | ||
| </div> | ||
| </b-list-group-item> | ||
| <b-list-group-item> | ||
| <h5>{{ __('Requested by') }}</h5> | ||
| <b-avatar/> | ||
| {{ task.process_request.user.fullname }} | ||
| </b-list-group-item> | ||
| </b-list-group> | ||
| </b-card> | ||
| </b-col> | ||
| </b-row> | ||
| </template> | ||
|
|
||
| <script> | ||
| import moment from 'moment'; | ||
| import MonacoEditor from 'vue-monaco'; | ||
| import Screens from '../e2e/fixtures/single_line_input.json'; | ||
|
|
||
| export default { | ||
| components: {MonacoEditor}, | ||
| data() { | ||
| return { | ||
| data: {}, | ||
| task: { | ||
| id: 1, | ||
| advanceStatus: 'open', | ||
| component: 'task-screen', | ||
| created_at: moment().toISOString(), | ||
| completed_at: moment().toISOString(), | ||
| due_at: moment().add(1, 'day').toISOString(), | ||
| user: { | ||
| avatar: '', | ||
| fullname: 'Assigned User', | ||
| }, | ||
| screen: Screens.screens[0], | ||
| process_request: { | ||
| id: 1, | ||
| status: 'ACTIVE', | ||
| user: { | ||
| avatar: '', | ||
| fullname: 'Requester User', | ||
| }, | ||
| }, | ||
| process: { | ||
| id: 1, | ||
| name: 'Process Name', | ||
| }, | ||
| request_data: {}, | ||
| }, | ||
| }; | ||
| }, | ||
| methods: { | ||
| completed(processRequestId) { | ||
| window.location.href = '/requests/' + processRequestId; | ||
| }, | ||
| closed() { | ||
| window.location.href = 'tasks'; | ||
| }, | ||
| redirectToTask(task) { | ||
| window.location.href = 'tasks/' + task + '/edit'; | ||
| }, | ||
| moment(...args) { | ||
| return moment(...args); | ||
| }, | ||
| __(text) { | ||
| return text; | ||
| }, | ||
| formatDate(date) { | ||
| return moment(date).format('YYYY-MM-DD HH:mm'); | ||
| }, | ||
| submit(task) { | ||
| if (this.disabled) { | ||
| return; | ||
| } | ||
| this.disabled = true; | ||
| const taskId = task.id; | ||
| const formData = task.request_data; | ||
| window.ProcessMaker.apiClient | ||
| .put('/tasks/' + taskId, {status:'COMPLETED', data: formData}) | ||
| .then(() => { | ||
| alert('Task Completed Successfully'); | ||
| }) | ||
| .finally(() => { | ||
| this.disabled = false; | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .data-editor { | ||
| border: 1px solid gray; | ||
| min-height: 400px; | ||
| } | ||
| </style> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the completed event with the requestId always will be sent and I don't know if it can have side effects. It seems that it will be better to put this line inside an "else" block of the above "if" condition, so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a parentRequest and task allows interstitial will return and not emit