Skip to content
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

chore: Make inactive posting buttons/fields for "posting disabled" courses #377

Merged
merged 12 commits into from
Apr 2, 2024

Conversation

eyatsenkoperpetio
Copy link
Contributor

@eyatsenkoperpetio eyatsenkoperpetio commented Mar 27, 2024

In some courses (with "Archived" status) posting in Discussions is disabled ("Posting in discussions is disabled by the course team"). On the Web and in edX app all make Post/Response/Comment options are hidden or inactive. We also need to disable (or hide) the "Create new post" button and the "Add a response" / "Add a comment" fields for these courses.

Make inactive posting buttons/fields for "posting disabled" courses #350
Increase tappable area size for sequence elements in Coursework #353

# Conflicts:
#	Discussion/Discussion/Presentation/Comments/Responses/ResponsesView.swift
#	Discussion/Discussion/Presentation/Comments/Thread/ThreadView.swift
#	Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift
#	Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsViewModel.swift
#	Discussion/Discussion/Presentation/Posts/PostsView.swift
@eyatsenkoperpetio eyatsenkoperpetio changed the title Make inactive posting buttons/fields for "posting disabled" courses chore: Make inactive posting buttons/fields for "posting disabled" courses Mar 27, 2024
@rnr
Copy link
Contributor

rnr commented Mar 28, 2024

I think we need to specifically disable these options: Post/Response/Comment, but not hide. @saeedbashir what do you think?

@saeedbashir
Copy link
Contributor

saeedbashir commented Mar 28, 2024

I think we need to specifically disable these options: Post/Response/Comment, but not hide. @saeedbashir what do you think?

@rnr I've discussed it with @moiz994 and he was okay with hiding the buttons. The only concern was about the banner(Posting in discussion is disabled by the course team) design, because we are not using this king of banner in the app. We might need approval from Sam about this, or maybe we need to highlight it so it will be on the design team radar and it will be redesigned post MVP.

Comment on lines 20 to 21
let start = Date(iso8601: blackout.start)
let end = Date(iso8601: blackout.end)
Copy link
Contributor

@saeedbashir saeedbashir Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an extra space after :

@@ -249,7 +253,8 @@ struct ResponsesView_Previews: PreviewProvider {
commentID: "",
viewModel: viewModel,
router: router,
parentComment: post
parentComment: post,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra white space st the end

@@ -259,7 +264,8 @@ struct ResponsesView_Previews: PreviewProvider {
commentID: "",
viewModel: viewModel,
router: router,
parentComment: post
parentComment: post,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private let threadStateSubject: CurrentValueSubject<ThreadPostState?, Never>


public var isBlackedOut: Bool = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have it in viewModel? isn't it good to declare a variable in the view and use it directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think better use only state variable in view, others variable in view model, and view model say how view should look

func generateTopics(topics: Topics?) -> [DiscussionTopic] {
var result = [
DiscussionTopic(
name: DiscussionLocalization.Topics.allPosts,
action: {
self.analytics.discussionAllPostsClicked(courseId: self.courseID,
courseName: self.title)
self.analytics.discussionAllPostsClicked(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are here how about using weak self in block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need weak self for button action from view

saeedbashir

This comment was marked as resolved.

Copy link
Contributor

@saeedbashir saeedbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@volodymyr-chekyrta volodymyr-chekyrta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rnr rnr merged commit 3e632e8 into openedx:develop Apr 2, 2024
3 checks passed
@rnr rnr deleted the fix/discussion_blacked_out branch April 2, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants