Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/duplicate page #191

Merged
merged 6 commits into from
Oct 13, 2017
Merged

Feat/duplicate page #191

merged 6 commits into from
Oct 13, 2017

Conversation

TatsuyaIse
Copy link
Contributor

  • Implementation of page duplication function.

    1. Add duplicate button on page management menu.
    2. Implement page duplication api.
    3. Add label translation for page duplication function.
  • ページ複製機能の実装

    1. ページ管理メニューに複製ボタンを追加
    2. ページ複製APIを実装
    3. 複製機能に関する(ボタンおよびモーダルの) i18n 化

* Add duplicate-page button to page pulldown menu.
* Add duplicate-page modal.
* Fix tag id "newPageName" for duplicate-page to "duplicatePageName" (because it was same id with move-page's "newPageName").
* Implement page-duplicate api.
* Change duplicate icon fa-clone.
* Fix translation label.
@TatsuyaIse TatsuyaIse self-assigned this Oct 13, 2017
return res.json(ApiResponse.error(err));
});;
});
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと適当な提案するけど、このメソッド、他の create とかのラッパーとして実装する事ってできないかな?新しくページ作る部分はコード重複してるしやってること同じだと思うんだよね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そもそもとして、 models/page.js に、複製を実行するメソッドの実装は不要でした。
create の引数を変えるだけでよいことが判明したので、
api.duplicate から呼び出すメソッドを create に変更して対応するように修正しています。

* Delete page-duplicate execute function.
* Change call function duplicate -> create in page-duplication-api.
* Fix options for call page-create function from page-duplication-api.
* Change api.duplicate's calling function Page.create to api.create.
  (Api.duplicate wraps api.create, not call direct Page.create.)
@yuki-takei yuki-takei merged commit 3579bba into master Oct 13, 2017
@yuki-takei yuki-takei deleted the feat/duplicate-page branch October 13, 2017 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants