How to use @webiny/app-admin - 10 common examples

To help you get started, we’ve selected a few @webiny/app-admin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / app-page-builder / src / editor / components / OEmbed.js View on Github external
const centerAlign = css({
    "*:first-child": {
        marginLeft: "auto !important",
        marginRight: "auto !important"
    }
});

export default compose(
    shouldUpdate((props, nextProps) => {
        return !isEqual(props, nextProps);
    }),
    connect(
        null,
        { updateElement }
    ),
    withSnackbar(),
    graphql(oembedQuery, {
        skip: ({ element }) => {
            const source = get(element, "data.source") || {};
            const oembed = get(element, "data.oembed") || {};

            return !source.url || isEqual(oembed.source, source);
        },
        options: ({ element, updateElement, showSnackbar, onData = d => d }) => {
            const source = get(element, "data.source") || {};
            return {
                variables: source,
                onCompleted: data => {
                    const { data: oembed, error } = get(data, "pageBuilder.oembedData");
                    if (oembed) {
                        // Store loaded oembed data
                        updateElement({
github webiny / webiny-js / packages / app-page-builder / src / admin / plugins / pageDetails / utils / usePublishRevisionHandler.js View on Github external
export function usePublishRevisionHandler({ page }) {
    const client = useApolloClient();
    const { showSnackbar } = useSnackbar();

    const publishRevision = async revision => {
        const { data: res } = await client.mutate({
            mutation: PUBLISH_REVISION,
            variables: { id: revision.id },
            refetchQueries: ["PbListPages"],
            update: (cache, { data }) => {
                // Don't do anything if there was an error during publishing!
                if (data.pageBuilder.publishRevision.error) {
                    return;
                }

                const getPageQuery = GET_PAGE();

                // Update revisions
                const pageFromCache = cache.readQuery({
github webiny / webiny-js / packages / app-admin / src / plugins / index.js View on Github external
import DarkMode from "@webiny/app-admin/plugins/UserMenu/plugins/DarkMode";
import DefaultHandle from "@webiny/app-admin/plugins/UserMenu/plugins/DefaultHandle";
import Help from "@webiny/app-admin/plugins/UserMenu/plugins/Help";
import SendFeedback from "@webiny/app-admin/plugins/UserMenu/plugins/Feedback";
import install from "@webiny/app-admin/plugins/install";

import init from "./init";

export default [
    // Layout plugins
    Header,
    Content,
    snackbar("layout"),
    snackbar("empty-layout"),
    dialog("layout"),
    dialog("empty-layout"),
    Footer,
    // Header plugins
    Menu,
    Logo,
    FileManager,
    UserMenu,
    globalSearch,
    globalSearchHotkey,
    DarkMode,
    DefaultHandle,
    Help,
    SendFeedback,
    install,
    ...init
];
github webiny / webiny-js / packages / app-admin / src / plugins / index.js View on Github external
// User menu plugins
import DarkMode from "@webiny/app-admin/plugins/UserMenu/plugins/DarkMode";
import DefaultHandle from "@webiny/app-admin/plugins/UserMenu/plugins/DefaultHandle";
import Help from "@webiny/app-admin/plugins/UserMenu/plugins/Help";
import SendFeedback from "@webiny/app-admin/plugins/UserMenu/plugins/Feedback";
import install from "@webiny/app-admin/plugins/install";

import init from "./init";

export default [
    // Layout plugins
    Header,
    Content,
    snackbar("layout"),
    snackbar("empty-layout"),
    dialog("layout"),
    dialog("empty-layout"),
    Footer,
    // Header plugins
    Menu,
    Logo,
    FileManager,
    UserMenu,
    globalSearch,
    globalSearchHotkey,
    DarkMode,
    DefaultHandle,
    Help,
    SendFeedback,
    install,
    ...init
];
github webiny / webiny-js / packages / app-admin / src / plugins / index.js View on Github external
// User menu plugins
import DarkMode from "@webiny/app-admin/plugins/UserMenu/plugins/DarkMode";
import DefaultHandle from "@webiny/app-admin/plugins/UserMenu/plugins/DefaultHandle";
import Help from "@webiny/app-admin/plugins/UserMenu/plugins/Help";
import SendFeedback from "@webiny/app-admin/plugins/UserMenu/plugins/Feedback";
import install from "@webiny/app-admin/plugins/install";

import init from "./init";

export default [
    // Layout plugins
    Header,
    Content,
    snackbar("layout"),
    snackbar("empty-layout"),
    dialog("layout"),
    dialog("empty-layout"),
    Footer,
    // Header plugins
    Menu,
    Logo,
    FileManager,
    UserMenu,
    globalSearch,
    globalSearchHotkey,
    DarkMode,
    DefaultHandle,
    Help,
    SendFeedback,
    install,
    ...init
github webiny / webiny-js / packages / app-admin / src / plugins / index.js View on Github external
import { globalSearch, globalSearchHotkey } from "@webiny/app-admin/plugins/GlobalSearch";

// User menu plugins
import DarkMode from "@webiny/app-admin/plugins/UserMenu/plugins/DarkMode";
import DefaultHandle from "@webiny/app-admin/plugins/UserMenu/plugins/DefaultHandle";
import Help from "@webiny/app-admin/plugins/UserMenu/plugins/Help";
import SendFeedback from "@webiny/app-admin/plugins/UserMenu/plugins/Feedback";
import install from "@webiny/app-admin/plugins/install";

import init from "./init";

export default [
    // Layout plugins
    Header,
    Content,
    snackbar("layout"),
    snackbar("empty-layout"),
    dialog("layout"),
    dialog("empty-layout"),
    Footer,
    // Header plugins
    Menu,
    Logo,
    FileManager,
    UserMenu,
    globalSearch,
    globalSearchHotkey,
    DarkMode,
    DefaultHandle,
    Help,
    SendFeedback,
    install,
github webiny / webiny-js / packages / app-admin / src / components / FileManager / FileDetails / Tags.js View on Github external
) : (
                <div>No tags assigned.</div>
            )}
            <div>
                <a> setEdit(true)}&gt;
                     Edit
                </a>
            </div>
        
    );
}

export default compose(
    graphql(updateFileBySrc, { name: "gqlUpdateFileBySrc" }),
    withSnackbar()
)(Tags);
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / defaultBar / components / PublishPageButton.js View on Github external
)}
                
            )}
        
    );
};

export default compose(
    connect(
        state =&gt; ({ page: omit(getPage(state), ["content"]) }),
        null,
        null,
        { areStatePropsEqual: isEqual }
    ),
    withSnackbar(),
    withRouter
)(PublishPageButton);
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / defaultBar / components / PageSettings.js View on Github external
)}
                    
                
            
        
    );
};

export default compose(
    connect(
        state =&gt; ({ page: omit(getPage(state), ["content"]) }),
        { deactivatePlugin, updateRevision }
    ),
    withSnackbar(),
    withKeyHandler(),
    withState("active", "setActive", "pb-editor-page-settings-general"),
    withHandlers({
        savePage: ({ showSnackbar, updateRevision }) =&gt; (page: Object) =&gt;
            updateRevision(page, {
                onFinish: () =&gt; showSnackbar("Settings saved")
            })
    }),
    lifecycle({
        componentDidMount() {
            this.props.addKeyHandler("escape", e =&gt; {
                e.preventDefault();
                this.props.deactivatePlugin({ name: "pb-editor-page-settings-bar" });
            });
        },
        componentWillUnmount() {
github webiny / webiny-js / packages / app-admin / src / components / FileManager / FileDetails / Name.js View on Github external
function Name({ file }: *) {
    const [editing, setEdit] = useState(false);
    const name = file.name || "";

    const { showSnackbar } = useSnackbar();
    const client = useApolloClient();

    const { queryParams } = useFileManager();

    if (editing) {
        return (
            <form name=""> {
                    setEdit(false);
                    await client.mutate({
                        mutation: UPDATE_FILE,
                        variables: {
                            id: file.id,</form>

@webiny/app-admin

A collection of plugins that together form a complete admin interface, customizable and extensible with Webiny apps and plugins.

MIT
Latest version published 2 days ago

Package Health Score

78 / 100
Full package analysis

Similar packages