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

Offline: duplicate post-edit-store flux actions in placeholder redux actions #2993

Closed
rralian opened this issue Feb 2, 2016 · 5 comments
Closed

Comments

@rralian
Copy link
Contributor

rralian commented Feb 2, 2016

This task is to both create the placeholder actions and to call them wherever flux actions are being called.

@artpi
Copy link
Contributor

artpi commented Feb 4, 2016

Files to take care of:

PR #3025

  • client/post-editor/controller.js
  • client/post-editor/edit-post-status/index.jsx
  • client/post-editor/editor-author/index.jsx
  • client/post-editor/editor-categories/index.jsx
  • client/post-editor/editor-delete-post/index.jsx
  • client/post-editor/editor-discussion/index.jsx
  • client/post-editor/editor-discussion/test/index.jsx
  • client/post-editor/editor-drawer/index.jsx
  • client/post-editor/editor-featured-image/index.jsx
  • client/post-editor/test/post-editor.jsx
  • client/state/ui/editor/post/actions.js

Next PR

  • client/post-editor/editor-featured-image/index.jsx
  • client/post-editor/editor-featured-image/preview-container.jsx
  • client/post-editor/editor-ground-control/index.jsx
  • client/post-editor/editor-location/index.jsx
  • client/post-editor/editor-media-advanced/index.jsx
  • client/post-editor/editor-page-order/index.jsx
  • client/post-editor/editor-page-parent/index.jsx
  • client/post-editor/editor-page-templates/index.jsx
  • client/post-editor/editor-post-formats/index.jsx
  • client/post-editor/editor-sharing/container.jsx
  • client/post-editor/editor-sharing/publicize-connection.jsx
  • client/post-editor/editor-sharing/publicize-message.jsx
  • client/post-editor/editor-sharing/sharing-like-options.jsx
  • client/post-editor/editor-slug/index.jsx
  • client/post-editor/editor-tags/index.jsx
  • client/post-editor/editor-title/index.jsx
  • client/post-editor/editor-visibility/index.jsx
  • client/post-editor/media-modal/detail/detail-fields.jsx
  • client/post-editor/media-modal/detail/detail-title.jsx
  • client/post-editor/media-modal/gallery-help-container.jsx
  • client/post-editor/media-modal/gallery-help.jsx
  • client/post-editor/media-modal/gallery/caption.jsx
  • client/post-editor/media-modal/gallery/drop-zone.jsx
  • client/post-editor/media-modal/gallery/remove-button.jsx
  • client/post-editor/media-modal/index.jsx
  • client/post-editor/media-modal/secondary-actions.jsx
  • client/post-editor/media-modal/test/specs/index.jsx
  • client/post-editor/post-editor.jsx

@artpi
Copy link
Contributor

artpi commented Feb 4, 2016

Search results in sublime:

/Users/Artpi/GIT/calypso/client/post-editor/editor-featured-image/index.jsx:
   11   EditorMediaModal = require( 'post-editor/media-modal' ),
   12   EditorDrawerWell = require( 'post-editor/editor-drawer-well' ),
   13:  PostActions = require( 'lib/posts/actions' ),
   14   PostUtils = require( 'lib/posts/utils' ),
   15   stats = require( 'lib/posts/stats' ),

/Users/Artpi/GIT/calypso/client/post-editor/editor-featured-image/preview-container.jsx:
    8   * Internal dependencies
    9   */
   10: import MediaActions from 'lib/media/actions';
   11  import MediaStore from 'lib/media/store';
   12: import PostActions from 'lib/posts/actions';
   13  import EditorFeaturedImagePreview from './preview';
   14  

/Users/Artpi/GIT/calypso/client/post-editor/editor-ground-control/index.jsx:
   19   Popover = require( 'components/popover' ),
   20   PostSchedule = require( 'components/post-schedule' ),
   21:  postActions = require( 'lib/posts/actions' ),
   22   Tooltip = require( 'components/tooltip' ),
   23   PostListFetcher = require( 'components/post-list-fetcher' ),

/Users/Artpi/GIT/calypso/client/post-editor/editor-location/index.jsx:
    8   * Internal dependencies
    9   */
   10: var PostActions = require( 'lib/posts/actions' ),
   11   EditorDrawerWell = require( 'post-editor/editor-drawer-well' ),
   12   Notice = require( 'components/notice' ),

/Users/Artpi/GIT/calypso/client/post-editor/editor-media-advanced/index.jsx:
    9   * Internal dependencies
   10   */
   11: import { toggleEditorMediaAdvanced } from 'state/ui/editor/media/actions';
   12  import Dialog from 'components/dialog';
   13  

/Users/Artpi/GIT/calypso/client/post-editor/editor-page-order/index.jsx:
   10   */
   11  import TextInput from 'components/forms/form-text-input';
   12: import postActions from 'lib/posts/actions';
   13  import { recordEvent, recordStat } from 'lib/posts/stats';
   14  

/Users/Artpi/GIT/calypso/client/post-editor/editor-page-parent/index.jsx:
   10   */
   11  import PostSelector from 'my-sites/post-selector';
   12: import postActions from 'lib/posts/actions';
   13  import FormLabel from 'components/forms/form-label';
   14  import FormToggle from 'components/forms/form-toggle/compact';

/Users/Artpi/GIT/calypso/client/post-editor/editor-page-templates/index.jsx:
    8   * Internal dependencies
    9   */
   10: import PostActions from 'lib/posts/actions';
   11  import AccordionSection from 'components/accordion/section';
   12  import SelectDropdown from 'components/select-dropdown';

/Users/Artpi/GIT/calypso/client/post-editor/editor-post-formats/index.jsx:
    9  var FormRadio = require( 'components/forms/form-radio' ),
   10   Gridicon = require( 'components/gridicon' ),
   11:  PostActions = require( 'lib/posts/actions' ),
   12   stats = require( 'lib/posts/stats' ),
   13   AccordionSection = require( 'components/accordion/section' );

/Users/Artpi/GIT/calypso/client/post-editor/editor-sharing/container.jsx:
    9   */
   10  import PostEditStore from 'lib/posts/post-edit-store';
   11: import { fetchConnections } from 'state/sharing/publicize/actions';
   12  import { getConnectionsBySiteIdAvailableToCurrentUser, hasFetchedConnections } from 'state/sharing/publicize/selectors';
   13  import { getSelectedSite } from 'state/ui/selectors';

/Users/Artpi/GIT/calypso/client/post-editor/editor-sharing/publicize-connection.jsx:
   10  import FormCheckbox from 'components/forms/form-checkbox';
   11  import PostMetadata from 'lib/post-metadata';
   12: import PostActions from 'lib/posts/actions';
   13  import * as PostStats from 'lib/posts/stats';
   14  import Notice from 'components/notice';

/Users/Artpi/GIT/calypso/client/post-editor/editor-sharing/publicize-message.jsx:
    9  var CountedTextarea = require( 'components/forms/counted-textarea' ),
   10   FormTextarea = require( 'components/forms/form-textarea' ),
   11:  PostActions = require( 'lib/posts/actions' ),
   12   stats = require( 'lib/posts/stats' ),
   13   TrackInputChanges = require( 'components/track-input-changes' ),

/Users/Artpi/GIT/calypso/client/post-editor/editor-sharing/sharing-like-options.jsx:
    9  var EditorFieldset = require( 'post-editor/editor-fieldset' ),
   10   FormCheckbox = require( 'components/forms/form-checkbox' ),
   11:  PostActions = require( 'lib/posts/actions' ),
   12   stats = require( 'lib/posts/stats' );
   13  

/Users/Artpi/GIT/calypso/client/post-editor/editor-slug/index.jsx:
   11   * Internal Dependencies
   12   */
   13: import actions from 'lib/posts/actions';
   14  import TrackInputChanges from 'components/track-input-changes';
   15  import FormTextInput from 'components/forms/form-text-input';
   ..
   45  
   46   onSlugChange( event ) {
   47:      actions.edit( { slug: event.target.value } );
   48   },
   49  

/Users/Artpi/GIT/calypso/client/post-editor/editor-tags/index.jsx:
   11  import TokenField from 'components/token-field';
   12  import TermsConstants from 'lib/terms/constants';
   13: import PostActions from 'lib/posts/actions';
   14  import { recordStat, recordEvent } from 'lib/posts/stats';
   15  import { isPage } from 'lib/posts/utils';

/Users/Artpi/GIT/calypso/client/post-editor/editor-title/index.jsx:
    9   * Internal dependencies
   10   */
   11: import PostActions from 'lib/posts/actions';
   12  import PostUtils from 'lib/posts/utils';
   13  import SiteUtils from 'lib/site/utils';

