mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-11 22:07:08 +03:00
renamed slates to collections on front end
This commit is contained in:
parent
7900ec9fc8
commit
7516175d15
@ -48,7 +48,7 @@ const response = await fetch(url, {
|
|||||||
|
|
||||||
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
||||||
|
|
||||||
url = "https://uploads.slate.host/api/public/${slateId}" # collection ID
|
url = "https://uploads.slate.host/api/public/${slateId}" # collection ID. Omit this to just upload without adding to a specific collection
|
||||||
files = {
|
files = {
|
||||||
"file": open("example-file.txt", "rb")
|
"file": open("example-file.txt", "rb")
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
|||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Upload"
|
label="Upload"
|
||||||
description={
|
description={
|
||||||
"This API endpoint allows you to upload file(s) to your data. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
"This API endpoint allows you to upload a file to your data. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
@ -94,7 +94,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
|||||||
children={slateUploadCode}
|
children={slateUploadCode}
|
||||||
style={{ maxWidth: "820px" }}
|
style={{ maxWidth: "820px" }}
|
||||||
language={language}
|
language={language}
|
||||||
title="Upload"
|
title="Upload to collection"
|
||||||
multiLang="true"
|
multiLang="true"
|
||||||
onLanguageChange={this.props.onLanguageChange}
|
onLanguageChange={this.props.onLanguageChange}
|
||||||
/>
|
/>
|
||||||
|
@ -6,14 +6,14 @@ import CodeBlock from "~/components/system/CodeBlock";
|
|||||||
const EXAMPLE_CODE_JS = (
|
const EXAMPLE_CODE_JS = (
|
||||||
key,
|
key,
|
||||||
slateId
|
slateId
|
||||||
) => `const response = await fetch('https://slate.host/api/v2/get-slate', {
|
) => `const response = await fetch('https://slate.host/api/v2/get-collection', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: 'Basic ${key}',
|
Authorization: 'Basic ${key}',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ data: {
|
body: JSON.stringify({ data: {
|
||||||
id: '${slateId}' // slate ID
|
id: '${slateId}' // collection ID
|
||||||
}})
|
}})
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -25,13 +25,13 @@ const json = await response.json();
|
|||||||
if (json.error) {
|
if (json.error) {
|
||||||
console.log(json.error);
|
console.log(json.error);
|
||||||
} else {
|
} else {
|
||||||
const slate = json.slate;
|
const collection = json.collection;
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
const EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
const EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
||||||
import json as JSON
|
import json as JSON
|
||||||
|
|
||||||
url = 'https://slate.host/api/v2/get-slate'
|
url = 'https://slate.host/api/v2/get-collection'
|
||||||
headers = {
|
headers = {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Authorization': 'Basic ${key}'
|
'Authorization': 'Basic ${key}'
|
||||||
@ -39,13 +39,13 @@ headers = {
|
|||||||
|
|
||||||
json = {
|
json = {
|
||||||
"data": {
|
"data": {
|
||||||
"id": "${slateId}" # slate ID
|
"id": "${slateId}" # collection ID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r = requests.post(url, headers=headers, json=json)`;
|
r = requests.post(url, headers=headers, json=json)`;
|
||||||
|
|
||||||
export default class APIDocsGetSlate extends React.Component {
|
export default class APIDocsGetCollection extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
let APIKey = this.props.APIKey;
|
let APIKey = this.props.APIKey;
|
||||||
let slateId = this.props.slateId;
|
let slateId = this.props.slateId;
|
||||||
@ -60,14 +60,14 @@ export default class APIDocsGetSlate extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<System.DescriptionGroup
|
<System.DescriptionGroup
|
||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Get slate by ID"
|
label="Get collection by ID"
|
||||||
description="This API request will return a specific slate. You can save the response locally and send this JSON back to our API server using the route /api/v2/update-slate to update your slate."
|
description="This API request will return a specific collection. You can save the response locally and send this JSON back to our API server using the route /api/v2/update-collection to update your collection."
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
children={code}
|
children={code}
|
||||||
style={{ maxWidth: "820px" }}
|
style={{ maxWidth: "820px" }}
|
||||||
language={language}
|
language={language}
|
||||||
title="Get slate by ID"
|
title="Get collection by ID"
|
||||||
onLanguageChange={this.props.onLanguageChange}
|
onLanguageChange={this.props.onLanguageChange}
|
||||||
multiLang="true"
|
multiLang="true"
|
||||||
/>
|
/>
|
||||||
|
@ -19,7 +19,7 @@ const json = await response.json();
|
|||||||
if (json.error) {
|
if (json.error) {
|
||||||
console.log(json.error);
|
console.log(json.error);
|
||||||
} else {
|
} else {
|
||||||
const slates = json.slates;
|
const collections = json.collections;
|
||||||
const user = json.user;
|
const user = json.user;
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ const EXAMPLE_RESPONSE = `
|
|||||||
],
|
],
|
||||||
ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
ownerId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
|
||||||
data: {
|
data: {
|
||||||
body: "just a public slate, nothing special",
|
body: "just a public collection, nothing special",
|
||||||
name: "Public Example",
|
name: "Public Example",
|
||||||
layouts: {
|
layouts: {
|
||||||
ver: "2.0",
|
ver: "2.0",
|
||||||
@ -120,7 +120,7 @@ export default class APIDocsGet extends React.Component {
|
|||||||
<System.DescriptionGroup
|
<System.DescriptionGroup
|
||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Get your data"
|
label="Get your data"
|
||||||
description="This API request returns your user data and slates. If the request body is omitted, the request will return only your public slates by default."
|
description="This API request returns your user data and collections. If the request body is omitted, the request will return only your public collections by default."
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
children={code}
|
children={code}
|
||||||
|
@ -4,12 +4,12 @@ import * as System from "~/components/system";
|
|||||||
import CodeBlock from "~/components/system/CodeBlock";
|
import CodeBlock from "~/components/system/CodeBlock";
|
||||||
|
|
||||||
const EXAMPLE_CODE_JS = (key, slateId) => {
|
const EXAMPLE_CODE_JS = (key, slateId) => {
|
||||||
return `const SLATE_ID = "${slateId}"
|
return `const COLLECTION_ID = "${slateId}"
|
||||||
|
|
||||||
const slateResponseData = getSlateById(SLATE_ID);
|
const collectionResponseData = getCollectionById(COLLECTION_ID);
|
||||||
|
|
||||||
const slate = slateResponseData.slate;
|
const collection = collectionResponseData.collection;
|
||||||
const file = slate.objects[0];
|
const file = collection.objects[0];
|
||||||
file.data.name = "New filename";
|
file.data.name = "New filename";
|
||||||
|
|
||||||
const response = await fetch('https://slate.host/api/v2/update-file', {
|
const response = await fetch('https://slate.host/api/v2/update-file', {
|
||||||
@ -30,16 +30,16 @@ headers = {
|
|||||||
"Authorization": "Basic ${key}", // API key
|
"Authorization": "Basic ${key}", // API key
|
||||||
}
|
}
|
||||||
|
|
||||||
json = { "id": "${slateId}" } # slate ID
|
json = { "id": "${slateId}" } # collection ID
|
||||||
|
|
||||||
get_slate = requests.post(
|
get_collection = requests.post(
|
||||||
"https://slate.host/api/v2/get-slate", headers=headers, json=json
|
"https://slate.host/api/v2/get-collection", headers=headers, json=json
|
||||||
)
|
)
|
||||||
|
|
||||||
get_slate_response = get_slate.json()
|
get_collection_response = get_collection.json()
|
||||||
|
|
||||||
slate = get_slate_response["slate"]
|
collection = get_collection_response["collection"]
|
||||||
file = slate["objects"][0];
|
file = collection["objects"][0];
|
||||||
file["data"]["name"] = "New filename"
|
file["data"]["name"] = "New filename"
|
||||||
|
|
||||||
postJson = { "data": file }
|
postJson = { "data": file }
|
||||||
@ -63,7 +63,7 @@ export default class APIDocsUpdateFile extends React.Component {
|
|||||||
<System.DescriptionGroup
|
<System.DescriptionGroup
|
||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Update file"
|
label="Update file"
|
||||||
description="This API endpoint allows you to modify a file by saving the slate object in the response from get-slate, modifying it, and sending it back"
|
description="This API endpoint allows you to modify a file by saving the collection object in the response from get-collection, modifying it, and sending it back"
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
children={code}
|
children={code}
|
||||||
|
@ -4,20 +4,20 @@ import * as System from "~/components/system";
|
|||||||
import CodeBlock from "~/components/system/CodeBlock";
|
import CodeBlock from "~/components/system/CodeBlock";
|
||||||
|
|
||||||
const EXAMPLE_CODE_JS = (key, slateId) => {
|
const EXAMPLE_CODE_JS = (key, slateId) => {
|
||||||
return `const SLATE_ID = "${slateId}"
|
return `const COLLECTION_ID = "${slateId}"
|
||||||
|
|
||||||
const slateResponseData = getSlateById(SLATE_ID);
|
const collectionResponseData = getCollectionById(COLLECTION_ID);
|
||||||
|
|
||||||
const slate = slateResponseData.slate;
|
const collection = collectionResponseData.collection;
|
||||||
slate.data.name = "New title"
|
collection.data.name = "New title"
|
||||||
|
|
||||||
const response = await fetch('https://slate.host/api/v2/update-slate', {
|
const response = await fetch('https://slate.host/api/v2/update-collection', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: 'Basic ${key}', // API key
|
Authorization: 'Basic ${key}', // API key
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ data: slate })
|
body: JSON.stringify({ data: collection })
|
||||||
});`;
|
});`;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,25 +29,25 @@ headers = {
|
|||||||
"Authorization": "Basic ${key}", // API key
|
"Authorization": "Basic ${key}", // API key
|
||||||
}
|
}
|
||||||
|
|
||||||
json = { "id": "${slateId}" } # slate ID
|
json = { "id": "${slateId}" } # collection ID
|
||||||
|
|
||||||
get_slate = requests.post(
|
get_collection = requests.post(
|
||||||
"https://slate.host/api/v2/get-slate", headers=headers, json=json
|
"https://slate.host/api/v2/get-collection", headers=headers, json=json
|
||||||
)
|
)
|
||||||
|
|
||||||
get_slate_response = get_slate.json()
|
get_collection_response = get_collection.json()
|
||||||
|
|
||||||
|
|
||||||
slate = get_slate_response["slate"]
|
collection = get_collection_response["collection"]
|
||||||
slate["data"]["name"] = "New title"
|
collection["data"]["name"] = "New title"
|
||||||
|
|
||||||
postJson = { "data": slate }
|
postJson = { "data": collection }
|
||||||
|
|
||||||
url = "https://slate.host/api/v2/update-slate"
|
url = "https://slate.host/api/v2/update-collection"
|
||||||
|
|
||||||
r = requests.post(url, headers=headers, json=postJson)`;
|
r = requests.post(url, headers=headers, json=postJson)`;
|
||||||
|
|
||||||
export default class APIDocsUpdateSlate extends React.Component {
|
export default class APIDocsUpdateCollection extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
let language = this.props.language;
|
let language = this.props.language;
|
||||||
let key = this.props.APIKey;
|
let key = this.props.APIKey;
|
||||||
@ -61,14 +61,14 @@ export default class APIDocsUpdateSlate extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<System.DescriptionGroup
|
<System.DescriptionGroup
|
||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Update slate"
|
label="Update collection"
|
||||||
description="This API endpoint allows you to modify a slate by saving the response from get-slate, modifying it, and sending it back"
|
description="This API endpoint allows you to modify a collection by saving the response from get-collection, modifying it, and sending it back"
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
children={code}
|
children={code}
|
||||||
style={{ maxWidth: "820px" }}
|
style={{ maxWidth: "820px" }}
|
||||||
language={language}
|
language={language}
|
||||||
title="Update slate"
|
title="Update collection"
|
||||||
multiLang="true"
|
multiLang="true"
|
||||||
onLanguageChange={this.props.onLanguageChange}
|
onLanguageChange={this.props.onLanguageChange}
|
||||||
/>
|
/>
|
||||||
|
@ -32,7 +32,7 @@ r = requests.post(url, headers=headers, files=files)`;
|
|||||||
const SLATE_EXAMPLE_CODE_JS = (
|
const SLATE_EXAMPLE_CODE_JS = (
|
||||||
key,
|
key,
|
||||||
slateId
|
slateId
|
||||||
) => `const url = 'https://uploads.slate.host/api/public/${slateId}'; // slate ID
|
) => `const url = 'https://uploads.slate.host/api/public/${slateId}'; // collection ID
|
||||||
|
|
||||||
let file = e.target.files[0];
|
let file = e.target.files[0];
|
||||||
let data = new FormData();
|
let data = new FormData();
|
||||||
@ -48,7 +48,7 @@ const response = await fetch(url, {
|
|||||||
|
|
||||||
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
const SLATE_EXAMPLE_CODE_PY = (key, slateId) => `import requests
|
||||||
|
|
||||||
url = "https://uploads.slate.host/api/public/${slateId}" # slate ID
|
url = "https://uploads.slate.host/api/public/${slateId}" # collection ID
|
||||||
files = {
|
files = {
|
||||||
"file": open("example-file.txt", "rb")
|
"file": open("example-file.txt", "rb")
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
|||||||
style={{ maxWidth: 640, marginTop: 64 }}
|
style={{ maxWidth: 640, marginTop: 64 }}
|
||||||
label="Upload"
|
label="Upload"
|
||||||
description={
|
description={
|
||||||
"This API endpoint allows you to upload file(s) to your slate. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
"This API endpoint allows you to upload file(s) to your collection. This uses our data transfer microservice to interact with Textile Buckets and upload data to the IPFS/Filecoin network."
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<CodeBlock
|
<CodeBlock
|
||||||
@ -94,7 +94,7 @@ export default class APIDocsUploadToSlate extends React.Component {
|
|||||||
children={slateUploadCode}
|
children={slateUploadCode}
|
||||||
style={{ maxWidth: "820px" }}
|
style={{ maxWidth: "820px" }}
|
||||||
language={language}
|
language={language}
|
||||||
title="Upload to slate"
|
title="Upload to collection"
|
||||||
multiLang="true"
|
multiLang="true"
|
||||||
onLanguageChange={this.props.onLanguageChange}
|
onLanguageChange={this.props.onLanguageChange}
|
||||||
/>
|
/>
|
||||||
|
@ -452,7 +452,7 @@ class CarouselSidebar extends React.Component {
|
|||||||
_handleDelete = () => {
|
_handleDelete = () => {
|
||||||
if (this.props.external || !this.props.isOwner) return;
|
if (this.props.external || !this.props.isOwner) return;
|
||||||
const message =
|
const message =
|
||||||
"Are you sure you want to delete this? It will be removed from your slates as well";
|
"Are you sure you want to delete this? It will be removed from your collections as well";
|
||||||
if (!window.confirm(message)) {
|
if (!window.confirm(message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -538,7 +538,7 @@ class CarouselSidebar extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const slateNames = publicSlateNames.join(", ");
|
const slateNames = publicSlateNames.join(", ");
|
||||||
const message = `Making this file private will remove it from the following public slates: ${slateNames}. Do you wish to continue?`;
|
const message = `Making this file private will remove it from the following public collections: ${slateNames}. Do you wish to continue?`;
|
||||||
if (!window.confirm(message)) {
|
if (!window.confirm(message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -697,7 +697,7 @@ class CarouselSidebar extends React.Component {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<SVG.Slate height="24px" />
|
<SVG.Slate height="24px" />
|
||||||
<span style={{ marginLeft: 16 }}>Go to slate</span>
|
<span style={{ marginLeft: 16 }}>Go to collection</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
@ -738,7 +738,7 @@ class CarouselSidebar extends React.Component {
|
|||||||
actions.push(
|
actions.push(
|
||||||
<div key="remove" css={STYLES_ACTION} onClick={this._handleRemove}>
|
<div key="remove" css={STYLES_ACTION} onClick={this._handleRemove}>
|
||||||
<SVG.DismissCircle height="24px" />
|
<SVG.DismissCircle height="24px" />
|
||||||
<span style={{ marginLeft: 16 }}>Remove from slate</span>
|
<span style={{ marginLeft: 16 }}>Remove from collection</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -866,7 +866,7 @@ class CarouselSidebar extends React.Component {
|
|||||||
>
|
>
|
||||||
<SVG.ChevronDown height="24px" display="block" />
|
<SVG.ChevronDown height="24px" display="block" />
|
||||||
</span>
|
</span>
|
||||||
<span>Add to slate</span>
|
<span>Add to collection</span>
|
||||||
</div>
|
</div>
|
||||||
{this.state.showConnectedSection && (
|
{this.state.showConnectedSection && (
|
||||||
<div style={{ width: "100%", margin: "24px 0 44px 0" }}>
|
<div style={{ width: "100%", margin: "24px 0 44px 0" }}>
|
||||||
|
@ -475,7 +475,7 @@ export default class DataView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_handleDelete = (id) => {
|
_handleDelete = (id) => {
|
||||||
const message = `Are you sure you want to delete these files? They will be deleted from your slates as well`;
|
const message = `Are you sure you want to delete these files? They will be deleted from your collections as well`;
|
||||||
if (!window.confirm(message)) {
|
if (!window.confirm(message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -653,7 +653,7 @@ export default class DataView extends React.Component {
|
|||||||
style={{ color: Constants.system.white }}
|
style={{ color: Constants.system.white }}
|
||||||
onClick={this._handleAddToSlate}
|
onClick={this._handleAddToSlate}
|
||||||
>
|
>
|
||||||
Add to slate
|
Add to collection
|
||||||
</ButtonPrimary>
|
</ButtonPrimary>
|
||||||
<ButtonPrimary
|
<ButtonPrimary
|
||||||
transparent
|
transparent
|
||||||
|
@ -90,7 +90,7 @@ export class OnboardingModal extends React.Component {
|
|||||||
{
|
{
|
||||||
title: "New On Slate: Grid System 2.0",
|
title: "New On Slate: Grid System 2.0",
|
||||||
text:
|
text:
|
||||||
"We just introduced a completely new layout engine that gives you total control over the way you can organize and display your slates.",
|
"We just introduced a completely new layout engine that gives you total control over the way you can organize and display your collections.",
|
||||||
image: (
|
image: (
|
||||||
<img
|
<img
|
||||||
src="https://slate.textile.io/ipfs/bafybeigb7pd2dh64ty7l2yhnzu5kjupgxbfzqzjjb2gtprexfxzkwx4nle"
|
src="https://slate.textile.io/ipfs/bafybeigb7pd2dh64ty7l2yhnzu5kjupgxbfzqzjjb2gtprexfxzkwx4nle"
|
||||||
|
@ -554,7 +554,7 @@ export default class Profile extends React.Component {
|
|||||||
<div css={STYLES_STAT}>
|
<div css={STYLES_STAT}>
|
||||||
<div style={{ fontFamily: `${Constants.font.text}` }}>
|
<div style={{ fontFamily: `${Constants.font.text}` }}>
|
||||||
{user.slates?.length || 0}{" "}
|
{user.slates?.length || 0}{" "}
|
||||||
<span style={{ color: `${Constants.system.darkGray}` }}>Slates</span>
|
<span style={{ color: `${Constants.system.darkGray}` }}>Collections</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -576,7 +576,7 @@ export default class Profile extends React.Component {
|
|||||||
)}
|
)}
|
||||||
<div css={STYLES_PROFILE}>
|
<div css={STYLES_PROFILE}>
|
||||||
<TabGroup
|
<TabGroup
|
||||||
tabs={["Files", "Slates", "Peers"]}
|
tabs={["Files", "Collections", "Peers"]}
|
||||||
value={tab}
|
value={tab}
|
||||||
onChange={this._handleSwitchTab}
|
onChange={this._handleSwitchTab}
|
||||||
style={{ marginTop: 0, marginBottom: 32 }}
|
style={{ marginTop: 0, marginBottom: 32 }}
|
||||||
@ -619,7 +619,7 @@ export default class Profile extends React.Component {
|
|||||||
{tab === 1 ? (
|
{tab === 1 ? (
|
||||||
<div>
|
<div>
|
||||||
<SecondaryTabGroup
|
<SecondaryTabGroup
|
||||||
tabs={["Slates", "Following"]}
|
tabs={["Collections", "Following"]}
|
||||||
value={this.state.slateTab}
|
value={this.state.slateTab}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
this.setState({ slateTab: value }, () => {
|
this.setState({ slateTab: value }, () => {
|
||||||
@ -647,14 +647,14 @@ export default class Profile extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<SVG.Slate height="24px" style={{ marginBottom: 24 }} />
|
<SVG.Slate height="24px" style={{ marginBottom: 24 }} />
|
||||||
{this.state.slateTab === 0
|
{this.state.slateTab === 0
|
||||||
? `This user does not have any public slates yet`
|
? `This user does not have any public collections yet`
|
||||||
: `This user is not following any slates yet`}
|
: `This user is not following any collections yet`}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
) : (
|
) : (
|
||||||
<LoaderSpinner style={{ height: 24, width: 24 }} />
|
<LoaderSpinner style={{ height: 24, width: 24 }} />
|
||||||
)}
|
)}
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
<div css={STYLES_EXPLORE}>Explore Slates</div>
|
<div css={STYLES_EXPLORE}>Explore Collections</div>
|
||||||
<SlatePreviewBlocks
|
<SlatePreviewBlocks
|
||||||
isOwner={false}
|
isOwner={false}
|
||||||
external={this.props.external}
|
external={this.props.external}
|
||||||
@ -669,8 +669,8 @@ export default class Profile extends React.Component {
|
|||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<SVG.Slate height="24px" style={{ marginBottom: 24 }} />
|
<SVG.Slate height="24px" style={{ marginBottom: 24 }} />
|
||||||
{this.state.slateTab === 0
|
{this.state.slateTab === 0
|
||||||
? `This user does not have any public slates yet`
|
? `This user does not have any public collections yet`
|
||||||
: `This user is not following any slates yet`}
|
: `This user is not following any collections yet`}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
) : (
|
) : (
|
||||||
<LoaderSpinner style={{ height: 24, width: 24 }} />
|
<LoaderSpinner style={{ height: 24, width: 24 }} />
|
||||||
|
@ -115,7 +115,7 @@ const UserPreview = ({ user }) => {
|
|||||||
<div css={STYLES_PREVIEW_TEXT}>@{user.username}</div>
|
<div css={STYLES_PREVIEW_TEXT}>@{user.username}</div>
|
||||||
{user.data.slates ? (
|
{user.data.slates ? (
|
||||||
<div css={STYLES_PREVIEW_TEXT}>
|
<div css={STYLES_PREVIEW_TEXT}>
|
||||||
{user.data.slates.length} Slate{user.data.slates.length === 1 ? "" : "s"}
|
{user.data.slates.length} Collection{user.data.slates.length === 1 ? "" : "s"}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@ -266,7 +266,7 @@ const FilePreview = ({ file, slate, user, viewerId }) => {
|
|||||||
<div css={STYLES_PREVIEW_TEXT}>Owner: {user.data.name || `@${user.username}`}</div>
|
<div css={STYLES_PREVIEW_TEXT}>Owner: {user.data.name || `@${user.username}`}</div>
|
||||||
) : null}
|
) : null}
|
||||||
{slate ? (
|
{slate ? (
|
||||||
<div css={STYLES_PREVIEW_TEXT}>Slate: {slate.data.name || slate.slatename}</div>
|
<div css={STYLES_PREVIEW_TEXT}>Collection: {slate.data.name || slate.slatename}</div>
|
||||||
) : user?.id === viewerId ? (
|
) : user?.id === viewerId ? (
|
||||||
<div css={STYLES_PREVIEW_TEXT}>In your files</div>
|
<div css={STYLES_PREVIEW_TEXT}>In your files</div>
|
||||||
) : null}
|
) : null}
|
||||||
@ -955,7 +955,7 @@ export class SearchModal extends React.Component {
|
|||||||
{this.state.typeFilter ? (
|
{this.state.typeFilter ? (
|
||||||
<div css={STYLES_INLINE_TAG}>
|
<div css={STYLES_INLINE_TAG}>
|
||||||
{this.state.typeFilter === "SLATE"
|
{this.state.typeFilter === "SLATE"
|
||||||
? "Slates:"
|
? "Collections:"
|
||||||
: this.state.typeFilter === "USER"
|
: this.state.typeFilter === "USER"
|
||||||
? "Users:"
|
? "Users:"
|
||||||
: this.state.typeFilter === "FILE"
|
: this.state.typeFilter === "FILE"
|
||||||
@ -971,9 +971,9 @@ export class SearchModal extends React.Component {
|
|||||||
value={this.state.inputValue}
|
value={this.state.inputValue}
|
||||||
placeholder={`Search for ${
|
placeholder={`Search for ${
|
||||||
!this.state.typeFilter
|
!this.state.typeFilter
|
||||||
? "slates, users, and files..."
|
? "collections, users, and files..."
|
||||||
: this.state.typeFilter === "SLATE"
|
: this.state.typeFilter === "SLATE"
|
||||||
? "slates..."
|
? "collections..."
|
||||||
: this.state.typeFilter === "USER"
|
: this.state.typeFilter === "USER"
|
||||||
? "users..."
|
? "users..."
|
||||||
: this.state.typeFilter === "FILE"
|
: this.state.typeFilter === "FILE"
|
||||||
@ -1013,7 +1013,7 @@ export class SearchModal extends React.Component {
|
|||||||
>
|
>
|
||||||
<SVG.Layers height="16px" />
|
<SVG.Layers height="16px" />
|
||||||
<span css={STYLES_MOBILE_HIDDEN} style={{ marginLeft: 8 }}>
|
<span css={STYLES_MOBILE_HIDDEN} style={{ marginLeft: 8 }}>
|
||||||
Search slates
|
Search collections
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -1050,7 +1050,7 @@ export class SlateLayout extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_handleDeleteFiles = async (e, i) => {
|
_handleDeleteFiles = async (e, i) => {
|
||||||
const message = `Are you sure you want to delete these files? They will be deleted from your data and slates.`;
|
const message = `Are you sure you want to delete these files? They will be deleted from your data and collections.`;
|
||||||
if (!window.confirm(message)) {
|
if (!window.confirm(message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1384,7 +1384,7 @@ export class SlateLayout extends React.Component {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{this.state.tooltip === `${i}-remove`
|
{this.state.tooltip === `${i}-remove`
|
||||||
? "Remove from slate"
|
? "Remove from collection"
|
||||||
: this.state.tooltip === `${i}-view`
|
: this.state.tooltip === `${i}-view`
|
||||||
? "View file"
|
? "View file"
|
||||||
: this.state.tooltip === `${i}-download`
|
: this.state.tooltip === `${i}-download`
|
||||||
@ -1509,7 +1509,7 @@ export class SlateLayout extends React.Component {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{this.state.tooltip === `${i}-add`
|
{this.state.tooltip === `${i}-add`
|
||||||
? "Add to slate"
|
? "Add to collection"
|
||||||
: this.state.tooltip === `${i}-copy`
|
: this.state.tooltip === `${i}-copy`
|
||||||
? "Copy link"
|
? "Copy link"
|
||||||
: this.state.tooltip === `${i}-download`
|
: this.state.tooltip === `${i}-download`
|
||||||
@ -1690,7 +1690,7 @@ export class SlateLayout extends React.Component {
|
|||||||
style={{ marginLeft: 8, color: Constants.system.white }}
|
style={{ marginLeft: 8, color: Constants.system.white }}
|
||||||
onClick={this._handleAddToSlate}
|
onClick={this._handleAddToSlate}
|
||||||
>
|
>
|
||||||
Add to slate
|
Add to collection
|
||||||
</ButtonPrimary>
|
</ButtonPrimary>
|
||||||
<ButtonWarning
|
<ButtonWarning
|
||||||
transparent
|
transparent
|
||||||
@ -1725,7 +1725,7 @@ export class SlateLayout extends React.Component {
|
|||||||
onClick={this._handleAddToSlate}
|
onClick={this._handleAddToSlate}
|
||||||
style={{ color: Constants.system.white }}
|
style={{ color: Constants.system.white }}
|
||||||
>
|
>
|
||||||
Add to slate
|
Add to collection
|
||||||
</ButtonPrimary>
|
</ButtonPrimary>
|
||||||
<ButtonPrimary
|
<ButtonPrimary
|
||||||
transparent
|
transparent
|
||||||
|
@ -123,7 +123,7 @@ export class SlatePicker extends React.Component {
|
|||||||
pointerEvents: "none",
|
pointerEvents: "none",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div>Create new slate</div>
|
<div>Create new collection</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{this.props.slates.length ? (
|
{this.props.slates.length ? (
|
||||||
|
@ -278,7 +278,7 @@ export class SlatePreviewBlock extends React.Component {
|
|||||||
}}
|
}}
|
||||||
navigation={[
|
navigation={[
|
||||||
{
|
{
|
||||||
text: "Copy slate ID",
|
text: "Copy collection ID",
|
||||||
onClick: (e) => this._handleCopy(e, this.props.slate.id),
|
onClick: (e) => this._handleCopy(e, this.props.slate.id),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@ -368,7 +368,7 @@ export class SlatePreviewBlock extends React.Component {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Logo style={{ height: 18, marginRight: 32, position: "relative", top: 2 }} />
|
<Logo style={{ height: 18, marginRight: 32, position: "relative", top: 2 }} />
|
||||||
No files in this slate
|
No files in this collection
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
@ -75,7 +75,7 @@ export default class SidebarAddFileToSlate extends React.Component {
|
|||||||
marginBottom: 36,
|
marginBottom: 36,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add files to slate
|
Add files to collection
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<System.P css={STYLES_HEADER}>Slates</System.P>
|
<System.P css={STYLES_HEADER}>Slates</System.P>
|
||||||
@ -89,11 +89,11 @@ export default class SidebarAddFileToSlate extends React.Component {
|
|||||||
|
|
||||||
{Object.keys(this.state.selected).length ? (
|
{Object.keys(this.state.selected).length ? (
|
||||||
<ButtonPrimary full onClick={this._handleSubmit} style={{ marginTop: 32 }}>
|
<ButtonPrimary full onClick={this._handleSubmit} style={{ marginTop: 32 }}>
|
||||||
Add to slates
|
Add to collections
|
||||||
</ButtonPrimary>
|
</ButtonPrimary>
|
||||||
) : (
|
) : (
|
||||||
<ButtonDisabled full style={{ marginTop: 32 }}>
|
<ButtonDisabled full style={{ marginTop: 32 }}>
|
||||||
Add to slates
|
Add to collections
|
||||||
</ButtonDisabled>
|
</ButtonDisabled>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,7 +111,7 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
marginBottom: 36,
|
marginBottom: 36,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Create slate
|
Create collection
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<div css={STYLES_GROUPING}>
|
<div css={STYLES_GROUPING}>
|
||||||
@ -122,12 +122,12 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Give your slate a name so you and others can find it on Slate and on the web.
|
Give your collection a name so you and others can find it on Slate and on the web.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<System.Input
|
<System.Input
|
||||||
autoFocus
|
autoFocus
|
||||||
placeholder="Slate name..."
|
placeholder="Collection name..."
|
||||||
style={{ marginTop: 12 }}
|
style={{ marginTop: 12 }}
|
||||||
name="name"
|
name="name"
|
||||||
value={this.state.name}
|
value={this.state.name}
|
||||||
@ -155,12 +155,12 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Give your slate a description, add links, and connect it to other slates.
|
Give your collection a description, add links, and connect it to other collections.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<System.Textarea
|
<System.Textarea
|
||||||
style={{ marginTop: 12 }}
|
style={{ marginTop: 12 }}
|
||||||
placeholder="Slate description..."
|
placeholder="Collection description..."
|
||||||
name="body"
|
name="body"
|
||||||
value={this.state.body}
|
value={this.state.body}
|
||||||
onChange={this._handleChange}
|
onChange={this._handleChange}
|
||||||
@ -176,11 +176,11 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add tags to a slate to categorize it.
|
Add tags to a collection to categorize it.
|
||||||
</System.P>
|
</System.P>
|
||||||
<System.Tag
|
<System.Tag
|
||||||
name="tags"
|
name="tags"
|
||||||
placeholder={`Edit tags for ${this.state.name ? this.state.name : "this slate"}`}
|
placeholder={`Edit tags for ${this.state.name ? this.state.name : "this collection"}`}
|
||||||
tags={this.state.tags}
|
tags={this.state.tags}
|
||||||
suggestions={this.state.suggestions}
|
suggestions={this.state.suggestions}
|
||||||
style={{ marginTop: 12 }}
|
style={{ marginTop: 12 }}
|
||||||
@ -198,8 +198,8 @@ export default class SidebarCreateSlate extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
All slates are public by default. This means they can be discovered and seen by anyone
|
All collections are public by default. This means they can be discovered and seen by
|
||||||
on the internet. If you make it private, only you will be able to see it.
|
anyone on the internet. If you make it private, only you will be able to see it.
|
||||||
</System.P>
|
</System.P>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="isPublic"
|
name="isPublic"
|
||||||
|
@ -36,7 +36,7 @@ export default class SidebarDragDropNotice extends React.Component {
|
|||||||
<FileTypeGroup style={{ margin: "64px 0px" }} />
|
<FileTypeGroup style={{ margin: "64px 0px" }} />
|
||||||
<System.P style={{ marginTop: 24 }}>
|
<System.P style={{ marginTop: 24 }}>
|
||||||
Drag and drop a file anywhere on the screen to add it to your data. Dropping a file while
|
Drag and drop a file anywhere on the screen to add it to your data. Dropping a file while
|
||||||
on a slate page will add it to that slate.
|
on a collection page will add it to that collection.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<SidebarWarningMessage />
|
<SidebarWarningMessage />
|
||||||
|
@ -109,7 +109,9 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
|
|
||||||
_handleDelete = async (e) => {
|
_handleDelete = async (e) => {
|
||||||
if (
|
if (
|
||||||
!window.confirm("Are you sure you want to delete this Slate? This action is irreversible.")
|
!window.confirm(
|
||||||
|
"Are you sure you want to delete this Collection? This action is irreversible."
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -160,7 +162,7 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginBottom: 36,
|
marginBottom: 36,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Slate settings
|
Collection settings
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<div css={STYLES_GROUPING}>
|
<div css={STYLES_GROUPING}>
|
||||||
@ -171,11 +173,11 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Give your slate a name so you and others can find it on Slate and on the web.
|
Give your collection a name so you and others can find it on Slate and on the web.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<System.Input
|
<System.Input
|
||||||
placeholder="Slate name..."
|
placeholder="Collection name..."
|
||||||
style={{ marginTop: 12 }}
|
style={{ marginTop: 12 }}
|
||||||
name="tags"
|
name="tags"
|
||||||
value={this.state.name}
|
value={this.state.name}
|
||||||
@ -203,13 +205,13 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Give your slate a description, add links, and connect it to other slates.
|
Give your collection a description, add links, and connect it to other collections.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<System.Textarea
|
<System.Textarea
|
||||||
style={{ marginTop: 12 }}
|
style={{ marginTop: 12 }}
|
||||||
name="body"
|
name="body"
|
||||||
placeholder="Slate description..."
|
placeholder="Collection description..."
|
||||||
value={this.state.body}
|
value={this.state.body}
|
||||||
onChange={this._handleChange}
|
onChange={this._handleChange}
|
||||||
onSubmit={this._handleSubmit}
|
onSubmit={this._handleSubmit}
|
||||||
@ -224,7 +226,7 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Add tags to a slate to categorize it.
|
Add tags to a collection to categorize it.
|
||||||
</System.P>
|
</System.P>
|
||||||
<System.Tag
|
<System.Tag
|
||||||
name="tags"
|
name="tags"
|
||||||
@ -244,8 +246,8 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
This is the cover image for your slate. You can select a different cover image using the
|
This is the cover image for your collection. You can select a different cover image
|
||||||
"Make cover image" button.
|
using the "Make cover image" button.
|
||||||
</System.P>
|
</System.P>
|
||||||
|
|
||||||
<div css={STYLES_IMAGE_BOX} style={{ marginTop: 24 }}>
|
<div css={STYLES_IMAGE_BOX} style={{ marginTop: 24 }}>
|
||||||
@ -263,8 +265,8 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
All slates are public by default. This means they can be discovered and seen by anyone
|
All collections are public by default. This means they can be discovered and seen by
|
||||||
on the internet. If you make it private, only you will be able to see it.
|
anyone on the internet. If you make it private, only you will be able to see it.
|
||||||
</System.P>
|
</System.P>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name="isPublic"
|
name="isPublic"
|
||||||
@ -302,7 +304,7 @@ export default class SidebarSingleSlateSettings extends React.Component {
|
|||||||
|
|
||||||
<div style={{ marginTop: 16 }}>
|
<div style={{ marginTop: 16 }}>
|
||||||
<System.ButtonWarning full onClick={this._handleDelete} style={{ overflow: "hidden" }}>
|
<System.ButtonWarning full onClick={this._handleDelete} style={{ overflow: "hidden" }}>
|
||||||
Delete slate
|
Delete collection
|
||||||
</System.ButtonWarning>
|
</System.ButtonWarning>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -85,7 +85,7 @@ export const createSlate = ({ user, slate }) => {
|
|||||||
|
|
||||||
const userProfileURL = `https://slate.host/${user.username}`;
|
const userProfileURL = `https://slate.host/${user.username}`;
|
||||||
const userURL = `<${userProfileURL}|${user.username}>`;
|
const userURL = `<${userProfileURL}|${user.username}>`;
|
||||||
const message = `*${userURL}* created a slate: https://slate.host/${user.username}/${slate.slatename}`;
|
const message = `*${userURL}* created a collection: https://slate.host/${user.username}/${slate.slatename}`;
|
||||||
|
|
||||||
Social.sendSlackMessage(message);
|
Social.sendSlackMessage(message);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -180,7 +180,6 @@ export const createSlate = ({ user, slate }) => {
|
|||||||
|
|
||||||
export const createSlateObjects = ({ slate, user, files }) => {
|
export const createSlateObjects = ({ slate, user, files }) => {
|
||||||
// Data.createOrUpdateStats(new Date(), { objects: files.length });
|
// Data.createOrUpdateStats(new Date(), { objects: files.length });
|
||||||
console.log("inside create slate objects");
|
|
||||||
if (!slate.isPublic) return;
|
if (!slate.isPublic) return;
|
||||||
|
|
||||||
let activityItems = [];
|
let activityItems = [];
|
||||||
@ -307,7 +306,7 @@ export const subscribeSlate = ({ user, targetSlate }) => {
|
|||||||
const targetSlatePageURL = `https://slate.host/$/${targetSlate.id}`;
|
const targetSlatePageURL = `https://slate.host/$/${targetSlate.id}`;
|
||||||
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.slateId}>`;
|
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.slateId}>`;
|
||||||
|
|
||||||
const message = `*${userURL}* subscribed to slate:${targetSlateURL}`;
|
const message = `*${userURL}* subscribed to collection:${targetSlateURL}`;
|
||||||
Social.sendSlackMessage(message);
|
Social.sendSlackMessage(message);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
@ -135,7 +135,7 @@ export default class NotFoundPage extends React.Component {
|
|||||||
|
|
||||||
<div css={STYLES_MIDDLE}>
|
<div css={STYLES_MIDDLE}>
|
||||||
<h1 css={STYLES_GLITCH}>403</h1>
|
<h1 css={STYLES_GLITCH}>403</h1>
|
||||||
<h2>You do not have access to this Slate.</h2>
|
<h2>You do not have access to this collection.</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<WebsitePrototypeFooter />
|
<WebsitePrototypeFooter />
|
||||||
|
@ -125,7 +125,7 @@ const STYLES_MIDDLE = css`
|
|||||||
export default class NotFoundPage extends React.Component {
|
export default class NotFoundPage extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const title = `404`;
|
const title = `404`;
|
||||||
const description = "This page no longer exists.";
|
const description = "The page you are looking for does not exist";
|
||||||
const url = "https://slate.host/404";
|
const url = "https://slate.host/404";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -135,7 +135,7 @@ export default class NotFoundPage extends React.Component {
|
|||||||
|
|
||||||
<div css={STYLES_MIDDLE}>
|
<div css={STYLES_MIDDLE}>
|
||||||
<h1 css={STYLES_GLITCH}>404</h1>
|
<h1 css={STYLES_GLITCH}>404</h1>
|
||||||
<h2>The page you are looking for does not exist.</h2>
|
<h2>The page you are looking for does not exist</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<WebsitePrototypeFooter />
|
<WebsitePrototypeFooter />
|
||||||
|
@ -47,31 +47,31 @@ export default async (req, res) => {
|
|||||||
let slate;
|
let slate;
|
||||||
|
|
||||||
if (Strings.isEmpty(slateId)) {
|
if (Strings.isEmpty(slateId)) {
|
||||||
return res.status(400).send({ decorator: "V2_GET_SLATE_NO_ID_PROVIDED", error: true });
|
return res.status(400).send({ decorator: "NO_ID_PROVIDED", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
slate = await Data.getSlateById({ id: slateId, includeFiles: true, sanitize: true });
|
slate = await Data.getSlateById({ id: slateId, includeFiles: true, sanitize: true });
|
||||||
|
|
||||||
if (!slate) {
|
if (!slate) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
decorator: "SLATE_NOT_FOUND",
|
decorator: "COLLECTION_NOT_FOUND",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slate.error) {
|
if (slate.error) {
|
||||||
return res.status(500).send({
|
return res.status(500).send({
|
||||||
decorator: "ERROR_WHILE_LOCATING_SLATE",
|
decorator: "ERROR_WHILE_LOCATING_COLLECTION",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slate.isPublic) {
|
if (!slate.isPublic) {
|
||||||
return res.status(400).send({
|
return res.status(400).send({
|
||||||
decorator: "SLATE_IS_PRIVATE",
|
decorator: "COLLECTION_IS_PRIVATE",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.status(200).send({ decorator: "V2_GET_SLATE", slate });
|
return res.status(200).send({ decorator: "V2_GET_COLLECTION", collection: slate });
|
||||||
};
|
};
|
@ -55,14 +55,14 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
if (!slates) {
|
if (!slates) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
decorator: "COULD_NOT_FETCH_SLATES",
|
decorator: "COULD_NOT_FETCH_COLLECTIONS",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slates.error) {
|
if (slates.error) {
|
||||||
return res.status(500).send({
|
return res.status(500).send({
|
||||||
decorator: "COULD_NOT_FETCH_SLATES",
|
decorator: "COULD_NOT_FETCH_COLLECTIONS",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -72,5 +72,5 @@ export default async (req, res) => {
|
|||||||
return each;
|
return each;
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.status(200).send({ decorator: "V2_GET", user, slates });
|
return res.status(200).send({ decorator: "V2_GET", user, collections: slates });
|
||||||
};
|
};
|
||||||
|
@ -52,7 +52,7 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
if (!req.body.data) {
|
if (!req.body.data) {
|
||||||
return res.status(500).send({
|
return res.status(500).send({
|
||||||
decorator: "V2_UPDATE_SLATE_MUST_PROVIDE_DATA",
|
decorator: "V2_UPDATE_COLLECTION_MUST_PROVIDE_DATA",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -60,16 +60,16 @@ export default async (req, res) => {
|
|||||||
const slate = await Data.getSlateById({ id: req.body.data.id, includeFiles: true });
|
const slate = await Data.getSlateById({ id: req.body.data.id, includeFiles: true });
|
||||||
|
|
||||||
if (!slate) {
|
if (!slate) {
|
||||||
return res.status(404).send({ decorator: "SLATE_NOT_FOUND", error: true });
|
return res.status(404).send({ decorator: "COLLECTION_NOT_FOUND", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slate.error) {
|
if (slate.error) {
|
||||||
return res.status(500).send({ decorator: "SLATE_NOT_FOUND", error: true });
|
return res.status(500).send({ decorator: "COLLECTION_NOT_FOUND", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slate.ownerId !== user.id) {
|
if (slate.ownerId !== user.id) {
|
||||||
return res.status(400).send({
|
return res.status(400).send({
|
||||||
decorator: "NOT_SLATE_OWNER_UPDATE_NOT_PERMITTED",
|
decorator: "NOT_COLLECTION_OWNER_UPDATE_NOT_PERMITTED",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -92,11 +92,11 @@ export default async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!privacyResponse) {
|
if (!privacyResponse) {
|
||||||
return res.status(404).send({ decorator: "UPDATE_SLATE_PRIVACY_FAILED", error: true });
|
return res.status(404).send({ decorator: "UPDATE_COLLECTION_PRIVACY_FAILED", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (privacyResponse.error) {
|
if (privacyResponse.error) {
|
||||||
return res.status(500).send({ decorator: "UPDATE_SLATE_PRIVACY_FAILED", error: true });
|
return res.status(500).send({ decorator: "UPDATE_COLLECTION_PRIVACY_FAILED", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!updates.isPublic) {
|
if (!updates.isPublic) {
|
||||||
@ -125,7 +125,7 @@ export default async (req, res) => {
|
|||||||
if (updates.data.name && updates.data.name !== slate.data.name) {
|
if (updates.data.name && updates.data.name !== slate.data.name) {
|
||||||
if (!Validations.slatename(slate.data.name)) {
|
if (!Validations.slatename(slate.data.name)) {
|
||||||
return res.status(400).send({
|
return res.status(400).send({
|
||||||
decorator: "INVALID_SLATE_NAME",
|
decorator: "INVALID_COLLECTION_NAME",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
if (existingSlate) {
|
if (existingSlate) {
|
||||||
return res.status(500).send({
|
return res.status(500).send({
|
||||||
decorator: "SLATE_NAME_TAKEN",
|
decorator: "COLLECTION_NAME_TAKEN",
|
||||||
error: true,
|
error: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -148,11 +148,11 @@ export default async (req, res) => {
|
|||||||
let updatedSlate = await Data.updateSlateById(updates);
|
let updatedSlate = await Data.updateSlateById(updates);
|
||||||
|
|
||||||
if (!updatedSlate) {
|
if (!updatedSlate) {
|
||||||
return res.status(404).send({ decorator: "UPDATE_SLATE_FAILED", error: true });
|
return res.status(404).send({ decorator: "UPDATE_COLLECTION_FAILED", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updatedSlate.error) {
|
if (updatedSlate.error) {
|
||||||
return res.status(500).send({ decorator: "UPDATE_SLATE_FAILED", error: true });
|
return res.status(500).send({ decorator: "UPDATE_COLLECTION_FAILED", error: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slate.isPublic && !updates.isPublic) {
|
if (slate.isPublic && !updates.isPublic) {
|
||||||
@ -165,5 +165,5 @@ export default async (req, res) => {
|
|||||||
|
|
||||||
ViewerManager.hydratePartial(user.id, { slates: true });
|
ViewerManager.hydratePartial(user.id, { slates: true });
|
||||||
|
|
||||||
return res.status(200).send({ decorator: "V2_UPDATE_SLATE", slate: updatedSlate });
|
return res.status(200).send({ decorator: "V2_UPDATE_COLLECTION", collection: updatedSlate });
|
||||||
};
|
};
|
@ -728,7 +728,7 @@ method: 'POST',
|
|||||||
Authorization: 'Basic SLATE-API-KEY-FROM-ACCOUNT-SETTINGS',
|
Authorization: 'Basic SLATE-API-KEY-FROM-ACCOUNT-SETTINGS',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ data: {
|
body: JSON.stringify({ data: {
|
||||||
// NOTE: optional, if you want your private slates too.
|
// NOTE: optional, if you want your private collections too.
|
||||||
private: false
|
private: false
|
||||||
}})
|
}})
|
||||||
});
|
});
|
||||||
|
@ -429,7 +429,7 @@ export default class IndexPage extends React.Component {
|
|||||||
<div css={STYLES_TEXT_BLOCK}>
|
<div css={STYLES_TEXT_BLOCK}>
|
||||||
<h2 css={STYLES_H1}>
|
<h2 css={STYLES_H1}>
|
||||||
<span css={STYLES_HIGHLIGHT_YELLOW}>Collect, organize and share</span> <br />
|
<span css={STYLES_HIGHLIGHT_YELLOW}>Collect, organize and share</span> <br />
|
||||||
your slates
|
your collections
|
||||||
</h2>
|
</h2>
|
||||||
<p css={STYLES_P} style={{ opacity: 0.7 }}>
|
<p css={STYLES_P} style={{ opacity: 0.7 }}>
|
||||||
A modular interface for your files, an interface that gives you complete
|
A modular interface for your files, an interface that gives you complete
|
||||||
|
@ -138,8 +138,8 @@ export default class TermsPage extends React.Component {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a css={STYLES_LINK} href="#Your account and slates">
|
<a css={STYLES_LINK} href="#Your account and collections">
|
||||||
Your account and slates
|
Your account and collections
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -390,7 +390,7 @@ export default class SceneActivity extends React.Component {
|
|||||||
<TabGroup
|
<TabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={2}
|
value={2}
|
||||||
@ -403,7 +403,7 @@ export default class SceneActivity extends React.Component {
|
|||||||
<PrimaryTabGroup
|
<PrimaryTabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={2}
|
value={2}
|
||||||
@ -517,7 +517,7 @@ export default class SceneActivity extends React.Component {
|
|||||||
<EmptyState>
|
<EmptyState>
|
||||||
<SVG.Users height="24px" />
|
<SVG.Users height="24px" />
|
||||||
<div style={{ marginTop: 24 }}>
|
<div style={{ marginTop: 24 }}>
|
||||||
Start following people and slates to see their activity here
|
Start following people and collections to see their activity here
|
||||||
</div>
|
</div>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
)}
|
)}
|
||||||
|
@ -305,7 +305,8 @@ export default class SceneDirectory extends React.Component {
|
|||||||
) : (
|
) : (
|
||||||
<EmptyState>
|
<EmptyState>
|
||||||
<SVG.Users height="24px" style={{ marginBottom: 24 }} />
|
<SVG.Users height="24px" style={{ marginBottom: 24 }} />
|
||||||
You can follow any user on the network to be updated on their new uploads and slates.
|
You can follow any user on the network to be updated on their new uploads and
|
||||||
|
collections.
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
)
|
)
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -244,7 +244,7 @@ export default class SceneFilesFolder extends React.Component {
|
|||||||
<TabGroup
|
<TabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={0}
|
value={0}
|
||||||
@ -257,7 +257,7 @@ export default class SceneFilesFolder extends React.Component {
|
|||||||
<PrimaryTabGroup
|
<PrimaryTabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={0}
|
value={0}
|
||||||
|
@ -183,8 +183,8 @@ export default class SceneSlate extends React.Component {
|
|||||||
<SVG.Layers height="24px" style={{ marginBottom: 24 }} />
|
<SVG.Layers height="24px" style={{ marginBottom: 24 }} />
|
||||||
<div>
|
<div>
|
||||||
{this.state.accessDenied
|
{this.state.accessDenied
|
||||||
? "You do not have access to that slate"
|
? "You do not have access to that collection"
|
||||||
: "We were unable to locate that slate"}
|
: "We were unable to locate that collection"}
|
||||||
</div>
|
</div>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
</ScenePage>
|
</ScenePage>
|
||||||
@ -467,7 +467,9 @@ class SlatePage extends React.Component {
|
|||||||
<div>
|
<div>
|
||||||
<EmptyState>
|
<EmptyState>
|
||||||
<FileTypeGroup />
|
<FileTypeGroup />
|
||||||
<div style={{ marginTop: 24 }}>Drag and drop files to add them to this slate</div>
|
<div style={{ marginTop: 24 }}>
|
||||||
|
Drag and drop files to add them to this collection
|
||||||
|
</div>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
|
@ -41,7 +41,7 @@ export default class SceneSlates extends React.Component {
|
|||||||
<TabGroup
|
<TabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={1}
|
value={1}
|
||||||
@ -54,7 +54,7 @@ export default class SceneSlates extends React.Component {
|
|||||||
<PrimaryTabGroup
|
<PrimaryTabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "Files", value: "NAV_DATA" },
|
{ title: "Files", value: "NAV_DATA" },
|
||||||
{ title: "Slates", value: "NAV_SLATES" },
|
{ title: "Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Activity", value: "NAV_ACTIVITY" },
|
{ title: "Activity", value: "NAV_ACTIVITY" },
|
||||||
]}
|
]}
|
||||||
value={1}
|
value={1}
|
||||||
@ -69,7 +69,7 @@ export default class SceneSlates extends React.Component {
|
|||||||
</SquareButtonGray>
|
</SquareButtonGray>
|
||||||
<SecondaryTabGroup
|
<SecondaryTabGroup
|
||||||
tabs={[
|
tabs={[
|
||||||
{ title: "My Slates", value: "NAV_SLATES" },
|
{ title: "My Collections", value: "NAV_SLATES" },
|
||||||
{ title: "Subscribed", value: "NAV_SLATES_FOLLOWING" },
|
{ title: "Subscribed", value: "NAV_SLATES_FOLLOWING" },
|
||||||
]}
|
]}
|
||||||
value={this.props.tab}
|
value={this.props.tab}
|
||||||
@ -102,10 +102,10 @@ export default class SceneSlates extends React.Component {
|
|||||||
<EmptyState>
|
<EmptyState>
|
||||||
<FileTypeGroup />
|
<FileTypeGroup />
|
||||||
<div style={{ marginTop: 24 }}>
|
<div style={{ marginTop: 24 }}>
|
||||||
Use slates to create mood boards, share files, and organize research.
|
Use collections to create mood boards, share files, and organize research.
|
||||||
</div>
|
</div>
|
||||||
<ButtonSecondary onClick={this._handleAdd} style={{ marginTop: 32 }}>
|
<ButtonSecondary onClick={this._handleAdd} style={{ marginTop: 32 }}>
|
||||||
Create slate
|
Create collection
|
||||||
</ButtonSecondary>
|
</ButtonSecondary>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
)
|
)
|
||||||
@ -120,9 +120,9 @@ export default class SceneSlates extends React.Component {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<EmptyState>
|
<EmptyState>
|
||||||
You can follow any public slates on the network.
|
You can follow any public collections on the network.
|
||||||
<ButtonSecondary onClick={this._handleSearch} style={{ marginTop: 32 }}>
|
<ButtonSecondary onClick={this._handleSearch} style={{ marginTop: 32 }}>
|
||||||
Browse slates
|
Browse collections
|
||||||
</ButtonSecondary>
|
</ButtonSecondary>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user