Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
151ac1e
Checkpoint
mehalshah Aug 27, 2018
24c94dd
Merge remote-tracking branch 'origin/staging' into lb-audit-log
MeyAyre Aug 29, 2018
55100c3
Gave table more space to fix overflow overlap
MeyAyre Aug 30, 2018
c17608a
Make linter happy
mehalshah Aug 30, 2018
db60e48
Actually make linter happy
mehalshah Aug 31, 2018
8c8df0e
Merge branch 'staging' into lb-audit-log
MeyAyre Sep 4, 2018
4ac755a
Checkpoint
mehalshah Sep 4, 2018
de2d96b
Couple more changes
mehalshah Sep 4, 2018
af7cce8
AzureContentModerator has DCDO-configurable parameters
islemaster Sep 5, 2018
9e97887
Extract constants for response keys
islemaster Sep 5, 2018
1a8dc74
Add documentation to flaky step
Sep 5, 2018
faacae0
Fix broken tests
mehalshah Sep 5, 2018
c8e5cef
Merge pull request #24643 from code-dot-org/dcdo-content-moderation
Erin007 Sep 5, 2018
c079f0d
Merge pull request #24646 from code-dot-org/document_press_key_ie_flake
Sep 5, 2018
c9ff823
Merge branch 'test' into staging
Sep 5, 2018
5280b44
projectValidator prop -> limitedGallery prop, use DCDO to set limited…
Erin007 Sep 5, 2018
dd3ab54
Merge pull request #24652 from code-dot-org/staging
deploy-code-org Sep 5, 2018
0c0bf93
levelbuilder content changes (-robo-commit)
deploy-code-org Sep 5, 2018
b36820b
Merge pull request #24654 from code-dot-org/dtl_candidate_28e8614b
deploy-code-org Sep 5, 2018
8c2a2e6
update config and write tests
Sep 5, 2018
7de0237
Merge pull request #24576 from code-dot-org/principal_approval_per_pa…
mehalshah Sep 5, 2018
20e7204
Merge pull request #24655 from code-dot-org/staging
deploy-code-org Sep 5, 2018
a5f9430
Select primary_contact_info_id when selecting users for managing perm…
maddiedierker Sep 6, 2018
d8b09e9
simplify conditional
Erin007 Sep 6, 2018
e1714a8
Update google drive gem version
balderdash Sep 6, 2018
24ee31f
move limited gallery check to helper in projects_controller
Erin007 Sep 6, 2018
86942db
move comment
Erin007 Sep 6, 2018
0e64cec
Merge pull request #24656 from code-dot-org/update-redis-slave-gem-co…
Sep 6, 2018
6d2c972
Merge pull request #24659 from code-dot-org/manage-user-permissions-tool
Sep 6, 2018
0f43059
Merge pull request #24618 from code-dot-org/lb-audit-log
MeyAyre Sep 6, 2018
16ac896
add newlines within <summary> tags so their content can be parsed as …
Hamms Aug 30, 2018
788579f
add newlines within the bodies of 'detail' tags so their content is p…
Hamms Aug 30, 2018
8c237cc
Merge pull request #24660 from code-dot-org/update-gdrive
balderdash Sep 6, 2018
ad361ca
Merge pull request #24664 from code-dot-org/staging
deploy-code-org Sep 6, 2018
fe944c1
levelbuilder content changes (-robo-commit)
deploy-code-org Sep 6, 2018
1174ded
staging content changes (-robo-commit)
deploy-code-org Sep 6, 2018
9ec022a
Merge pull request #24665 from code-dot-org/levelbuilder
deploy-code-org Sep 6, 2018
7f9cc55
Merge pull request #24650 from code-dot-org/use-dcdo-to-hide-projects
Erin007 Sep 6, 2018
3f17795
Merge pull request #24666 from code-dot-org/staging
deploy-code-org Sep 6, 2018
7f60c7c
Merge pull request #24574 from code-dot-org/pad-details
Hamms Sep 6, 2018
a665f46
Merge pull request #24668 from code-dot-org/staging
deploy-code-org Sep 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4 Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
google_drive (2.1.2)
google-api-client (>= 0.9.0, < 1.0.0)
google_drive (2.1.3)
google-api-client (>= 0.11.0, < 1.0.0)
googleauth (>= 0.5.0, < 1.0.0)
nokogiri (>= 1.5.3, < 2.0.0)
googleauth (0.5.1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
LabelOverrides as FacilitatorLabelOverrides,
NumberedQuestions
} from '@cdo/apps/generated/pd/facilitator1819ApplicationConstants';
import SendPrincipalApprovalButton from './send_principal_approval_button';

