Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PEP-1194]: allow editors to view a preview of publish URL when scheduling. #1563

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e456bf7
add the span for url
Jun 16, 2023
d25f306
prepublish element on page drawer
james-owen Jun 16, 2023
66f4b4b
add publish url preview
Jun 21, 2023
265e2e0
add publish url preview and linter complaints
Jun 21, 2023
b998105
add dist files
Jun 21, 2023
50fe800
remove dist folder for dev release
Jun 21, 2023
27a045a
remove dist again
Jun 21, 2023
b089c96
revert changes
Jun 21, 2023
f400da0
remove empty line
james-owen Jun 21, 2023
1124bd8
10.2.2-dev.0
james-owen Jun 21, 2023
d0ee082
add hidden class
Jun 21, 2023
4343ecf
Merge branch 'ss-publish-url-preview-4' of github.com:clay/clay-kiln …
Jun 21, 2023
68f1bd5
10.2.2-dev.1
james-owen Jun 21, 2023
5556584
Merge branch 'master' of github.com:clay/clay-kiln into ss-publish-ur…
jjpaulino Jun 26, 2023
f2b5137
remove -p
Jun 26, 2023
edddbc3
10.2.2-dev.2
Jun 26, 2023
45d4b49
10.2.2-dev.3
Jun 26, 2023
84ae6f5
10.2.2-dev.4
Jun 26, 2023
28d709e
10.2.2-dev.5
Jun 26, 2023
ff388ac
10.2.2-dev.6
Jun 26, 2023
ade8881
10.2.2-dev.7
Jun 27, 2023
580b5cb
fix the copy confirmation
Jun 27, 2023
0f1a91b
10.2.2-dev.8
Jun 27, 2023
268b236
add the waiting message
Jul 6, 2023
677aec8
10.2.2-dev.9
Jul 6, 2023
0119312
change wording of the component label
Jul 6, 2023
ff19394
10.2.2-dev.10
Jul 6, 2023
fac8952
add styles
Jul 6, 2023
f77dda4
10.2.2-dev.11
Jul 6, 2023
00b797c
bump font size
Jul 6, 2023
41aa4a4
10.2.2-dev.12
Jul 6, 2023
e27a0c1
fix pkg json
Jul 6, 2023
60309bd
10.2.2-dev.0
Jul 6, 2023
662a054
10.2.2-dev.1
Jul 6, 2023
bc26f78
10.2.2-dev.2
Jul 6, 2023
4c67a86
10.2.2-dev.3
Jul 6, 2023
73c98a7
10.2.2-dev.4
Jul 6, 2023
3c0553c
10.2.2-dev.5
Jul 6, 2023
2d7f6c0
10.2.2-dev.6
Jul 6, 2023
0bddb02
10.2.2-dev.7
Jul 6, 2023
627e961
10.2.2-dev.8
Jul 6, 2023
a5e9147
10.2.2-dev.9
Jul 6, 2023
dcfd42a
10.2.2-dev.10
Jul 6, 2023
c07c72c
10.2.2-dev.11
Jul 6, 2023
82a3ea1
10.2.2-dev.12
Jul 6, 2023
82f071d
10.2.2-dev.13
Jul 6, 2023
abe2a47
version
Jul 6, 2023
7613b6a
revert the -p
Jul 6, 2023
c2ee7eb
remove new line
Jul 7, 2023
dcbc37a
remove -p
Jul 7, 2023
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
1 change: 1 addition & 0 deletions lib/drawers/publish-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<div class="publish-status">
<span class="status-message">{{ statusMessage }}</span>
<span class="status-time">{{ time }}</span>

<ui-button v-if="isScheduled" class="status-undo-button" buttonType="button" color="red" @click.stop="unscheduleLayout">Unschedule</ui-button>
</div>

Expand Down
76 changes: 73 additions & 3 deletions lib/drawers/publish-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,24 @@
<ui-icon icon="open_in_new"></ui-icon>
<span class="status-link-text">View public page</span>
</a>
<!-- Public Prepublish URL Preview -->
<p class="prepublish-waiting-message" v-if="isScheduled">
Generating public-facing URL...
</p>
<div class="prepublish-url-component hidden">
<p class="prepublish-url-header">Public-facing URL Preview</p>
<p class="prepublish-url-subtext">This URL is not active until the article is published.</p>
<span class="prepublish-url-link-wrapper" @click="copyPreviewUrlToClipboard">
<a class="prepublish-url-link"></a>
<p class="prepublish-url-link-subtext">Click to copy to clipboard</p>
</span>
</div>
<!--/ Public Prepublish URL Preview -->
<ui-button v-if="isScheduled" class="status-undo-button" buttonType="button" color="red" @click.stop="unschedulePage">Unschedule</ui-button>
<ui-button v-else-if="isPublished" class="status-undo-button" buttonType="button" color="red" @click.stop="unpublishPage">Unpublish</ui-button>
<ui-button v-else-if="isArchived" class="status-undo-button" buttonType="button" color="red" @click.stop="archivePage(false)">Unarchive</ui-button>
</div>

<!-- publish actions -->
<div class="publish-actions">
<span class="action-message">{{ actionMessage }} <ui-icon-button v-if="showSchedule" icon="close" buttonType="button" type="secondary" color="default" size="small" tooltip="Clear Date/Time" tooltipPosition="left middle" @click.stop="clearScheduleForm"></ui-icon-button></span>
Expand Down Expand Up @@ -208,6 +221,18 @@
}
},
methods: {
copyPreviewUrlToClipboard() {
const urlString = document.querySelector('.prepublish-url-link').innerHTML;
const store = this.$store;

// Copy to clipboard.
navigator.clipboard.writeText(urlString)
.then(() => store.dispatch('showSnackbar', 'Preview URL successfully copied to clipboard.'))
.catch((err) => {
store.dispatch('showSnackbar', 'Error copying preview URL to clipboard.');
console.error('Error copying preview URL to clipboard. Error:\n', err);
});
},
goToHealth() {
this.$emit('selectTab', 'Health');
},
Expand Down Expand Up @@ -404,7 +429,7 @@
},
archivePage(archived) {
this.$store.dispatch('startProgress');

return this.$store.dispatch('updatePageList', { archived, shouldPatchArchive: true })
.then(() => {
this.$store.dispatch('finishProgress');
Expand All @@ -413,7 +438,7 @@
action: 'Undo',
onActionClick: () => this.archivePage(!archived)
});

return this.$store.dispatch('closeModal');
})
.catch((e) => {
Expand Down Expand Up @@ -564,6 +589,47 @@
.publish-drawer {
padding: 16px 0;

.prepublish-url-header {
@include type-subheading();
margin-bottom: 0.5em;
}

.prepublish-url-link {
@include type-body();
}

.prepublish-waiting-message {
@include type-caption();
border-radius: 0.5rem;
cursor: pointer;
display: block;
padding: 0.8rem 0.8rem 0.4rem 0.8rem;
text-align: center;
}

.prepublish-url-link-wrapper {
&:hover {
background-color: #f2faff;
}

background-color: $placeholder-bg-color;
border-radius: 0.5rem;
cursor: pointer;
display: block;
padding: 0.8rem 0.8rem 0.4rem 0.8rem;
word-wrap: break-word;
}

.prepublish-url-subtext {
@include type-caption();
margin-top: 8px;
}

.prepublish-url-link-subtext {
@include type-caption();
text-align: center;
}

.section-heading {
@include type-subheading();
}
Expand All @@ -584,6 +650,10 @@
flex-direction: column;
padding: 0 16px 16px;

.hidden {
display: none;
}

.status-message {
@include type-subheading();
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clay-kiln",
"version": "10.2.2",
"version": "10.2.2-dev.13",
"description": "Editor tools for Clay",
"template": "template.handlebars",
"scripts": {
Expand All @@ -13,7 +13,7 @@
"test-local": "BABEL_ENV=test npm run jest -- --watch",
"build": "BABEL_ENV=build webpack",
"watch": "BABEL_ENV=build webpack -w",
"prepublishOnly": "BABEL_ENV=build webpack -p",
"prepublishOnly": "BABEL_ENV=build webpack",
"generate-actions": "jsdoc2md --files lib/**/actions.js > docs/vuex-actions.md",
"release": "./.circleci/scripts/release.sh"
},
Expand Down