class PersonReviewNode(DjangoObjectType):
    class Meta:
        model = PersonReview
        fields = [
            'reviewee',
            'sahabiness_comment',
            'problem_solving_comment',
            'execution_comment',
            'thought_leadership_comment',
            'leadership_comment',
            'presence_comment',
            'strengths',
            'weaknesses',
        ]
        interfaces = (relay.Node, )

    sahabiness_rating = Evaluation()
    problem_solving_rating = Evaluation()
    execution_rating = Evaluation()
    thought_leadership_rating = Evaluation()
    leadership_rating = Evaluation()
    presence_rating = Evaluation()
    state = graphene.Field(State, required=True)

    is_self_review = graphene.NonNull(graphene.Boolean)

    def resolve_is_self_review(self, info):
        return self.is_self_review()

    @classmethod
    def get_node(cls, info, id):
        return get_person_review(info.context.user, id)
Exemplo n.º 2
0
class ManagerProjectCommentNode(DjangoObjectType):
    class Meta:
        model = ManagerProjectComment
        fields = [
            'project_review',
        ]
        interfaces = (relay.Node, )

    rating = Evaluation()

    @classmethod
    def get_node(cls, info, id):
        return get_manager_project_comment(info.context.user, id)
Exemplo n.º 3
0
class ProjectCommentNode(DjangoObjectType):
    class Meta:
        model = ProjectComment
        fields = [
            'text',
            'project_review',
        ]
        interfaces = (relay.Node, )

    reviewer = graphene.Field(UserNode)
    rating = Evaluation()

    def resolve_reviewer(self, info):
        user = info.context.user
        return get_project_comment_reviewer(user, self)

    @classmethod
    def get_node(cls, info, id):
        return get_project_comment(info.context.user, id)
class ManagerPersonReviewNode(DjangoObjectType):
    class Meta:
        model = ManagerPersonReview
        fields = [
            'reviewee',
        ]
        interfaces = (relay.Node, )

    sahabiness_rating = Evaluation()
    problem_solving_rating = Evaluation()
    execution_rating = Evaluation()
    thought_leadership_rating = Evaluation()
    leadership_rating = Evaluation()
    presence_rating = Evaluation()
    overall_rating = Evaluation()

    @classmethod
    def get_node(cls, info, id):
        return get_manager_person_review(info.context.user, id)
class ProjectReviewNode(DjangoObjectType):
    class Meta:
        model = ProjectReview
        fields = [
            'reviewee',
            'project',
            'text',
        ]
        interfaces = (relay.Node, )

    rating = Evaluation()
    reviewers = graphene.List(graphene.NonNull(UserNode), required=True)

    def resolve_reviewers(self, info):
        if not is_at_phase(Phase.SELF_REVIEW):
            return ProjectReview.objects.none()
        return self.reviewers.all()

    @classmethod
    def get_node(cls, info, id):
        return get_project_review(info.context.user, id)
class ProjectReviewNode(DjangoObjectType):
    class Meta:
        model = ProjectReview
        fields = [
            'reviewee',
            'project',
            'text',
        ]
        interfaces = (relay.Node, )

    rating = Evaluation()
    reviewers = graphene.List(graphene.NonNull(UserNode), required=True)

    def resolve_rating(self, info):
        return get_project_review_rating(self)

    def resolve_reviewers(self, info):
        return get_project_review_reviewers(self)

    @classmethod
    def get_node(cls, info, id):
        return get_project_review(info.context.user, id)
    class Input:
        reviewee_id = graphene.NonNull(graphene.ID)
        sahabiness_rating = Evaluation()
        sahabiness_comment = graphene.String()
        problem_solving_rating = Evaluation()
        problem_solving_comment = graphene.String()
        execution_rating = Evaluation()
        execution_comment = graphene.String()
        thought_leadership_rating = Evaluation()
        thought_leadership_comment = graphene.String()
        leadership_rating = Evaluation()
        leadership_comment = graphene.String()
        presence_rating = Evaluation()
        presence_comment = graphene.String()
        strengths = graphene.List(graphene.NonNull(graphene.String))
        weaknesses = graphene.List(graphene.NonNull(graphene.String))

        state = State()
Exemplo n.º 8
0
 class Input:
     project_id = graphene.NonNull(graphene.ID)
     text = graphene.String()
     rating = Evaluation()
     reviewers_id = graphene.List(graphene.NonNull(graphene.ID))
Exemplo n.º 9
0
 class Input:
     project_review_id = graphene.NonNull(graphene.ID)
     rating = Evaluation()