- ${crumb.name}
+
+
${crumb.name}
+ ${this.renderConfig(this._breadcrumbs.length, crumb, idx)}
+
`)}
diff --git a/blocks/browse/da-browse/img/Smock_Settings_18_N.svg b/blocks/browse/da-browse/img/Smock_Settings_18_N.svg
new file mode 100644
index 00000000..f49c4eb2
--- /dev/null
+++ b/blocks/browse/da-browse/img/Smock_Settings_18_N.svg
@@ -0,0 +1,6 @@
+
diff --git a/blocks/browse/da-orgs/da-orgs.js b/blocks/browse/da-orgs/da-orgs.js
index 154fd217..b624db6b 100644
--- a/blocks/browse/da-orgs/da-orgs.js
+++ b/blocks/browse/da-orgs/da-orgs.js
@@ -1,10 +1,11 @@
import { LitElement, html } from '../../../deps/lit/lit-core.min.js';
-import { DA_ORIGIN } from '../../shared/constants.js';
+import { getDaAdmin } from '../../shared/constants.js';
import { daFetch } from '../../shared/utils.js';
import getSheet from '../../shared/sheet.js';
const sheet = await getSheet('/blocks/browse/da-orgs/da-orgs.css');
+const DA_ORIGIN = getDaAdmin();
const MOCK_IMGS = [
'/blocks/browse/da-orgs/img/da-one.webp',
'/blocks/browse/da-orgs/img/da-two.webp',
diff --git a/blocks/edit/da-library/helpers/helpers.js b/blocks/edit/da-library/helpers/helpers.js
index 6ef7185f..ddc5292b 100644
--- a/blocks/edit/da-library/helpers/helpers.js
+++ b/blocks/edit/da-library/helpers/helpers.js
@@ -1,8 +1,9 @@
// eslint-disable-next-line import/no-unresolved
import { DOMParser } from 'da-y-wrapper';
-import { DA_ORIGIN, CON_ORIGIN } from '../../../shared/constants.js';
+import { CON_ORIGIN, getDaAdmin } from '../../../shared/constants.js';
import getPathDetails from '../../../shared/pathDetails.js';
+const DA_ORIGIN = getDaAdmin();
const REPLACE_CONTENT = '
';
const DA_CONFIG = '/.da/config.json';
diff --git a/blocks/edit/da-title/da-title.js b/blocks/edit/da-title/da-title.js
index 17a738a9..c96125e1 100644
--- a/blocks/edit/da-title/da-title.js
+++ b/blocks/edit/da-title/da-title.js
@@ -1,5 +1,5 @@
import { LitElement, html } from '../../../deps/lit/lit-core.min.js';
-import { saveToDa, saveToAem } from '../utils/helpers.js';
+import { saveToDa, saveToAem, saveDaConfig } from '../utils/helpers.js';
import getSheet from '../../shared/sheet.js';
const sheet = await getSheet('/blocks/edit/da-title/da-title.css');
@@ -23,29 +23,53 @@ export default class DaTitle extends LitElement {
const { hash } = window.location;
const pathname = hash.replace('#', '');
- // Only save to da if it is a sheet
- if (this.sheet) {
+ // Only save to DA if it is a sheet or config
+ if (this.details.view === 'sheet') {
const dasSave = await saveToDa(pathname, this.sheet);
if (!dasSave.ok) return;
}
- const aemPath = this.sheet ? `${pathname}.json` : pathname;
- let json = await saveToAem(aemPath, 'preview');
- if (action === 'publish') json = await saveToAem(aemPath, 'live');
- const { url } = action === 'publish' ? json.live : json.preview;
- window.open(url, '_blank');
+ if (this.details.view === 'config') {
+ const daConfigResp = await saveDaConfig(pathname, this.sheet);
+ if (!daConfigResp.ok) return;
+ }
+ if (action === 'preview' || action === 'publish') {
+ const aemPath = this.sheet ? `${pathname}.json` : pathname;
+ let json = await saveToAem(aemPath, 'preview');
+ if (action === 'publish') json = await saveToAem(aemPath, 'live');
+ const { url } = action === 'publish' ? json.live : json.preview;
+ window.open(url, '_blank');
+ }
sendBtn.classList.remove('is-sending');
}
- handlePreview() {
- this.handleAction('preview');
+ toggleActions() {
+ this._actionsVis = !this._actionsVis;
}
- handlePublish() {
- this.handleAction('publish');
+ renderSave() {
+ return html`
+ `;
}
- toggleActions() {
- this._actionsVis = !this._actionsVis;
+ renderAemActions() {
+ return html`
+
+ `;
}
render() {
@@ -59,18 +83,7 @@ export default class DaTitle extends LitElement {
${this.details.name}
-
-
+ ${this.details.view === 'config' ? this.renderSave() : this.renderAemActions()}