const TEACHER = 'Teacher';
const FACILITATOR = 'Facilitator';
Expand All @@ -27,12 +28,14 @@ const paneledQuestions = {

export default class DetailViewApplicationSpecificQuestions extends React.Component {
static propTypes = {
id: PropTypes.string,
formResponses: PropTypes.object.isRequired,
applicationType: PropTypes.oneOf([TEACHER, FACILITATOR]).isRequired,
editing: PropTypes.bool,
scores: PropTypes.object,
handleScoreChange: PropTypes.func,
applicationGuid: PropTypes.string
applicationGuid: PropTypes.string,
principalApprovalState: PropTypes.oneOf(['not_sent', 'sent', 'received'])
};

constructor(props) {
Expand Down Expand Up @@ -60,18 +63,31 @@ export default class DetailViewApplicationSpecificQuestions extends React.Compon
renderResponsesForSection(section) {
// Lame edge case but has to be done
if (section === 'detailViewPrincipalApproval' && !this.props.formResponses['principalApproval']) {
return (
<span>
<h4>
Not yet submitted
</h4>
if (this.props.principalApprovalState === 'not_sent') {
return (
<div>
<h4>
Not required - request not sent to principal
</h4>
<SendPrincipalApprovalButton
id={this.props.id}
/>
</div>
);
} else {
return (
<span>
Link to principal approval form: (<a href={`/pd/application/principal_approval/${this.props.applicationGuid}`} target="_blank">
{`http://studio.code.org/pd/application/principal_approval/${this.props.applicationGuid}`}
</a>)
<h4>
Not yet submitted
</h4>
<span>
Link to principal approval form: (<a href={`/pd/application/principal_approval/${this.props.applicationGuid}`} target="_blank">
{`http://studio.code.org/pd/application/principal_approval/${this.props.applicationGuid}`}
</a>)
</span>
</span>
</span>
);
);
}
} else {
return Object.keys(this.pageLabels[section]).map((question, j) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export class DetailViewContents extends React.Component {
application_guid: PropTypes.string,
registered_teachercon: PropTypes.bool,
registered_fit_weekend: PropTypes.bool,
attending_teachercon: PropTypes.bool
attending_teachercon: PropTypes.bool,
principal_approval_state: PropTypes.oneOf(['not_sent', 'sent', 'received'])
}).isRequired,
viewType: PropTypes.oneOf(['teacher', 'facilitator']).isRequired,
onUpdate: PropTypes.func,
Expand Down Expand Up @@ -636,12 +637,14 @@ export class DetailViewContents extends React.Component {
renderQuestions = () => {
return (
<DetailViewApplicationSpecificQuestions
id={this.props.applicationId}
formResponses={this.props.applicationData.form_data}
applicationType={this.props.applicationData.application_type}
editing={this.state.editing}
scores={this.state.response_scores}
handleScoreChange={this.handleScoreChange}
applicationGuid={this.props.applicationData.application_guid}
principalApprovalState={this.props.applicationData.principal_approval_state}
/>
);
};
Expand Down
29 changes: 19 additions & 10 deletions 29 apps/src/code-studio/pd/application_dashboard/quick_view_table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Button} from 'react-bootstrap';
import _, {orderBy} from 'lodash';
import { StatusColors } from './constants';
import wrappedSortable from '@cdo/apps/templates/tables/wrapped_sortable';
import SendPrincipalApprovalButton from './send_principal_approval_button';

const styles = {
table: {
Expand Down Expand Up @@ -179,10 +180,10 @@ export class QuickViewTable extends React.Component {
},{
property: 'id',
header: {
label: 'View Application',
label: 'Actions',
},
cell: {
format: this.formatViewButton
format: this.formatActionsCell
}
});

Expand Down Expand Up @@ -236,15 +237,23 @@ export class QuickViewTable extends React.Component {
);
};

formatViewButton = (id) => {
formatActionsCell = (id, props) => {
return (
<Button
bsSize="xsmall"
target="_blank"
href={this.context.router.createHref(`/${this.props.path}/${id}`)}
>
View Application
</Button>
<div>
<Button
bsSize="xsmall"
target="_blank"
href={this.context.router.createHref(`/${this.props.path}/${id}`)}
>
View Application
</Button>
<br/>
{
props['rowData']['principal_approval'] === 'No approval sent' && (
<SendPrincipalApprovalButton id={id}/>
)
}
</div>
);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, {PropTypes} from 'react';
import Spinner from '../components/spinner.jsx';
import $ from 'jquery';
import {Button} from 'react-bootstrap';

export default class SendPrincipalApprovalButton extends React.Component {
static propTypes = {
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
};

constructor(props) {
super(props);

this.state = {
requestSending: false,
requestSent: false
};
}

sendPrincipalApproval = () => {
this.setState({
requestSending: true
});

$.ajax({
method: 'POST',
url: `/api/v1/pd/application/resend_principal_approval/${this.props.id}`
}).done(data => {
this.setState({
requestSent: true
});
});
};

render() {
if (this.state.requestSent) {
return (
<span>
Email sent!
</span>
);
} else if (this.state.requestSending) {
return (<Spinner size="small"/>);
} else {
return (
<Button
bsSize="xsmall"
target="_blank"
onClick={this.sendPrincipalApproval}
>
Send email to principal
</Button>
);
}
}
}
8 changes: 6 additions & 2 deletions 8 apps/src/code-studio/pd/components/spinner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
* Loading spinner.
*/

import React from 'react';
import React, {PropTypes} from 'react';
import FontAwesome from '@cdo/apps/templates/FontAwesome';

export default class Spinner extends React.Component {
static propTypes = {
size: PropTypes.oneOf(['small', 'large'])
};

render() {
return <FontAwesome icon="spinner" className="fa-pulse fa-3x"/>;
return <FontAwesome icon="spinner" className={`fa-pulse ${this.props.size !== 'small' ? 'fa-3x' : ''}`}/>;
}
}
2 changes: 1 addition & 1 deletion 2 apps/src/sites/studio/pages/projects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $(document).ready(() => {
ReactDOM.render(
<Provider store={store}>
<PublicGallery
projectValidator={projectsData.projectValidator}
limitedGallery={projectsData.limitedGallery}
/>
</Provider>,
publicGallery);
Expand Down
13 changes: 6 additions & 7 deletions 13 apps/src/templates/projects/ProjectCardGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class ProjectCardGrid extends Component {
}).isRequired,
galleryType: PropTypes.oneOf(['personal', 'public']).isRequired,
selectedGallery: PropTypes.string.isRequired,
// Project Validators need access to view more links for App Lab and Game Lab, hidden for everyone else.
// TODO: Erin B - remove when we have profanity filter and/or enough featured projects.
projectValidator: PropTypes.bool
// Controls hiding/showing view more links for App Lab and Game Lab.
limitedGallery: PropTypes.bool
};

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -115,7 +114,7 @@ class ProjectCardGrid extends Component {
labKey="applab"
labName={i18n.projectTypeApplab()}
labViewMoreString={i18n.projectTypeApplabViewMore()}
hideViewMoreLink={!this.props.projectValidator}
hideViewMoreLink={this.props.limitedGallery}
projectList={projectLists.applab}
numProjectsToShow={numProjects}
galleryType={this.props.galleryType}
Expand All @@ -127,7 +126,7 @@ class ProjectCardGrid extends Component {
labKey="gamelab"
labName={i18n.projectTypeGamelab()}
labViewMoreString={i18n.projectTypeGamelabViewMore()}
hideViewMoreLink={!this.props.projectValidator}
hideViewMoreLink={this.props.limitedGallery}
projectList={projectLists.gamelab}
numProjectsToShow={numProjects}
galleryType={this.props.galleryType}
Expand Down Expand Up @@ -204,7 +203,7 @@ class ProjectCardGrid extends Component {
labKey="applab"
labName={i18n.projectTypeAllProjectsApplab()}
labViewMoreString={i18n.projectsViewAll()}
hideViewMoreLink={!this.props.projectValidator}
hideViewMoreLink={this.props.limitedGallery}
projectList={projectLists.applab}
numProjectsToShow={numProjects}
galleryType={this.props.galleryType}
Expand All @@ -217,7 +216,7 @@ class ProjectCardGrid extends Component {
labKey="gamelab"
labName={i18n.projectTypeAllProjectsGamelab()}
labViewMoreString={i18n.projectsViewAll()}
hideViewMoreLink={!this.props.projectValidator}
hideViewMoreLink={this.props.limitedGallery}
projectList={projectLists.gamelab}
numProjectsToShow={numProjects}
galleryType={this.props.galleryType}
Expand Down
7 changes: 3 additions & 4 deletions 7 apps/src/templates/projects/PublicGallery.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class PublicGallery extends Component {
artist: PropTypes.arrayOf(publishedProjectPropType),
minecraft: PropTypes.arrayOf(publishedProjectPropType),
}),
// Project Validators need access to view more links for App Lab and Game Lab, hidden for everyone else.
// TODO: Erin B - remove when we have profanity filter and/or enough featured projects.
projectValidator: PropTypes.bool
// Controls hiding/showing view more links for App Lab and Game Lab.
limitedGallery: PropTypes.bool
};

/**
Expand Down Expand Up @@ -70,7 +69,7 @@ class PublicGallery extends Component {
<ProjectCardGrid
projectLists={this.mapProjectData(projectLists)}
galleryType="public"
projectValidator={this.props.projectValidator}
limitedGallery={this.props.limitedGallery}
/>
<div style={styles.clear}/>
<div style={styles.linkBox}>
Expand Down
13 changes: 12 additions & 1 deletion 13 apps/style/code-studio/levelbuilder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,21 @@ table.checkboxes {
padding-top: 2%;
}
.audit_log{
width: 100%;

tr:nth-child(odd){
background-color: #f9cb81;
}

td{
padding: 5%;
padding: 2%;
}

.aud_date{
width: 25%;
}

.aud_person{
width: 43%;
}
}
1 change: 1 addition & 0 deletions 1 dashboard/app/controllers/admin_users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AdminUsersController < ApplicationController
RESTRICTED_USER_ATTRIBUTES_FOR_VIEW = %w(
users.id
email
primary_contact_info_id
name
user_type
current_sign_in_at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module Api::V1::Pd::Application
class PrincipalApprovalApplicationsController < Api::V1::Pd::FormsController
def new_form
@application = Pd::Application::PrincipalApproval1819Application.new(
# current_user may not exist but might as well record it
user: current_user,
@application = Pd::Application::PrincipalApproval1819Application.find_or_create_by(
application_guid: params.require(:application_guid)
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ def new_form
)
end

def resend_principal_approval
::Pd::Application::PrincipalApproval1819Application.create_placeholder_and_send_mail(
Pd::Application::Teacher1819Application.find(params[:id])
)
end

protected

def on_successful_create
Expand All @@ -16,7 +22,10 @@ def on_successful_create
@application.update_user_school_info!

::Pd::Application::Teacher1819ApplicationMailer.confirmation(@application).deliver_now
::Pd::Application::Teacher1819ApplicationMailer.principal_approval(@application).deliver_now

unless @application.regional_partner&.principal_approval == RegionalPartner::SELECTIVE_APPROVAL
::Pd::Application::PrincipalApproval1819Application.create_placeholder_and_send_mail(@application)
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ def new
principal_email: application_hash[:principal_email]
}

if Pd::Application::PrincipalApproval1819Application.exists?(application_guid: params[:application_guid])
# Return submitted if the approval exists and is not a placeholder
# Rather annoyingly, we can't say "unless existing_approval&.placeholder?" because
# if there is no approval, (handling legacy case and proper fallback behavior
# in case we fail to create placeholders) we'd be rendering submitted
existing_approval = Pd::Application::PrincipalApproval1819Application.find_by(application_guid: params[:application_guid])
if existing_approval && !existing_approval.placeholder?
return render :submitted
end

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.