Skip to content

Commit

Permalink
Merge pull request #1185 from koedame/release/v2.1.1
Browse files Browse the repository at this point in the history
Release/v2.1.1
  • Loading branch information
unchidev authored Jul 24, 2022
2 parents 02b9f31 + 100a42b commit 36cb759
Show file tree
Hide file tree
Showing 11 changed files with 955 additions and 703 deletions.
19 changes: 19 additions & 0 deletions CHANGELOGS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# CHANGELOGS

## v2.1.1

### 変更

- プロフィール画像設定機能追加
- ツイッター連携設定機能

### 依存パッケージ

- @babel/core from 7.18.6 to 7.18.9
- @babel/preset-env from 7.18.6 to 7.18.9
- @swc/core from 1.2.215 to 1.2.218
- @swc/jest from 0.2.21 to 0.2.22
- @types/luxon from 2.3.2 to 3.0.0
- @types/node from 18.0.5 to 18.0.6
- jest and @types/jest
- terser from 5.14.0 to 5.14.2
- ts-jest from 28.0.5 to 28.0.7

## v2.1.0

### 変更
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- 📌 お知らせ表示
- 🔐 パスワード保存機能
- 🔍 メンバー検索機能
- 📝 プロフィール編集機能

## 対応ブラウザ

Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "syncroom-plus",
"version": "2.1.0",
"version": "2.1.1",
"description": "syncroom-plus",
"license": "MIT",
"private": true,
Expand Down Expand Up @@ -29,24 +29,24 @@
"twemoji": "^14.0.2"
},
"devDependencies": {
"@babel/core": "^7.18.6",
"@babel/core": "^7.18.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.18.6",
"@babel/preset-env": "^7.18.9",
"@babel/preset-react": "^7.18.6",
"@hot-loader/react-dom": "^17.0.2",
"@jest/expect-utils": "^28.1.3",
"@jest/globals": "^28.1.3",
"@swc/core": "^1.2.215",
"@swc/jest": "^0.2.21",
"@swc/core": "^1.2.218",
"@swc/jest": "^0.2.22",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/line-clamp": "^0.4.0",
"@tailwindcss/typography": "^0.5.4",
"@testing-library/react-hooks": "^8.0.1",
"@types/chrome": "^0.0.193",
"@types/jest": "^28.1.4",
"@types/luxon": "^2.3.2",
"@types/node": "^18.0.5",
"@types/jest": "^28.1.6",
"@types/luxon": "^3.0.0",
"@types/node": "^18.0.6",
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@types/recoil": "^0.0.9",
Expand All @@ -64,7 +64,7 @@
"fs-extra": "^10.0.0",
"html-loader": "^4.1.0",
"html-webpack-plugin": "^5.5.0",
"jest": "^28.1.2",
"jest": "^28.1.3",
"jest-diff": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"mockzilla": "^0.13.0",
Expand All @@ -76,7 +76,7 @@
"style-loader": "^3.3.1",
"tailwindcss": "^3.1.6",
"terser-webpack-plugin": "^5.2.4",
"ts-jest": "^28.0.5",
"ts-jest": "^28.0.7",
"ts-loader": "^9.3.1",
"ts-node": "^10.9.1",
"typescript": "^4.7.4",
Expand Down
228 changes: 197 additions & 31 deletions src/components/MyProfile/index.tsx

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions src/hooks/useSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const useSession = () => {
headers.set('x-api-key', 'O98sxYkdgh9ZtVmv5mT5S2zbuipzhSa81MKExbCN');

try {
const json: { token: string; refreshToken: string } = await (
await (
await srClient('https://webapi.syncroom.appservice.yamaha.com/comm/token/refresh', {
method: 'post',
headers,
Expand All @@ -104,15 +104,20 @@ export const useSession = () => {
refreshToken: localStorage.getItem('refreshToken'),
}),
})
).json();

// 文字列の "undefined" が返って来たことがあるので、念の為チェックをしておく。
if (json.token && json.token !== 'undefined') {
localStorage.setItem('token', json.token);
}
if (json.refreshToken && json.refreshToken !== 'undefined') {
localStorage.setItem('refreshToken', json.refreshToken);
}
)
.json()
.then((json: { token: string; refreshToken: string }) => {
// 文字列の "undefined" が返って来たことがあるので、念の為チェックをしておく。
if (json.token && json.token !== 'undefined') {
localStorage.setItem('token', json.token);
}
if (json.refreshToken && json.refreshToken !== 'undefined') {
localStorage.setItem('refreshToken', json.refreshToken);
}
})
.catch((error) => {
return reject(error);
});

return resolve(true);
} catch (error) {
Expand Down
26 changes: 19 additions & 7 deletions src/lib/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
"account_page": "マイページ",
"my_profile": "プロフィール確認",
"edit_my_profile": "プロフィール編集",
"use_twitter_icon": "Twitterのアイコンを使用する",
"use_twitter_name": "Twitterの名前を使用する",
"tweet_settings": "ツイート設定",
"tweet_room_create": "ルーム作成時に自動的にツイートする",
"link_to_twitter": "ツイッター連携",
"unlink_to_twitter": "ツイッター連携解除",
"icon": "アイコン",
"change": "変更",
"nickname": "表示名",
"my_profile_description": "自己紹介",
"favorite_genres": "好きなジャンル",
Expand All @@ -30,7 +35,7 @@
"public": "公開",
"private": "非公開",
"profile_private_notes": "ニックネームとアイコンは非公開設定でも表示されます。",
"social_links": "ソーシャルリンク",
"social_links": "ソーシャルリンク",
"twitter_placeholder": "@で始まるユーザー名を入力してください。",
"instagram_placeholder": "@で始まるユーザー名を入力してください。",
"facebook_placeholder": "URLを入力してください。",
Expand Down Expand Up @@ -125,7 +130,6 @@
"World": "World"
},
"products": {
"SYNCROOM Plus": "SYNCROOM Plus",
"ピアノ・電子ピアノ": "ピアノ・電子ピアノ",
"エレクトーン・キーボード": "エレクトーン・キーボード",
"シンセサイザー": "シンセサイザー",
Expand Down Expand Up @@ -163,8 +167,13 @@
"account_page": "Account Page",
"my_profile": "My Profile",
"edit_my_profile": "Edit My Profile",
"use_twitter_icon": "Use Twitter icon",
"use_twitter_name": "Use Twitter name",
"tweet_settings": "Tweet settings",
"tweet_room_create": "Tweet automatically when creating a room",
"link_to_twitter": "Link to Twitter",
"unlink_to_twitter": "Unlink to Twitter",
"icon": "Icon",
"change": "Change",
"nickname": "Display name",
"my_profile_description": "About Me",
"favorite_genres": "Favorite genre",
Expand Down Expand Up @@ -268,7 +277,6 @@
"World": "World"
},
"products": {
"SYNCROOM Plus": "SYNCROOM Plus",
"ピアノ・電子ピアノ": "Piano / Electronic Piano",
"エレクトーン・キーボード": "Electone / Keyboard",
"シンセサイザー": "Synthesizer",
Expand Down Expand Up @@ -306,8 +314,13 @@
"account_page": "계정 페이지",
"my_profile": "내 프로필",
"edit_my_profile": "내 프로필 수정",
"use_twitter_icon": "트위터 아이콘 사용",
"use_twitter_name": "트위터 이름 사용",
"tweet_settings": "트윗 설정",
"tweet_room_create": "방을 만들 때 자동으로 트윗하기",
"link_to_twitter": "트위터 링크",
"unlink_to_twitter": "트위터 연결 해제",
"icon": "Icon",
"change": "변화",
"nickname": "이름 표시하기",
"my_profile_description": "자기 소개",
"favorite_genres": "좋아하는 장르",
Expand Down Expand Up @@ -411,7 +424,6 @@
"World": "World"
},
"products": {
"SYNCROOM Plus": "SYNCROOM Plus",
"ピアノ・電子ピアノ": "Piano / Electronic Piano",
"エレクトーン・キーボード": "Electone / Keyboard",
"シンセサイザー": "Synthesizer",
Expand Down
1 change: 0 additions & 1 deletion src/repositories/favoriteProductRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const FavoriteProductRepository = {
// 興味のある製品一覧
index: (): SYNCROOM.FavoriteProductType[] => {
return [
'SYNCROOM Plus',
'ピアノ・電子ピアノ',
'エレクトーン・キーボード',
'シンセサイザー',
Expand Down
80 changes: 80 additions & 0 deletions src/repositories/presetIconRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { SYNCROOM } from '../types/syncroom';

// プリセットアイコン
export const PresetIconRepository = {
// プリセット一覧
index(): SYNCROOM.IconInfoType[] {
return [
{
preset: '0',
type: 'preset',
url: '',
},
{
preset: '1',
type: 'preset',
url: '',
},
{
preset: '2',
type: 'preset',
url: '',
},
{
preset: '3',
type: 'preset',
url: '',
},
{
preset: '4',
type: 'preset',
url: '',
},
{
preset: '5',
type: 'preset',
url: '',
},
{
preset: '6',
type: 'preset',
url: '',
},
{
preset: '7',
type: 'preset',
url: '',
},
{
preset: '8',
type: 'preset',
url: '',
},
{
preset: '9',
type: 'preset',
url: '',
},
{
preset: '10',
type: 'preset',
url: '',
},
{
preset: '11',
type: 'preset',
url: '',
},
{
preset: '12',
type: 'preset',
url: '',
},
{
preset: '13',
type: 'preset',
url: '',
},
];
},
};
42 changes: 42 additions & 0 deletions src/repositories/sessionRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,48 @@ export const SessionRepository = {
return res.json();
},

// ツイッター連携設定更新
async updateTwitterConfig(params: {
profileLinked: {
type: 'twitter';
linkNickname: boolean;
linkImage: boolean;
};
autoTweet: {
roomCreated: boolean;
};
}): Promise<{ status: 'ok' }> {
const res = await srClientWithToken('https://webapi.syncroom.appservice.yamaha.com/comm/users/me/profile', {
method: 'post',
body: JSON.stringify(params),
});
return res.json();
},

// ツイッター連携用URL取得
async getConnectTwitterLink(): Promise<{ url: string }> {
const res = await srClientWithToken('https://webapi.syncroom.appservice.yamaha.com/comm/twitter/link_url?callbackURL=https%3A%2F%2Fsyncroom.yamaha.com%2Fplay%2F', {
method: 'get',
});
return res.json();
},

// ツイッター連携解除
async unlinkTwitter(): Promise<SYNCROOM.MyProfileType> {
const res = await srClientWithToken('https://webapi.syncroom.appservice.yamaha.com/comm/users/me/profile', {
method: 'post',
body: JSON.stringify({
profileLinked: {
type: 'none',
linkNickname: false,
linkImage: false,
},
autoTweet: false,
}),
});
return res.json();
},

// ログアウト処理
async logout(): Promise<{ status: 'ok' }> {
const res = await srClientWithToken('https://webapi.syncroom.appservice.yamaha.com/comm/logout', {
Expand Down
1 change: 0 additions & 1 deletion src/types/syncroom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export namespace SYNCROOM {
};

export type FavoriteProductType =
| 'SYNCROOM Plus'
| 'ピアノ・電子ピアノ'
| 'エレクトーン・キーボード'
| 'シンセサイザー'
Expand Down
Loading

0 comments on commit 36cb759

Please sign in to comment.