Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Updated elevated session prompts to use the modern control panel frontend while preserving the legacy JavaScript APIs.
- Login attempts are now rate limited.
- Added `Illuminate\Contracts\Translation\HasLocalePreference` support to user elements, allowing Laravel notifications to use users’ Language preferences. ([#19228](https://github.com/craftcms/cms/pull/19228))
- Fixed a bug where site routes weren't being registered for each localized site value.
- Fixed a bug where POST requests to the `loginPath` weren’t being handled properly. ([#19220](https://github.com/craftcms/cms/pull/19220))
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"build": [
"@php vendor/bin/testbench package:create-sqlite-db --ansi",
"@php vendor/bin/testbench workbench:build --ansi"
],
"serve": [
"Composer\\Config::disableProcessTimeout",
"@php vendor/bin/testbench package:sync-skeleton --ansi",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dev:cp": "cd ./packages/craftcms-cp && npm run dev",
"build:cp": "cd ./packages/craftcms-cp && npm run build",
"build:garnish": "cd ./packages/craftcms-garnish && npm run build",
"test": "vitest run",
"test:cp": "cd ./packages/craftcms-cp && npm run test",
"storybook": "storybook dev -p 6007",
"build:storybook": "storybook build",
Expand Down
2 changes: 0 additions & 2 deletions packages/craftcms-legacy/cp/src/Craft.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ import './js/ElementDeletionManager.js';
import './js/ElementEditor.js';
import './js/ElementFieldSettings.js';
import './js/ElementTableSorter.js';
import './js/ElevatedSessionForm.js';
import './js/ElevatedSessionManager.js';
import './js/EntryIndex.js';
import './js/EntrySelectInput.js';
import './js/EntryTypeSelectInput.js';
Expand Down
15 changes: 0 additions & 15 deletions packages/craftcms-legacy/cp/src/css/_cp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1577,21 +1577,6 @@ li.breadcrumb-toggle-wrapper {
}
}

/* grids */
.grid {
position: relative;
min-height: 1px; // Required for Grid.js to run

&::after {
@include mixins.clearafter;
}

& > .item {
display: none;
box-sizing: border-box;
}
}

%type-heading-small {
text-transform: uppercase;
color: var(--medium-text-color);
Expand Down
106 changes: 0 additions & 106 deletions packages/craftcms-legacy/cp/src/js/ElevatedSessionForm.js

This file was deleted.

124 changes: 0 additions & 124 deletions packages/craftcms-legacy/cp/src/js/ElevatedSessionManager.js

This file was deleted.

2 changes: 1 addition & 1 deletion resources/js/common/components/Pane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<slot name="header" v-if="showHeader">
<div class="cp-pane__header">
<slot name="title">
<h1 v-if="title" class="text-lg">
<h1 v-if="title" class="text-lg m-0!">
{{ title }}
</h1>
</slot>
Expand Down
2 changes: 2 additions & 0 deletions resources/js/common/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import SystemInfo from '@/common/components/SystemInfo.vue';
import UserMenu from '@/common/components/UserMenu.vue';
import ErrorSummary from '@/common/form/ErrorSummary.vue';
import ElevatedSessionHost from '@/modules/auth/elevated-session/ElevatedSessionHost.vue';
import {useActionRedirect} from '@/common/composables/useActionRedirect';
import {useAnnouncer} from '@/common/composables/useAnnouncer';
import {useAppendHtml} from '@/common/composables/useAppendHtml';
Expand Down Expand Up @@ -396,6 +397,7 @@
</div>

<DebugPanel v-if="debug" :data="debug" />
<ElevatedSessionHost />
</template>

<style scoped lang="css">
Expand Down
13 changes: 12 additions & 1 deletion resources/js/common/types/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ interface CraftStatic {
IntervalManager: IntervalManagerInterface;
t(message: string, params?: object, category?: string): string;
sendActionRequest(method: string, action: string, options?: object): Promise;
initUiElements($container: JQuery): void;
initUiElements(container: Element | JQuery): void;
createElementSelectorModal(
elementType: string,
settings?: ElementSelectorModalSettings
Expand Down Expand Up @@ -150,6 +150,17 @@ interface CraftStatic {
FieldLayoutDesigner: {
new (container: any, settings?: object): FieldLayoutDesignerInstance;
};
ElevatedSessionForm: {
new (form: any, inputs?: string | string[]): unknown;
};
elevatedSessionManager: {
fetchingTimeout: boolean;
requireElevatedSession(
onSuccess: () => void,
onCancel?: () => void,
minSafeElevatedSessionTimeout?: number
): void | Promise<void>;
};
}

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
Expand Down
1 change: 1 addition & 0 deletions resources/js/cp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import './modules/navigation/components/cp-queue-indicator.js';
*/
import './modules/sortable-checkbox-select';
import './modules/listbox';
import './modules/auth/elevated-session';
import './modules/field-layout-designer';
import './modules/editable-table';
import './modules/generated-fields';
Expand Down
3 changes: 3 additions & 0 deletions resources/js/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './modules/auth/components/set-password/set-password-form.js';
import './modules/auth/components/verify-email/verify-email-form.js';
import './modules/auth/components/totp/totp-form.js';
import './modules/auth/components/recovery-codes/recovery-code-form.js';
import {mountElevatedSessionHost} from './modules/auth/elevated-session';

import './modules/listbox/index';
import './modules/field-layout-designer/index';
Expand All @@ -17,6 +18,8 @@ const {default: Cp} = await import('./bootstrap/cp.js');

window.Cp = Cp;

mountElevatedSessionHost();

/**
* Components - dynamically imported after Craft is initialized
*/
Expand Down
10 changes: 10 additions & 0 deletions resources/js/modules/auth/components/login/login-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ export default class CraftLoginForm extends LitElement {
}
}

override focus(options?: FocusOptions): void {
void this.updateComplete.then(() => {
const input = this.staticEmail
? this._passwordInput
: (this._usernameInput ?? this._passwordInput);

input?.focus(options);
});
}

#usernameLabel() {
return this.useEmailAsUsername ? t('Email') : t('Username or Email');
}
Expand Down
Loading
Loading