Skip to content

Commit aa677a4

Browse files
authored
Merge pull request #1034 from AlisProject/ALIS-5566
ALIS-5566: BASHO の更新
2 parents 7dcec76 + 6543aae commit aa677a4

10 files changed

Lines changed: 49 additions & 285 deletions
-1014 Bytes
Binary file not shown.
-1014 Bytes
Binary file not shown.

app/components/molecules/DefaultHeaderNav.vue

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
"
1818
@click.native="resetData"
1919
>
20-
<span
21-
v-if="topic.name === 'fitness' || topic.name === 'learn-english'"
22-
class="topic-display-pre-name"
23-
>
24-
BASHO
25-
</span>
2620
<span class="topic-display-name">
2721
{{ topic.display_name }}
2822
</span>
@@ -175,10 +169,6 @@ $topicCount: 10;
175169
}
176170
}
177171
178-
.topic-display-pre-name {
179-
display: none;
180-
}
181-
182172
.topic-display-name {
183173
bottom: 7px;
184174
}
@@ -240,13 +230,6 @@ $topicCount: 10;
240230
background-image: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
241231
}
242232
243-
.topic-display-pre-name {
244-
margin-top: 10px;
245-
left: 0;
246-
position: absolute;
247-
right: 0;
248-
}
249-
250233
.topic-display-name {
251234
bottom: 6px;
252235
left: 0;
@@ -262,10 +245,6 @@ $topicCount: 10;
262245
margin: 3px 2px 0 2px;
263246
width: 85px;
264247
265-
.topic-display-pre-name {
266-
margin-top: 8px;
267-
}
268-
269248
.topic-display-name {
270249
bottom: 5px;
271250
}

app/components/molecules/EditHeaderNavPostArticleV1.vue

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@
4040
選択してください
4141
</option>
4242
<option v-for="topic in topics" :value="topic.name">
43-
{{
44-
['筋トレ', '英語学習'].includes(topic.display_name)
45-
? 'BASHO:' + topic.display_name
46-
: topic.display_name
47-
}}
43+
{{ topic.display_name }}
4844
</option>
4945
</select>
5046
</no-ssr>
@@ -131,70 +127,15 @@ export default {
131127
return
132128
}
133129
134-
// タグのデータ形式をAPIに適するように整形
135-
const tags = this.tags.map((tag) => tag.text)
136-
137-
// BASHO 対応
138-
if (['fitness', 'learn-english'].includes(topicType)) {
139-
// タイトルの先頭が正しく設定されているか
140-
if (
141-
!title.startsWith('【質問】') &&
142-
!title.startsWith('【議論】') &&
143-
!title.startsWith('【共有】')
144-
) {
145-
this.sendNotification({
146-
text:
147-
'BASHOカテゴリ利用の際は、タイトルの先頭に【質問】、【議論】、【共有】のいずれかを記載ください',
148-
dismissAfter: 7000
149-
})
150-
this.publishingArticle = false
151-
return
152-
}
153-
// 正しいBASHO専用タグが設定されていない場合は付与
154-
const tagHeader = topicType === 'fitness' ? '筋トレ:' : '英語学習:'
155-
const bashoTags = ['質問', '議論', '共有']
156-
let targetBashoTag = ''
157-
for (const bashoTag of bashoTags) {
158-
if (title.startsWith('' + bashoTag + '')) {
159-
targetBashoTag = bashoTag
160-
if (!tags.includes(tagHeader + bashoTag)) {
161-
if (tags.length > 4) {
162-
this.sendNotification({
163-
text: 'タイトルに紐づくタグ、”' + tagHeader + bashoTag + '” を設定してください',
164-
dismissAfter: 7000
165-
})
166-
this.publishingArticle = false
167-
return
168-
} else {
169-
tags.push(tagHeader + bashoTag)
170-
}
171-
}
172-
}
173-
}
174-
// 全てのBASHO専用タグを取得
175-
const allBashoTags = bashoTags
176-
.map((bashoTag) => '筋トレ:' + bashoTag)
177-
.concat(bashoTags.map((bashoTag) => '英語学習:' + bashoTag))
178-
const filterTags = tags.filter(
179-
(tag) => tag !== tagHeader + targetBashoTag && allBashoTags.includes(tag)
180-
)
181-
// タイトルと異なるBASHO専用タグが設定されていないこと
182-
if (filterTags.length > 0) {
183-
this.sendNotification({
184-
text: 'タイトルと異なるタグ、「' + filterTags.join('') + '」を削除してください',
185-
dismissAfter: 7000
186-
})
187-
this.publishingArticle = false
188-
return
189-
}
190-
}
191-
192130
const article = { title, body, overview }
193131
194132
if (this.thumbnail !== '') {
195133
article.eye_catch_url = this.thumbnail
196134
}
197135
136+
// タグのデータ形式をAPIに適するように整形
137+
const tags = this.tags.map((tag) => tag.text)
138+
198139
if (
199140
location.href.includes('/me/articles/draft') ||
200141
location.href.includes('/me/articles/new')

app/components/molecules/EditHeaderNavPostArticleV2.vue

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@
4040
選択してください
4141
</option>
4242
<option v-for="topic in topics" :value="topic.name">
43-
{{
44-
['筋トレ', '英語学習'].includes(topic.display_name)
45-
? 'BASHO:' + topic.display_name
46-
: topic.display_name
47-
}}
43+
{{ topic.display_name }}
4844
</option>
4945
</select>
5046
</no-ssr>
@@ -190,64 +186,6 @@ export default {
190186
return
191187
}
192188
193-
// タグのデータ形式をAPIに適するように整形
194-
const tags = this.tags.map((tag) => tag.text)
195-
196-
// BASHO 対応
197-
if (['fitness', 'learn-english'].includes(topicType)) {
198-
// タイトルの先頭が正しく設定されているか
199-
if (
200-
!title.startsWith('【質問】') &&
201-
!title.startsWith('【議論】') &&
202-
!title.startsWith('【共有】')
203-
) {
204-
this.sendNotification({
205-
text:
206-
'BASHOカテゴリ利用の際は、タイトルの先頭に【質問】、【議論】、【共有】のいずれかを記載ください',
207-
dismissAfter: 7000
208-
})
209-
this.publishingArticle = false
210-
return
211-
}
212-
// 正しいBASHO専用タグが設定されていない場合は付与
213-
const tagHeader = topicType === 'fitness' ? '筋トレ:' : '英語学習:'
214-
const bashoTags = ['質問', '議論', '共有']
215-
let targetBashoTag = ''
216-
for (const bashoTag of bashoTags) {
217-
if (title.startsWith('' + bashoTag + '')) {
218-
targetBashoTag = bashoTag
219-
if (!tags.includes(tagHeader + bashoTag)) {
220-
if (tags.length > 4) {
221-
this.sendNotification({
222-
text: 'タイトルに紐づくタグ、”' + tagHeader + bashoTag + '” を設定してください',
223-
dismissAfter: 7000
224-
})
225-
this.publishingArticle = false
226-
return
227-
} else {
228-
tags.push(tagHeader + bashoTag)
229-
}
230-
}
231-
}
232-
}
233-
// 全てのBASHO専用タグを取得
234-
const allBashoTags = bashoTags
235-
.map((bashoTag) => '筋トレ:' + bashoTag)
236-
.concat(bashoTags.map((bashoTag) => '英語学習:' + bashoTag))
237-
const filterTags = tags.filter(
238-
(tag) => tag !== tagHeader + targetBashoTag && allBashoTags.includes(tag)
239-
)
240-
// タイトルと異なるBASHO専用タグが設定されていないこと
241-
if (filterTags.length > 0) {
242-
this.sendNotification({
243-
text: 'タイトルと異なるタグ、「' + filterTags.join('') + '」を削除してください',
244-
dismissAfter: 7000
245-
})
246-
this.publishingArticle = false
247-
return
248-
}
249-
}
250-
251189
if (this.paymentType === 'pay') {
252190
this.setSelectPayment({ title, body, price })
253191
if (location.href.includes('/me/articles/draft')) {
@@ -261,6 +199,8 @@ export default {
261199
262200
const articleTitle = { title }
263201
const articleBody = { body }
202+
// タグのデータ形式をAPIに適するように整形
203+
const tags = this.tags.map((tag) => tag.text)
264204
265205
if (
266206
location.href.includes('/me/articles/draft') ||

app/components/molecules/MobileEditorHeaderPostArticleModalContent.vue

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333
選択してください
3434
</option>
3535
<option v-for="topic in topics" :value="topic.name">
36-
{{
37-
['筋トレ', '英語学習'].includes(topic.display_name)
38-
? 'BASHO:' + topic.display_name
39-
: topic.display_name
40-
}}
36+
{{ topic.display_name }}
4137
</option>
4238
</select>
4339
</no-ssr>
@@ -161,64 +157,6 @@ export default {
161157
return
162158
}
163159
164-
// タグのデータ形式をAPIに適するように整形
165-
const tags = this.tags.map((tag) => tag.text)
166-
167-
// BASHO 対応
168-
if (['fitness', 'learn-english'].includes(topicType)) {
169-
// タイトルの先頭が正しく設定されているか
170-
if (
171-
!title.startsWith('【質問】') &&
172-
!title.startsWith('【議論】') &&
173-
!title.startsWith('【共有】')
174-
) {
175-
this.sendNotification({
176-
text:
177-
'BASHOカテゴリ利用の際は、タイトルの先頭に【質問】、【議論】、【共有】のいずれかを記載ください',
178-
dismissAfter: 7000
179-
})
180-
this.publishingArticle = false
181-
return
182-
}
183-
// 正しいBASHO専用タグが設定されていない場合は付与
184-
const tagHeader = topicType === 'fitness' ? '筋トレ:' : '英語学習:'
185-
const bashoTags = ['質問', '議論', '共有']
186-
let targetBashoTag = ''
187-
for (const bashoTag of bashoTags) {
188-
if (title.startsWith('' + bashoTag + '')) {
189-
targetBashoTag = bashoTag
190-
if (!tags.includes(tagHeader + bashoTag)) {
191-
if (tags.length > 4) {
192-
this.sendNotification({
193-
text: 'タイトルに紐づくタグ、”' + tagHeader + bashoTag + '” を設定してください',
194-
dismissAfter: 7000
195-
})
196-
this.publishingArticle = false
197-
return
198-
} else {
199-
tags.push(tagHeader + bashoTag)
200-
}
201-
}
202-
}
203-
}
204-
// 全てのBASHO専用タグを取得
205-
const allBashoTags = bashoTags
206-
.map((bashoTag) => '筋トレ:' + bashoTag)
207-
.concat(bashoTags.map((bashoTag) => '英語学習:' + bashoTag))
208-
const filterTags = tags.filter(
209-
(tag) => tag !== tagHeader + targetBashoTag && allBashoTags.includes(tag)
210-
)
211-
// タイトルと異なるBASHO専用タグが設定されていないこと
212-
if (filterTags.length > 0) {
213-
this.sendNotification({
214-
text: 'タイトルと異なるタグ、「' + filterTags.join('') + '」を削除してください',
215-
dismissAfter: 7000
216-
})
217-
this.publishingArticle = false
218-
return
219-
}
220-
}
221-
222160
if (this.paymentType === 'pay') {
223161
this.setSelectPayment({ title, body, price })
224162
this.setMobileEditorHeaderPostArticleModal({ isShow: false })
@@ -233,6 +171,8 @@ export default {
233171
234172
const articleTitle = { title }
235173
const articleBody = { body }
174+
// タグのデータ形式をAPIに適するように整形
175+
const tags = this.tags.map((tag) => tag.text)
236176
237177
if (
238178
location.href.includes('/me/articles/draft') ||

0 commit comments

Comments
 (0)