Plausible r2023.10.03-200: Use Phoenix LiveView for the upgrade page (#3382) Release
요약
- FF 뒤에 라이브뷰 페이지 liveview 생성
- plans_v4.json 파일 생성
- 업그레이드 페이지 UI 템플릿과 기본 기능 추가
- 구독 플랜에 따라 다른 콘텐츠 추가
- 페이지뷰 슬라이더
- 매월/매년 전환
- 테스트 수정
- 2개의 별도 함수로 분리
- 변수 이름 변경
- 볼륨 슬라이더 구현 + 기본 간격/볼륨값에서 읽어오기
- choose-plan.ex 정리
- 테스트에서 사용하지 않는 변수 제거
- monthly_cost와 yearly_cost의 기본값은 nil로 설정
모든 플랜의 실제 가격은 Paddle에서 저장됩니다. JSON 파일에서 중복된 정보는 유지할 필요가 없습니다.
- PaddleApi에 fetch_prices/1 추가
- v4 비증가 ID를 성장과 구분
- plan으로부터 실제 가격 정보 렌더링
...그리고 페이지뷰 슬라이더 또는 간격이 변경될 때 성장 및 비증가 플랜 상자의 가격이 동적으로 변경됩니다.
- 현재 구독 플랜 상자 강조
- 비증가 단계 구독에 대한 테스트 설명 블록 추가
- 특정 LV 페이지에서만 라이브 소켓 연결
- input 슬라이더를 양식 안에만 감싸기
- 가독성 개선
- v4 team_member_limits 추가 (마스터와 재베이스 후)
- user_settings에서 monthly_quota_box 함수 추출
비증가상 첫 번째 업그레이드 페이지로 이 부분은 다릅니다.
- 구독 상태 문서화
- _notice.html.eex를 .heex로 변경
- 구독 상태 알림 컴포넌트 추출
- 업그레이드 페이지에 결제 실패 알림 추가
- 테스트를 위한 class_of_element/2 편의 함수 생성
- cancel_subscription mix task 추가
- 결제 버튼 구현
- mix format
- plans.ex를 통해 사용 가능한 모든 플랜의 가격 가져오기
- 사용량을 가져오기 위해 더 적합한 함수 사용
- 마운트 시 두 번의 데이터베이스 조회 방지
- 변수 이름 변경
- product_id 및 구독별 계획 가져오기를 위한 별도 함수 생성
- 구독 상태 문서를 컨텍스트 모듈로 분리
- 취소된 구독 고려
- 구독 플랜이 없을 경우 사용량에 따라 기본 볼륨 설정
- 슬라이더에 엔터프라이즈 수준의 볼륨 옵션 추가
- 다크모드 최적화
- UI 개선
- 매년 결제에 대해 2개월 무료 안내 표시
- 부가가치세 제외 안내
- 사용자 설정에서 영업구독에 대한 참고 사항
- 첫 번째 렌더링에서 페이지가 빨리 나타나고 화면에 플랜 맞추기
- 모바일 최적화 및 배경 컨테이너 제거
- 기본 가격 태그를 'N/A'로 변경
- 테스트 수정
- Paddle.js 통합을 직접적으로 자바스크립트로 변경
- 변수 이름 변경
- v1 및 v2 플랜을 사용하는 사용자가 20M 및 50M 단계를 구독할 수 있게 함
- 두 개월 무료 라벨에 대한 테스트 추가
- free_10k 구독과 호환되도록 수정
- 테스트 개선 및 포맷팅
- 다른 업그레이드 링크를 사용자 설정에서 활성화된 경우 변경
- dialyzer
- 철자 수정
- free_10k 사용자를 위한 테스트 추가
- credo를 통해 경고문 제거
- mix format
- credo - moduledoc 추가
- credo - 다른 moduledoc 추가
- api 수준에서 sentry 호출 처리
- LiveView에 대한 정규 구독 플랜 가져오기를 리팩터링
- 리뷰 후 코드 스타일 수정
- 사용하지 않는 alias 제거
- credo - Subscriptions에 false로 moduledoc 추가
- Repo 업데이트 실패 시 취소 구독 작업에서 충돌
- 가독성 개선 (리뷰 제안)
- 'external_resource' 모듈 속성에 대한 주석 추가
공동 저자: Vinicius Brasil vini@hey.com
원문 내용
add a new upgrade page liveview behind a FF
Create plans_v4.json file
Add the upgrade page UI template and some basic functionalities
different content based on subscription plan existing or not
pageview slider
monthly/yearly switch
fix tests
split into 2 separate functions
rename variables
implement volume slider + read default interval/volume from plan
organize choose-plan.ex better
remove unused vars from tests
make monthly_cost and yearly_cost nil by default
The actual prices for all plans are stored in Paddle. We don't need to
keep the duplicates in the JSON files.
add fetch_prices/1 to PaddleApi
make v4 business ID's differ from growth ones
render actual price information from plans
...and make the prices in both growth and business plan boxes change
dynamically when the pageview slider or interval is changed.
highlight current subscription plan box
add test describe block for business tier subscription
connect to live socket only on the specific LV page using focus.html
only wrap the input slider inside the form
little readability improvement
add v4 team_member_limits (after rebase with master)
extract monthly_quota_box function in user_settings
When the business_tier FF is enabled, this section is different and
links to the new upgrade page.
document subscription statuses
change _notice.html.eex to .heex
extract subscription status notice components
add failed payment notices to upgrade page
create class_of_element/2 convenience function for testing
add cancel_subscription mix task
implement checkout buttons
mix format
get all available plans with prices through plans.ex
use more suitable function for fetching usage
avoid double db lookups on mount
rename variable
separate functions for getting plan by product_id vs subscription
separate subscription status docs into context module
consider cancelled subscriptions
default volume by usage if no subscription plan
add enterprise-level volume option to slider
optimize for darkmode
UI improvements
display 2 months free notice for yearly billing
VAT excluded notice
note about having a business subscription in user settings
make the page pop and fit plans on screen on first render
optimize for mobile and remove background containers
change default price tag to simply 'N/A'
fix tests
Change Paddle.js integration to use JavaScript directly
rename many variables
allow users on v1 and v2 plan subscribe to 20M and 50M tiers
add a test for two months free label
make it work with a free_10k subscription
small test improvement and formatting
change other upgrade link in user settings if FF enabled
dialyzer
fix typo
add test for free_10k user
silence credo
mix format
credo - add moduledoc
credo - another moduledoc
handle calls to sentry on the api level
refactor getting regular subscription plan for LiveView
post review code style tweaks
remove unused aliases
credo - add @moduledoc false to Subscriptions
crash in cancel_subscription task when Repo update fails
readability improvements (review suggestions)
add comment about 'external_resource' module attr
Co-authored-by: Vinicius Brasil vini@hey.com
링크 : https://github.com/plausible/analytics/releases/tag/r2023.10.03-200