Skip to content

Add pfDataToolbar directive with ngDocs/Example and Unit Tests #71

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

Merged
merged 1 commit into from
Sep 4, 2015

Conversation

jeff-phillips-18
Copy link
Member

No description provided.

},
link: function (scope, element, attrs) {
scope.$watch('config', function () {
if (scope.config && scope.config.viewsConfig && scope.config.viewsConfig.views) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this be moved to the controller?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, watching and observing have to be done post compile (ie in the link function)

Copy link
Member

Choose a reason for hiding this comment

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

Thought we could 'watch' in controller:, and 'observe' in the link:

Copy link
Member Author

Choose a reason for hiding this comment

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

I've always kept them in the link.

On Fri, Sep 4, 2015 at 1:53 PM, Dave Taylor notifications@github.com
wrote:

In src/views/toolbar/data-toolbar-directive.js
#71 (comment)
:

  •      if ($scope.config.viewsConfig.onViewSelect && !$scope.checkViewDisabled(viewId)) {
    
  •        $scope.config.viewsConfig.onViewSelect(viewId);
    
  •      }
    
  •    };
    
  •    $scope.isViewSelected = function (viewId) {
    
  •      return $scope.config.viewsConfig && ($scope.config.viewsConfig.currentView === viewId);
    
  •    };
    
  •    $scope.checkViewDisabled = function (view) {
    
  •      return $scope.config.viewsConfig.checkViewDisabled && $scope.config.viewsConfig.checkViewDisabled(view);
    
  •    };
    
  •  },
    
  •  link: function (scope, element, attrs) {
    
  •    scope.$watch('config', function () {
    
  •      if (scope.config && scope.config.viewsConfig && scope.config.viewsConfig.views) {
    

Thought we could 'watch' in controller:, and 'observe' in the link:


Reply to this email directly or view it on GitHub
https://github.com/patternfly/angular-patternfly/pull/71/files#r38777089
.

@dtaylor113
Copy link
Member

I think the pf-selector's "Address" is to low in the box:
apf-toolbar

From PF:
pf-toolbar-orig

@jeff-phillips-18
Copy link
Member Author

@dtaylor113 Yeah, this is only in the example though. It's fine when used in an application. I just couldn't get the right demo.css settings to fix it here.

@dtaylor113
Copy link
Member

Weird list item stacking when selecting between "Birth Month" and "Name". The input box to the right of the pf-selector momentarily appears vertically stacked before collapsing into the single placeholder. Is this just in the demo?

@jeff-phillips-18
Copy link
Member Author

Yes, again it's in the example only.

</file>
</example>
*/
angular.module('patternfly.views').directive('pfDataToolbar',
Copy link
Member

Choose a reason for hiding this comment

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

I don't think a 'toolbar' should be under 'views', I know it consumes the 'views' mechanism, but it should probably go into a general 'components' directive. For now it's fine.

@dtaylor113
Copy link
Member

LGTM

@jeff-phillips-18
Copy link
Member Author

@waldenraines Do you have a moment to review this?

dtaylor113 added a commit that referenced this pull request Sep 4, 2015
Add pfDataToolbar directive with ngDocs/Example and Unit Tests
@dtaylor113 dtaylor113 merged commit d788e09 into patternfly:master Sep 4, 2015
@waldenraines
Copy link

@jeff-phillips-18 I do but too late 😦

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

Successfully merging this pull request may close these issues.

3 participants