From b4efa50b9654dfb8e108717c441f646b7e976e0a Mon Sep 17 00:00:00 2001 From: Stephenie Harris Date: Thu, 12 May 2022 15:52:31 -0600 Subject: [PATCH 1/2] Pass prompt to post editor. --- .../Cards/Prompts/DashboardPromptsCardCell.swift | 5 +++-- .../Floating Create Button/CreateButtonCoordinator.swift | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift index 14ab21e6d449..985bea16420c 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/DashboardPromptsCardCell.swift @@ -390,11 +390,12 @@ private extension DashboardPromptsCardCell { // MARK: Button actions @objc func answerButtonTapped() { - guard let blog = blog else { + guard let blog = blog, + let prompt = prompt else { return } - let editor = EditPostViewController(blog: blog, prompt: .examplePrompt) + let editor = EditPostViewController(blog: blog, prompt: prompt) editor.modalPresentationStyle = .fullScreen editor.entryPoint = .dashboard presenterViewController?.present(editor, animated: true) diff --git a/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift b/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift index 885a800d9e7e..f0e4f9fa2b28 100644 --- a/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift +++ b/WordPress/Classes/ViewRelated/System/Floating Create Button/CreateButtonCoordinator.swift @@ -333,8 +333,7 @@ private extension CreateButtonCoordinator { promptsHeaderView.answerPromptHandler = { [weak self] in self?.viewController?.dismiss(animated: true) { - // TODO: pass prompt to post editor - let editor = EditPostViewController(blog: blog, prompt: .examplePrompt) + let editor = EditPostViewController(blog: blog, prompt: prompt) editor.modalPresentationStyle = .fullScreen editor.entryPoint = .bloggingPromptsActionSheetHeader self?.viewController?.present(editor, animated: true) From faaa4ab54fffda79dce452fb53d98a1fdb59278c Mon Sep 17 00:00:00 2001 From: Stephenie Harris Date: Thu, 12 May 2022 15:52:51 -0600 Subject: [PATCH 2/2] Remove example prompt. Thank you for your service! --- .../Classes/Services/BloggingPromptsService.swift | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/WordPress/Classes/Services/BloggingPromptsService.swift b/WordPress/Classes/Services/BloggingPromptsService.swift index cb2c6de58572..6ce8e637401e 100644 --- a/WordPress/Classes/Services/BloggingPromptsService.swift +++ b/WordPress/Classes/Services/BloggingPromptsService.swift @@ -86,18 +86,6 @@ struct BloggingPrompt { let answerCount: Int let displayAvatarURLs: [URL] let attribution: String - - static let examplePrompt = BloggingPrompt( - promptID: 239, - text: "Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.", - title: "Prompt number 1", - content: "\n

Was there a toy or thing you always wanted as a child, during the holidays or on your birthday, but never received? Tell us about it.

(courtesy of plinky.com)
\n", - date: Date(), - answered: false, - answerCount: 5, - displayAvatarURLs: [], - attribution: "dayone" - ) } extension BloggingPrompt {