{"size": 3115, "ext": "js", "max_stars_repo_path": "src/components/widget/d2l-teacher-course-creation-success.js", "max_stars_repo_name": "brightspace-bot/custom-teacher-course-creation", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/widget/d2l-teacher-course-creation-success.js", "max_issues_repo_name": "brightspace-bot/custom-teacher-course-creation", "max_issues_repo_issues_event_min_datetime": "2020-07-15T17:09:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-21T13:23:06.000Z", "max_forks_repo_path": "src/components/widget/d2l-teacher-course-creation-success.js", "max_forks_repo_name": "brightspace-bot/custom-teacher-course-creation", "max_forks_repo_forks_event_min_datetime": "2020-09-24T19:30:40.000Z", "max_forks_repo_forks_event_max_datetime": "2020-09-24T19:30:40.000Z"}
{"max_stars_count": null, "max_issues_count": 78, "max_forks_count": 1, "avg_line_length": 24.7222222222, "max_line_length": 103, "alphanum_fraction": 0.677046549}
import '@brightspace-ui/core/components/link/link.js';
import '@brightspace-ui/core/components/icons/icon.js';
import '@brightspace-ui/core/components/colors/colors.js';
import { bodySmallStyles, heading2Styles } from '@brightspace-ui/core/components/typography/styles.js';
import { css, html, LitElement } from 'lit-element/lit-element';
import { BaseMixin } from '../../mixins/base-mixin';
import { PAGES } from '../../constants';
import { TccServiceFactory } from '../../services/tccServiceFactory';

class TeacherCourseCreationSuccess extends BaseMixin(LitElement) {

	static get properties() {
		return {
			pageData: {
				type: Object
			},
			courseOrgUnitId: {
				type: String
			}
		};
	}

	static get styles() {
		return [heading2Styles, bodySmallStyles, css`
			:host {
				display: inline-block;
			}
			:host([hidden]) {
				display: none;
			}
			.tcc-success__title-container {
				display: flex;
				flex-direction: row;
				align-items: baseline;
			}
			.tcc-success__title-icon {
				margin: 12px;
				color: var(--d2l-color-feedback-success);
				flex-shrink: 0;
			}
			.tcc-success__links-container {
				display: flex;
				flex-direction: column;
				margin-bottom: 12px;
				border: 2px solid var(--d2l-color-gypsum);
				background-color: var(--d2l-color-sylvite);
				border-radius: 6px;
    			padding: 12px;
			}
			.tcc-success__text {
				margin-bottom: 30px;
			}
		`];
	}

	constructor() {
		super();

		this.tccService = TccServiceFactory.getTccService();
	}

	connectedCallback() {
		super.connectedCallback();

		if (this.pageData && this.pageData.courseOrgUnitId) {
			this.courseOrgUnitId = this.pageData.courseOrgUnitId;
		}
	}

	_donePressed() {
		this.changePage(PAGES.WELCOME_PAGE);
	}

	_anotherCoursePressed() {
		this.changePage(PAGES.INPUT_PAGE);
	}

	_getCourseEnrollHref(orgUnitId) {
		return `/d2l/lms/classlist/classlist.d2l?ou=${orgUnitId}`;
	}

	_getCourseHomepageHref(orgUnitId) {
		return `/d2l/home/${orgUnitId}`;
	}

	render() {
		return html`
			<div class="tcc-success__title-container">
				<d2l-icon
					class="tcc-success__title-icon"
					icon="tier2:check-circle">
				</d2l-icon>
				<h1 class="d2l-heading-2">${this.localize('successTitleText')}</h1>
			</div>

			<div class="tcc-success__links-container">
				<d2l-link
					href=${this._getCourseEnrollHref(this.courseOrgUnitId)}>
					${this.localize('successLinkEnrollStudents')}
				</d2l-link>
				<d2l-link
					href=${this._getCourseHomepageHref(this.courseOrgUnitId)}>
					${this.localize('successLinkCourseHomepage')}
				</d2l-link>
				<d2l-link
					class="tcc-success__another-course-link"
					@click=${this._anotherCoursePressed}>
					${this.localize('successLinkCreateCourse')}
				</d2l-link>
			</div>

			<div class="d2l-body-small tcc-success__text">
				${this.localize('successResultText')}
			</div>

			<d2l-button
				description=${this.localize('successDoneButtonDescription')}
				@click=${this._donePressed}
				primary>
				${this.localize('successDoneButtonText')}
			</d2l-button>
		`;
	}
}
customElements.define('d2l-tcc-success', TeacherCourseCreationSuccess);
