feat: Sets up portal public views with rails ERB and tailwind (#5309)

* feat: Sets up portal public views with rails ERB and tailwind

* linter fixes

* Remove duplicate style file

* Shows articles and categories

* Specify layout for articles page

* Updates public portal styles

* Fixes blog content styles

* Portal style updates for article page

* Review fixes

* Adds breadcrumbs

* fix: rspec

* fix: public portal spec

* Code climate fixes

* Adds test cases for missing files

* Show only published articles

* Updates help center routes

* Review fixes

* Render markdown content for aticle body

* Update app/views/public/api/v1/portals/articles/index.html.erb

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

Co-authored-by: Sojan <sojan@pepalo.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
Co-authored-by: tejaswini chile <tejaswini@chatwoot.com>
This commit is contained in:
Nithin David Thomas
2022-09-12 23:36:24 +05:30
committed by GitHub
parent a680b08251
commit 1ea289e8b7
27 changed files with 477 additions and 21 deletions

View File

@@ -20,10 +20,6 @@ RSpec.describe 'Public Articles API', type: :request do
get "/hc/#{portal.slug}/#{category.locale}/#{category.slug}/articles"
expect(response).to have_http_status(:success)
json_response = JSON.parse(response.body)
expect(json_response['payload'].length).to eql portal.articles.count
expect(json_response['meta']['articles_count']).to be json_response['payload'].size
end
it 'get all articles with searched text query' do
@@ -39,9 +35,6 @@ RSpec.describe 'Public Articles API', type: :request do
headers: agent.create_new_auth_token,
params: { query: 'funny' }
expect(response).to have_http_status(:success)
json_response = JSON.parse(response.body)
expect(json_response['payload'].count).to be 1
expect(json_response['meta']['articles_count']).to be json_response['payload'].size
end
end
@@ -50,9 +43,6 @@ RSpec.describe 'Public Articles API', type: :request do
get "/hc/#{portal.slug}/#{category.locale}/#{category.slug}/#{article.id}"
expect(response).to have_http_status(:success)
json_response = JSON.parse(response.body)
expect(json_response['title']).to eql article.title
end
end
end

View File

@@ -14,9 +14,6 @@ RSpec.describe 'Public Portals API', type: :request do
get "/hc/#{portal.slug}/en"
expect(response).to have_http_status(:success)
json_response = JSON.parse(response.body)
expect(json_response['slug']).to eql 'test-portal'
expect(json_response['meta']['articles_count']).to be 0
end
it 'Throws unauthorised error for unknown domain' do