aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-09-13 13:01:21 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-09-13 13:01:21 -0400
commitf110a6cf1cac724a85e1001491e1bddedb8d1ebc (patch)
tree5b81393fbd6c9c94d11c5312809ed5de2fa2913f
parentce85076e3cc4b14d7e9ff75a4562d479a0374d2f (diff)
indication that all images in a collection have been tagged
-rw-r--r--deploy/assets/google_tags.pngbin0 -> 8093 bytes
-rw-r--r--src/client/views/collections/CollectionBaseView.scss18
-rw-r--r--src/client/views/collections/CollectionBaseView.tsx19
-rw-r--r--src/client/views/nodes/ImageBox.scss13
-rw-r--r--src/client/views/nodes/ImageBox.tsx15
-rw-r--r--src/server/credentials/google_docs_token.json2
-rw-r--r--src/server/index.ts1
7 files changed, 62 insertions, 6 deletions
diff --git a/deploy/assets/google_tags.png b/deploy/assets/google_tags.png
new file mode 100644
index 000000000..deb416407
--- /dev/null
+++ b/deploy/assets/google_tags.png
Binary files differ
diff --git a/src/client/views/collections/CollectionBaseView.scss b/src/client/views/collections/CollectionBaseView.scss
index 583e6f6ca..aff965469 100644
--- a/src/client/views/collections/CollectionBaseView.scss
+++ b/src/client/views/collections/CollectionBaseView.scss
@@ -1,4 +1,5 @@
@import "../globalCssVariables";
+
#collectionBaseView {
border-width: 0;
border-color: $light-color-secondary;
@@ -6,7 +7,20 @@
border-radius: 0 0 $border-radius $border-radius;
box-sizing: border-box;
border-radius: inherit;
- width:100%;
- height:100%;
+ width: 100%;
+ height: 100%;
overflow: auto;
+}
+
+#google-tags {
+ transition: all 0.5s ease 0s;
+ width: 30px;
+ height: 30px;
+ position: absolute;
+ bottom: 15px;
+ left: 15px;
+ border: 2px solid black;
+ border-radius: 50%;
+ padding: 3px;
+ background: white;
} \ No newline at end of file
diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx
index b7036b3ff..93eaab453 100644
--- a/src/client/views/collections/CollectionBaseView.tsx
+++ b/src/client/views/collections/CollectionBaseView.tsx
@@ -1,7 +1,7 @@
import { action, computed, observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
-import { Doc } from '../../../new_fields/Doc';
+import { Doc, DocListCast } from '../../../new_fields/Doc';
import { Id } from '../../../new_fields/FieldSymbols';
import { List } from '../../../new_fields/List';
import { listSpec } from '../../../new_fields/Schema';
@@ -13,6 +13,7 @@ import { FieldViewProps } from '../nodes/FieldView';
import './CollectionBaseView.scss';
import { DateField } from '../../../new_fields/DateField';
import { DocumentType } from '../../documents/DocumentTypes';
+import { ImageField } from '../../../new_fields/URLField';
export enum CollectionViewType {
Invalid,
@@ -154,6 +155,21 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> {
return false;
}
+ showIsTagged = () => {
+ const children = DocListCast(this.props.Document.data);
+ const imageProtos = children.filter(doc => Cast(doc.data, ImageField)).map(Doc.GetProto);
+ const allTagged = imageProtos.length > 0 && imageProtos.every(image => image.googlePhotosTags);
+ if (allTagged) {
+ return (
+ <img
+ id={"google-tags"}
+ src={"/assets/google_tags.png"}
+ />
+ );
+ }
+ return (null);
+ }
+
render() {
const props: CollectionRenderProps = {
addDocument: this.addDocument,
@@ -171,6 +187,7 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> {
}}
className={this.props.className || "collectionView-cont"}
onContextMenu={this.props.onContextMenu} ref={this.props.contentRef}>
+ {this.showIsTagged()}
{viewtype !== undefined ? this.props.children(viewtype, props) : (null)}
</div>
);
diff --git a/src/client/views/nodes/ImageBox.scss b/src/client/views/nodes/ImageBox.scss
index 98cf7f92f..71d718b39 100644
--- a/src/client/views/nodes/ImageBox.scss
+++ b/src/client/views/nodes/ImageBox.scss
@@ -49,6 +49,19 @@
cursor: pointer;
}
+#google-tags {
+ transition: all 0.5s ease 0s;
+ width: 30px;
+ height: 30px;
+ position: absolute;
+ bottom: 15px;
+ right: 15px;
+ border: 2px solid black;
+ border-radius: 50%;
+ padding: 3px;
+ background: white;
+}
+
.imageBox-button {
padding: 0vw;
border: none;
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 515f968ab..649d2d056 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -219,7 +219,7 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
let modes: ContextMenuProps[] = existingAnalyze && "subitems" in existingAnalyze ? existingAnalyze.subitems : [];
modes.push({ description: "Generate Tags", event: this.generateMetadata, icon: "tag" });
modes.push({ description: "Find Faces", event: this.extractFaces, icon: "camera" });
- !existingAnalyze && ContextMenu.Instance.addItem({ description: "Analyzers...", subitems: modes, icon: "hand-point-right" })
+ !existingAnalyze && ContextMenu.Instance.addItem({ description: "Analyzers...", subitems: modes, icon: "hand-point-right" });
ContextMenu.Instance.addItem({ description: "Image Funcs...", subitems: funcs, icon: "asterisk" });
}
@@ -387,6 +387,19 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
return (null);
}
+ considerGooglePhotosTags = () => {
+ const tags = StrCast(this.props.Document.googlePhotosTags);
+ if (tags) {
+ return (
+ <img
+ id={"google-tags"}
+ src={"/assets/google_tags.png"}
+ />
+ );
+ }
+ return (null);
+ }
+
render() {
// let transform = this.props.ScreenToLocalTransform().inverse();
let pw = typeof this.props.PanelWidth === "function" ? this.props.PanelWidth() : typeof this.props.PanelWidth === "number" ? (this.props.PanelWidth as any) as number : 50;
diff --git a/src/server/credentials/google_docs_token.json b/src/server/credentials/google_docs_token.json
index 1f097346a..bdeca837b 100644
--- a/src/server/credentials/google_docs_token.json
+++ b/src/server/credentials/google_docs_token.json
@@ -1 +1 @@
-{"access_token":"ya29.GlyBB937-mpLmukf1RrP8tQNfoWZvuHUjt0IxFuYfqNg1dHv1bBe04Tnc2CD_3p3qrtjjY5i2jUq--zaTf9_-CZi2TU2KnygPgDg4oyP5SgiHXv1pR0vlKRyNjhJqA","refresh_token":"1/HTv_xFHszu2Nf3iiFrUTaeKzC_Vp2-6bpIB06xW_WHI","scope":"https://www.googleapis.com/auth/presentations.readonly https://www.googleapis.com/auth/documents.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.appendonly https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/photoslibrary.sharing","token_type":"Bearer","expiry_date":1568322341079} \ No newline at end of file
+{"access_token":"ya29.ImCCBwLh8M4qd5ApvvhgMeCvbQidOUehUNU2fj3RH6Zx8D3rnCooiVgxoWbJ2ddS3a0_PGAQvCA7-GAeS70wUny80VKgCLjNbTlZkuxaRqpAd5yFGuWzcRljXrEIuA7EVu0","refresh_token":"1/HTv_xFHszu2Nf3iiFrUTaeKzC_Vp2-6bpIB06xW_WHI","scope":"https://www.googleapis.com/auth/presentations.readonly https://www.googleapis.com/auth/documents.readonly https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.appendonly https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/photoslibrary.sharing","token_type":"Bearer","expiry_date":1568394019509} \ No newline at end of file
diff --git a/src/server/index.ts b/src/server/index.ts
index d7273bd88..fdcc79b4d 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -86,7 +86,6 @@ app.use(expressValidator());
app.use(passport.initialize());
app.use(passport.session());
app.use((req, res, next) => {
- console.log(req.originalUrl);
res.locals.user = req.user;
next();
});