Skip to content

Commit

Permalink
Merge pull request #763 from mathematicalthinking/feat/submission-men…
Browse files Browse the repository at this point in the history
…tor-thread-2

Feat/submission mentor thread 2
  • Loading branch information
ywakili18 committed Feb 28, 2024
2 parents da47035 + da97ef3 commit 04eec32
Show file tree
Hide file tree
Showing 21 changed files with 763 additions and 1,226 deletions.
15 changes: 4 additions & 11 deletions app/components/response-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import CurrentUserMixin from '../mixins/current_user_mixin';
export default Component.extend(CurrentUserMixin, ErrorHandlingMixin, {
tagName: '',
currentUser: service('current-user'),
// elementId: 'response-container',
wsPermissions: service('workspace-permissions'),
store: service(),
submission: null,
subResponses: [],
primaryResponseType: alias('response.responseType'),
Expand Down Expand Up @@ -133,16 +133,9 @@ export default Component.extend(CurrentUserMixin, ErrorHandlingMixin, {
.sortBy('createDate')
.reverse();
}),
studentDescriptor: computed(
'isOwnSubmission',
'submission.student',
function () {
if (this.isOwnSubmission) {
return 'your';
}
return `${this.get('submission.student')}'s`;
}
),
studentName: computed('isOwnSubmission', 'submission.student', function () {
return `${this.get('submission.student')}`;
}),

isOwnSubmission: computed(
'submission.creator.studentId',
Expand Down
1 change: 0 additions & 1 deletion app/components/response-mentor-reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { inject as service } from '@ember/service';
import ErrorHandlingMixin from '../mixins/error_handling_mixin';

export default Component.extend(ErrorHandlingMixin, {
elementId: 'response-mentor-reply',
alert: service('sweet-alert'),
utils: service('utility-methods'),
loading: service('loading-display'),
Expand Down
68 changes: 68 additions & 0 deletions app/components/response-mentor-thread.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{{! /**
* #
* @description
Response mentor thread is a subcomponent of the response-container.hbs.
Purpose is to display the student submission and the mentor's response to the submission.
It's corresponding sass file is response-thread.scss
* @author Yousof Wakili
* @since 3.6.2
*/ }}

<div class='response-thread-container'>
<div class='response-submission-container thread-child'>
<ResponseSubmissionView
@response={{@response}}
@submission={{@submission}}
@workspace={{@workspace}}
@wsResponses={{@cleanWorkspaceResponses}}
@studentSubmissions={{@submissions}}
@onSubChange={{@onSubChange}}
@sendRevisionNotices={{@sendRevisionNotices}}
@isParentWorkspace={{@isParentWorkspace}}
/>
</div>
<div
class={{if
this.show
'mentor-thread-container'
'mentor-thread-container closed'
}}
>
<div class='mentor-header-thread'>
{{#if this.showButton}}
<button {{on 'click' this.toggleShowResponses}} class='primary-button'>
{{this.showResponsesText}}
</button>
{{/if}}
</div>
{{#if this.showResponses}}
<ResponseMentorReply
@isCreating={{@isCreating}}
@response={{@response}}
@submission={{@submission}}
@workspace={{@workspace}}
@mentorReplies={{@mentorReplies}}
@responseToApprove={{@responseToApprove}}
@displayResponse={{@displayResponse}}
@canDirectSend={{@canDirectSend}}
@canApprove={{@canApprove}}
@isOwnMentorReply={{@isOwnMentorReply}}
@onSaveSuccess={{@onSaveSuccess}}
@onMentorReplySwitch={{@onMentorReplySwitch}}
@toResponses={{@toResponses}}
@submissionResponses={{@submissionResponses}}
@canSend={{@canSend}}
@isMentorRecipient={{@isMentorRecipient}}
@isOwnSubmission={{@isOwnSubmission}}
@toNewResponse={{@toNewResponse}}
@priorMentorRevision={{@priorMentorRevision}}
@iconFillOptions={{@iconFillOptions}}
@toSubmission={{@toSubmission}}
@handleResponseThread={{@handleResponseThread}}
@isParentWorkspace={{@isParentWorkspace}}
/>
{{/if}}
</div>

</div>
24 changes: 24 additions & 0 deletions app/components/response-mentor-thread.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';

export default class ResponseMentorThreadComponent extends Component {
@tracked show = false;

get showResponsesText() {
return this.showResponses ? 'Hide responses' : 'Show responses';
}

get showResponses() {
return this.show || this.args.isCreating;
}

get showButton() {
return !this.args.isCreating;
}

@action
toggleShowResponses() {
this.show = !this.show;
}
}
4 changes: 1 addition & 3 deletions app/components/response-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import ErrorHandlingMixin from '../mixins/error_handling_mixin';

export default Component.extend(ErrorHandlingMixin, {
currentUser: service('current-user'),
elementId: 'response-new',

utils: service('utility-methods'),
loading: service('loading-display'),

Expand Down Expand Up @@ -221,7 +219,7 @@ export default Component.extend(ErrorHandlingMixin, {
let doWrapStringInBlockQuote = true;

if (opts && opts.hasOwnProperty('type')) {
doWrapStringInBlockQuote = false;
doWrapStringIn = false;
if (opts.usePrefix) {
switch (opts.type) {
case 'notice':
Expand Down
2 changes: 1 addition & 1 deletion app/components/response-submission-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default Component.extend({
store: service(),
// elementId: 'response-submission-view',
isShortExpanded: true,
isLongExpanded: true,
isLongExpanded: false,
isImageExpanded: false,
isUploadExpanded: false,
isRevising: false,
Expand Down
6 changes: 1 addition & 5 deletions app/components/workspace/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';

export default class WorkspaceSummaryComponent extends Component {
isLogged() {
return 'I am logged';
}
}
export default class WorkspaceSummaryComponent extends Component {}
2 changes: 1 addition & 1 deletion app/styles/_answers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
width: 100%;
}
h2 {
font-family: 'Quicksand', sans-serif;
font-family: 'Roboto", sans-serif';
}
.brief-summary,
.explanation,
Expand Down
5 changes: 1 addition & 4 deletions app/styles/_home.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
@import 'variables';
@import 'mixins';
@import 'responsive-font-size';
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');
h1 {
color: $accent-color;
}
* {
font-family: 'Quicksand', sans-serif;
}

.index {
display: flex;
flex-direction: column;
Expand Down
Loading

0 comments on commit 04eec32

Please sign in to comment.