Skip to content

Commit

Permalink
Merge pull request #309 from cofacts/cleanup-unused
Browse files Browse the repository at this point in the history
Removes unused code and add translation
  • Loading branch information
MrOrz authored May 1, 2022
2 parents d042d9d + 8b7556a commit 150c232
Show file tree
Hide file tree
Showing 17 changed files with 244 additions and 1,725 deletions.
443 changes: 230 additions & 213 deletions i18n/zh_TW.po

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions src/lib/sharedUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const SITE_URLS = (process.env.SITE_URLS || 'https://cofacts.g0v.tw').split(
/**
* prefilled text for LIFF sendMessage()
*/
export const REASON_PREFIX = `💁 ${t`My reason is`}:\n`;
export const SOURCE_PREFIX_FRIST_SUBMISSION = `1️⃣ ${t`I got the message from`}:\n`;
export const SOURCE_PREFIX_NOT_YET_REPLIED = `ℹ️ ${t`I got the message from`}:\n`;
export const UPVOTE_PREFIX = `👍 ${t`I think the reply is useful and I want to add`}:\n`;
export const DOWNVOTE_PREFIX = `💡 ${t`I think the reply is not useful and I suggest`}:\n`;
export const VIEW_ARTICLE_PREFIX = `📃 ${t`See replies of`}:\n`;
Expand Down Expand Up @@ -50,39 +47,6 @@ export function extractArticleId(message) {
return '';
}

/**
* label: Display text in LIFF & the value sent via sendMessage
* value: Normalized value to store in database / Google Analytics
* valid: If we should proceed submission
*/
export const ARTICLE_SOURCE_OPTIONS = [
{
label: t`A LINE group`,
value: 'group message',
valid: true,
},
{
label: t`A LINE official account`,
value: 'official account',
valid: true,
},
{
label: t`Someone sent me on LINE in private`,
value: 'private message',
valid: true,
},
{
label: t`Somewhere outside LINE`,
value: 'outside LINE',
valid: false,
},
{
label: t`I typed it out myself`,
value: 'manual input',
valid: false,
},
];

let locale = require(`date-fns/locale/${(process.env.LOCALE || 'en_US').replace(
'_',
'-'
Expand Down
5 changes: 0 additions & 5 deletions src/liff/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { page } from './lib';
import Article from './pages/Article.svelte';
import Articles from './pages/Articles.svelte';
import Source from './pages/Source.svelte';
import Reason from './pages/Reason.svelte';
import Comment from './pages/Comment.svelte';
import UserSetting from './pages/UserSetting.svelte';
import PositiveFeedback from './pages/PositiveFeedback.svelte';
Expand All @@ -13,13 +11,10 @@
const routes = {
article: Article,
articles: Articles,
source: Source,
'feedback/yes': PositiveFeedback,
'feedback/no': NegativeFeedback,
setting: UserSetting,
comment: Comment,
// Legacy reply request form
reason: Reason,
};
// Send pageview with correct path on each page change.
Expand Down
5 changes: 0 additions & 5 deletions src/liff/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ export const isDuringLiffRedirect = !!params.get('liff.state');
*/
export const page = writable(params.get('p'));

/**
* Used in source page. If it's true, send SOURCE_PREFIX_FRIST_SUBMISSION.
*/
export const isArticleSubmission = !!params.get('article_submission');

/**
* Original JWT token from URL param.
*/
Expand Down
116 changes: 0 additions & 116 deletions src/liff/pages/Reason.svelte

This file was deleted.

66 changes: 0 additions & 66 deletions src/liff/pages/Source.svelte

This file was deleted.

Loading

0 comments on commit 150c232

Please sign in to comment.