/Users/Artpi/GIT/calypso/client/post-editor/editor-visibility/index.jsx:
   21  import touchDetect from 'lib/touch-detect';
   22  import Tooltip from 'components/tooltip';
   23: import postActions from 'lib/posts/actions';
   24  import { recordEvent, recordStat } from 'lib/posts/stats';
   25  import accept from 'lib/accept';

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/detail/detail-fields.jsx:
   13  var analytics = require( 'analytics' ),
   14   MediaUtils = require( 'lib/media/utils' ),
   15:  MediaActions = require( 'lib/media/actions' ),
   16   ClipboardButtonInput = require( 'components/clipboard-button-input' ),
   17   FormTextarea = require( 'components/forms/form-textarea' ),

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/detail/detail-title.jsx:
    9   */
   10  import analytics from 'analytics';
   11: import MediaActions from 'lib/media/actions';
   12  import { userCan } from 'lib/site/utils';
   13  import TrackInputChanges from 'components/track-input-changes';

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/gallery-help-container.jsx:
    9   */
   10  import PostEditStore from 'lib/posts/post-edit-store';
   11: import PreferencesActions from 'lib/preferences/actions';
   12  import PreferencesStore from 'lib/preferences/store';
   13  import EditorMediaModalGalleryHelp from './gallery-help';

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/gallery-help.jsx:
   85                       </span>
   86                   </div>
   87:                  <div className="editor-media-modal__gallery-help-actions">
   88                       <label className="editor-media-modal__gallery-help-remember-dismiss">
   89                           <FormCheckbox checked={ this.state.rememberDismiss } onChange={ this.toggleRememberDismiss } />

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/gallery/caption.jsx:
    7   * Internal dependencies
    8   */
    9: import MediaActions from 'lib/media/actions';
   10  import FormTextInput from 'components/forms/form-text-input';
   11  

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/gallery/drop-zone.jsx:
   10  import MediaLibraryDropZone from 'my-sites/media-library/drop-zone';
   11  import MediaLibrarySelectedStore from 'lib/media/library-selected-store';
   12: import MediaActions from 'lib/media/actions';
   13  import MediaUtils from 'lib/media/utils';
   14  

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/gallery/remove-button.jsx:
    9   * Internal dependencies
   10   */
   11: import MediaActions from 'lib/media/actions';
   12  import MediaLibrarySelectedStore from 'lib/media/library-selected-store';
   13  import Gridicon from 'components/gridicon';

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/index.jsx:
   16  var MediaLibrary = require( 'my-sites/media-library' ),
   17   analytics = require( 'analytics' ),
   18:  PostActions = require( 'lib/posts/actions' ),
   19   PostStats = require( 'lib/posts/stats' ),
   20:  MediaModalSecondaryActions = require( './secondary-actions' ),
   21   MediaModalDetail = require( './detail' ),
   22   MediaModalGallery = require( './gallery' ),
   23:  MediaActions = require( 'lib/media/actions' ),
   24   MediaUtils = require( 'lib/media/utils' ),
   25   Dialog = require( 'components/dialog' ),
   ..
  128  
  129           if ( stat ) {
  130:              analytics.mc.bumpStat( 'editor_media_actions', stat );
  131           }
  132       }
  ...
  149  
  150       if ( stat ) {
  151:          analytics.mc.bumpStat( 'editor_media_actions', stat );
  152       }
  153   },
  ...
  182  
  183       MediaActions.delete( this.props.site.ID, toDelete );
  184:      analytics.mc.bumpStat( 'editor_media_actions', 'delete_media' );
  185   },
  186  
  ...
  210   onFilterChange: function( filter ) {
  211       if ( filter !== this.state.filter ) {
  212:          analytics.mc.bumpStat( 'editor_media_actions', 'filter_' + ( filter || 'all' ) );
  213       }
  214  
  ...
  220   onScaleChange: function() {
  221       if ( ! this.statsTracking.scale ) {
  222:          analytics.mc.bumpStat( 'editor_media_actions', 'scale' );
  223           this.statsTracking.scale = true;
  224       }
  ...
  231  
  232       if ( ! this.statsTracking.search ) {
  233:          analytics.mc.bumpStat( 'editor_media_actions', 'search' );
  234           this.statsTracking.search = true;
  235       }
  ...
  258       this.setDetailSelectedIndex( findIndex( sortedItems, { ID: item.ID } ) );
  259  
  260:      analytics.mc.bumpStat( 'editor_media_actions', 'edit_button_contextual' );
  261       analytics.ga.recordEvent( 'Media', 'Clicked Contextual Edit Button' );
  262  



/Users/Artpi/GIT/calypso/client/post-editor/media-modal/secondary-actions.jsx:
   55  
   56   onEdit() {
   57:      analytics.mc.bumpStat( 'editor_media_actions', 'edit_button_dialog' );
   58       analytics.ga.recordEvent( 'Media', 'Clicked Dialog Edit Button' );
   59  
   ..
  158   render() {
  159       return (
  160:          <div className="editor-media-modal__secondary-actions">
  161               { this.renderMobileButtons() }
  162               { this.renderDesktopButtons() }

/Users/Artpi/GIT/calypso/client/post-editor/media-modal/test/specs/index.jsx:
   54       mockery.registerMock( './detail', EMPTY_COMPONENT );
   55       mockery.registerMock( './gallery', EMPTY_COMPONENT );
   56:      mockery.registerMock( './secondary-actions', EMPTY_COMPONENT );
   57       mockery.registerMock( 'components/dialog', EMPTY_COMPONENT );
   58       mockery.registerMock( 'components/popover', EMPTY_COMPONENT );
   59       mockery.registerMock( 'lib/accept', accept );
   60       mockery.registerMock( 'component-closest', {} );
   61:      mockery.registerMock( 'lib/media/actions', { delete: deleteMedia } );
   62  
   63       EditorMediaModal = require( '../../' );

/Users/Artpi/GIT/calypso/client/post-editor/post-editor.jsx:
   14   * Internal dependencies
   15   */
   16: var actions = require( 'lib/posts/actions' ),
   17   config = require( 'config' ),
   18   route = require( 'lib/route' ),
   ..
   36   EditorMobileNavigation = require( 'post-editor/editor-mobile-navigation' ),
   37   layoutFocus = require( 'lib/layout-focus' ),
   38:  titleActions = require( 'lib/screen-title/actions' ),
   39   observe = require( 'lib/mixins/data-observe' ),
   40   DraftList = require( 'my-sites/drafts/draft-list' ),
   41   DraftsButton = require( 'post-editor/drafts-button' ),
   42   PostCountsData = require( 'components/data/post-counts-data' ),
   43:  PreferencesActions = require( 'lib/preferences/actions' ),
   44   InvalidURLDialog = require( 'post-editor/invalid-url-dialog' ),
   45   RestorePostDialog = require( 'post-editor/restore-post-dialog' ),
   ..
  225   componentWillUnmount: function() {
  226       PostEditStore.removeListener( 'change', this.onEditedPostChange );
  227:      actions.stopEditing();
  228       this.debouncedAutosave.cancel();
  229       this.debouncedSaveRawContent.cancel();
  ...
  456       };
  457  
  458:      actions.edit( edits );
  459   },
  460  
  ...
  529  
  530   saveRawContent: function() {
  531:      actions.editRawContent( this.refs.editor.getContent( { format: 'raw' } ) );
  532   },
  533  
  ...
  540  
  541       this.saveRawContent();
  542:      actions.edit( { content: this.refs.editor.getContent() } );
  543  
  544       // Make sure that after TinyMCE processing that the post is still dirty
  ...
  560       }
  561  
  562:      actions.autosave( callback );
  563   },
  564  
  ...
  610       edits.content = this.refs.editor.getContent();
  611  
  612:      actions.saveEdited( edits, function( error ) {
  613           if ( error && 'NO_CHANGE' !== error.message ) {
  614               this.onSaveDraftFailure( error );
  ...
  651  
  652       if ( status === 'publish' ) {
  653:          actions.edit( { content: this.refs.editor.getContent() } );
  654:          actions.autosave( previewPost );
  655       } else {
  656           this.onSave( null, previewPost );
  ...
  725       edits.content = this.refs.editor.getContent();
  726  
  727:      actions.saveEdited( edits, function( error ) {
  728           if ( error && 'NO_CHANGE' !== error.message ) {
  729               this.onPublishFailure( error );
  ...
  835       PreferencesActions.set( 'editor-mode', mode );
  836  
  837:      // Defer actions until next available tick to avoid
  838       // dispatching inside a dispatch which can happen if for example the
  839       // title field is focused when toggling the editor.
  840       this._switchEditorTimeout = setTimeout( function() {
  841:          actions.edit( { content: content } );
  842:          actions.resetRawContent();
  843  
  844           if ( mode === 'html' ) {
  845               // Set raw content directly to avoid race conditions
  846:              actions.editRawContent( content );
  847           } else {
  848               this.saveRawContent();

85 matches across 37 files

@rralian
Copy link
Contributor Author

rralian commented Mar 9, 2016

@artpi what should we do with this issue? should I close it? should we reassign it? I want to close out the offline milestone.

@aduth
Copy link
Contributor

aduth commented Aug 8, 2016

We removed existing placeholder actions in #5438 because they were falling out of date and proving to be problematic. A working editPost Redux action was introduced with #3183, and edits introduced to Redux state are merged into Flux-based edits before save as of #6348. Progress continues separately to migrate individual components to using Redux state exclusively (e.g. #7166).

@aduth aduth closed this as completed Aug 8, 2016
@artpi
Copy link
Contributor

artpi commented Aug 8, 2016

😿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants