colocate misc specs (18)

Change-Id: Ifefe806a6e75ef142aa93dcce905f557a4a1f3bd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349546
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Derek Williams <derek.williams@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
This commit is contained in:
Aaron Shafovaloff 2024-06-07 08:11:12 -06:00
parent 76d447f2f5
commit 07e68f29e9
44 changed files with 71 additions and 39 deletions

View File

@ -0,0 +1,6 @@
{
"name": "date-js",
"version": "1.0.0",
"main": "parser.js",
"private": true
}

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export * from '@instructure/date-js'

View File

@ -1,5 +1,5 @@
{
"name": "date-js",
"name": "@instructure/date-js",
"version": "1.0.0",
"main": "parser.js",
"private": true

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import tooltip from '../../../ui/boot/initializers/activateTooltips'
import tooltip from '@canvas/common/activateTooltips'
QUnit.module('tooltip')

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'date-js'
import '@instructure/date-js'
QUnit.module('Date')
@ -131,7 +131,7 @@ test('date.add* at DST-end', () => {
test('date.set at DST-end', () => {
const date = new Date(2012, 10, 4, 0, 0, 0)
date.set({hour: 14})
ok(date.getHours() === 14)
strictEqual(date.getHours(), 14)
date.set({hour: 1})
ok(date.getHours() === 1)
strictEqual(date.getHours(), 1)
})

View File

@ -36,7 +36,7 @@ import I18nStubber from 'helpers/I18nStubber'
import fakeENV from 'helpers/fakeENV'
import assertions from 'helpers/assertions'
import '@canvas/jquery/jquery.simulate'
import '../../../../ui/boot/initializers/activateTooltips'
import '@canvas/common/activateTooltips'
function buildAssignment1() {
const date1 = {

View File

@ -28,7 +28,7 @@ import {up as configureDateTimeMomentParser} from '@canvas/datetime/configureDat
import {up as configureDateTime} from '@canvas/datetime/configureDateTime'
import {initSentry} from './initializers/initSentry'
import {up as renderRailsFlashNotifications} from './initializers/renderRailsFlashNotifications'
import {up as activateCourseMenuToggler} from './initializers/activateCourseMenuToggler'
import {up as activateCourseMenuToggler} from '@canvas/common/activateCourseMenuToggler'
// Import is required, workaround for ARC-8398
// eslint-disable-next-line import/no-nodejs-modules

View File

@ -27,14 +27,14 @@ import 'jquery-migrate'
// modules that do their own thing on every page that simply need to be required
import './addBrowserClasses'
import '@canvas/media-comments'
import './activateReminderControls'
import '@canvas/common/activateReminderControls'
import './expandAdminLinkMenusOnClick'
import './activateElementToggler'
import '@canvas/common/activateElementToggler'
import './toggleICSuperToggleWidgetsOnEnterKeyEvent'
import './loadInlineMediaComments'
import './ping'
import './markBrokenImages'
import './activateLtiThumbnailLauncher'
import '@canvas/common/markBrokenImages'
import '@canvas/common/activateLtiThumbnailLauncher'
import './sanitizeCSSOverflow'
if (ENV.page_view_update_url) {

View File

@ -30,7 +30,7 @@ import '@canvas/jquery/jquery.instructure_forms' // formSubmit, getFormData, val
import '@canvas/jquery/jquery.instructure_misc_helpers' // replaceTags
import '@canvas/jquery/jquery.instructure_misc_plugins' // confirmDelete, showIf, /\.log/
import '@canvas/loading-image'
import 'date-js' // Date.parse
import '@instructure/date-js' // Date.parse
import 'jquery-scroll-to-visible/jquery.scrollTo'
import {renderDatetimeField} from '@canvas/datetime/jquery/DatetimeField'

View File

@ -55,7 +55,7 @@ import setUsageRights from '@canvas/files/util/setUsageRights'
import 'jqueryui/dialog'
import '@canvas/jquery/jquery.toJSON'
import '@canvas/rails-flash-notifications'
import '../../../../boot/initializers/activateTooltips'
import '@canvas/common/activateTooltips'
import {AnnotatedDocumentSelector} from '../../react/EditAssignment'
import {selectContentDialog} from '@canvas/select-content-dialog'
import {addDeepLinkingListener} from '@canvas/deep-linking/DeepLinking'

View File

@ -23,7 +23,7 @@ import AssignmentGroupListView from '../AssignmentGroupListView'
import $ from 'jquery'
import 'jquery-migrate'
import fakeENV from 'helpers/fakeENV'
import elementToggler from '../../../../../boot/initializers/activateElementToggler'
import elementToggler from '@canvas/common/activateElementToggler'
const assignment1 = function () {
const date1 = {

View File

@ -24,7 +24,7 @@ import editPlannerNoteTemplate from '../../jst/editPlannerNote.handlebars'
import datePickerFormat from '@instructure/moment-utils/datePickerFormat'
import '@canvas/jquery/jquery.instructure_forms'
import '@canvas/jquery/jquery.instructure_misc_helpers'
import 'date-js'
import '@instructure/date-js'
import fcUtil from '@canvas/calendar/jquery/fcUtil'
import commonEventFactory from '@canvas/calendar/jquery/CommonEvent/index'
import ValidatedFormView from '@canvas/forms/backbone/views/ValidatedFormView'

View File

@ -23,7 +23,7 @@ import editToDoItemTemplate from '../../jst/editToDoItem.handlebars'
import datePickerFormat from '@instructure/moment-utils/datePickerFormat'
import '@canvas/jquery/jquery.instructure_forms'
import '@canvas/jquery/jquery.instructure_misc_helpers'
import 'date-js'
import '@instructure/date-js'
import fcUtil from '@canvas/calendar/jquery/fcUtil'
import ValidatedFormView from '@canvas/forms/backbone/views/ValidatedFormView'
import '../../fcMomentHandlebarsHelpers'

View File

@ -21,7 +21,7 @@ import {useScope as useI18nScope} from '@canvas/i18n'
import TimeBlockListManager from '@canvas/calendar/TimeBlockListManager'
import TimeBlockRow from './TimeBlockRow'
import '@canvas/jquery/jquery.instructure_forms'
import 'date-js'
import '@instructure/date-js'
const I18n = useI18nScope('calendar')

View File

@ -20,8 +20,7 @@ import $ from 'jquery'
import ready from '@instructure/ready'
import CollaborationsPage from './backbone/views/CollaborationsPage'
import './jquery/index'
// eslint-disable-next-line import/extensions
import '../../boot/initializers/activateKeyClicks.js'
import '@canvas/common/activateKeyClicks'
ready(() => {
const page = new CollaborationsPage({el: $('body')})

View File

@ -31,7 +31,7 @@ import '@canvas/jquery/jquery.instructure_misc_helpers' /* replaceTags */
import '@canvas/jquery/jquery.instructure_misc_plugins' /* showIf */
import '@canvas/rails-flash-notifications'
import '@canvas/util/templateData' /* fillTemplateData */
import 'date-js'
import '@instructure/date-js'
import replaceTags from '@canvas/util/replaceTags'
const I18n = useI18nScope('quizzes.moderate')

View File

@ -18,7 +18,7 @@
import {useScope as useI18nScope} from '@canvas/i18n'
import $ from 'jquery'
import 'date-js'
import '@instructure/date-js'
const I18n = useI18nScope('quizzes.timing')
/* Date.parse */

View File

@ -39,10 +39,10 @@ import pluginBundles from 'plugin-bundles-generated'
// so they have to be ran before any other app code runs.
import '@canvas/jquery/jquery.ajaxJSON'
import '@canvas/jquery/jquery.instructure_forms'
import './boot/initializers/ajax_errors'
import './boot/initializers/activateKeyClicks'
import './boot/initializers/activateTooltips'
import './boot/initializers/injectAuthTokenIntoForms'
import '@canvas/common/ajax_errors'
import '@canvas/common/activateKeyClicks'
import '@canvas/common/activateTooltips'
import '@canvas/common/injectAuthTokenIntoForms'
interface CustomWindow extends Window {
bundles: string[]
@ -218,7 +218,7 @@ if (ENV.badge_counts) {
async function openHelpDialog(event: Event): Promise<void> {
event.preventDefault()
try {
const {default: helpDialog} = await import('./boot/initializers/enableHelpDialog')
const {default: helpDialog} = await import('@canvas/common/enableHelpDialog')
helpDialog.open()
} catch (e) {
/* eslint-disable no-console */

View File

@ -18,7 +18,7 @@
import $ from 'jquery'
import 'jquery-migrate'
import '../../../ui/boot/initializers/activateElementToggler'
import '../activateElementToggler'
QUnit.module('elementToggler', {
teardown() {

View File

@ -18,7 +18,7 @@
import $ from 'jquery'
import 'jquery-migrate'
import helpDialog from '../../ui/boot/initializers/enableHelpDialog'
import helpDialog from '../enableHelpDialog'
import fakeENV from 'helpers/fakeENV'
import 'jquery-tinypubsub'

View File

@ -0,0 +1,6 @@
{
"name": "@canvas/common",
"private": true,
"version": "1.0.0",
"author": "neme"
}

View File

@ -50,7 +50,7 @@ import '@canvas/jquery/jquery.simulate'
import '@canvas/jquery-keycodes'
import '@canvas/loading-image'
import '@canvas/util/templateData' /* fillTemplateData, getTemplateData */
import 'date-js' /* Date.parse */
import '@instructure/date-js' /* Date.parse */
import 'jqueryui/sortable'
import '@canvas/rails-flash-notifications'
import DirectShareCourseTray from '@canvas/direct-sharing/react/components/DirectShareCourseTray'

View File

@ -34,9 +34,9 @@ import {
sameYear,
timeString,
unfudgeDateForProfileTimezone,
} from '@canvas/datetime/date-functions'
import {getI18nFormats} from '@canvas/datetime/configureDateTime'
import '@canvas/datetime/jquery/datepicker'
} from '../date-functions'
import {getI18nFormats} from '../configureDateTime'
import '../jquery/datepicker'
QUnit.module('fudgeDateForProfileTimezone', {
setup() {

View File

@ -38,7 +38,7 @@ import '@canvas/rails-flash-notifications'
import '@canvas/util/templateData'
import '@canvas/util/jquery/fixDialogButtons'
import '@canvas/media-comments/jquery/mediaCommentThumbnail'
import 'date-js'
import '@instructure/date-js'
import 'jquery-tinypubsub' /* /\.publish\(/ */
import 'jqueryui/resizable'
import 'jqueryui/sortable'

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Handlebars from '@canvas/handlebars-helpers'
import Handlebars from '..'
import $ from 'jquery'
import 'jquery-migrate'
import _ from 'lodash'

View File

@ -19,7 +19,7 @@
// note: most of these tests are now redundant w/ i18nliner-js, leaving them
// for a little bit though
import I18n, {useScope} from '@canvas/i18n'
import I18n, {useScope} from '..'
import I18nStubber from 'helpers/I18nStubber'
import {raw} from '@instructure/html-escape'

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'date-js'
import '@instructure/date-js'
import i18nLolcalize from './i18nLolcalize'
import I18n from 'i18n-js'
import {

View File

@ -18,7 +18,7 @@
import $ from 'jquery'
import 'jquery-migrate'
import '@canvas/jquery/jquery.toJSON'
import '../jquery.toJSON'
// TODO: share code with 'unflatten' module

View File

@ -16,8 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable qunit/no-ok-equality */
import jQuery from 'jquery'
import '@canvas/jquery/jquery.instructure_misc_plugins'
import '../jquery.instructure_misc_plugins'
const $ = jQuery

View File

@ -16,7 +16,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QuizRubric from '@canvas/quizzes/jquery/quiz_rubric'
import QuizRubric from '../quiz_rubric'
import $ from 'jquery'
import 'jquery-migrate'