diff --git a/.dockerignore b/.dockerignore index 868663b..db0f820 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,4 +17,5 @@ run-cloud.sh .editorconfig docker-compose* ./.github -./.next \ No newline at end of file +./.next +./__generated__ \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f37d6a6 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +DATABASE_CONNECTION_STRING=postgres://dev:dev@127.0.0.1:5432/golinks +DATABASE_SCHEMA=public +NODE_ENV=production +AUTH0_ENABLED=false +LOGONAME=go.localhost +HOSTNAME=http://localhost:3000 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 588492d..980806d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ yarn-error.log* # graphql *.graphql.d.ts *.graphqls.d.ts +__generated__ # misc run-cloud.sh \ No newline at end of file diff --git a/.graphql-let.yml b/.graphql-let.yml index f7a66d6..6d98b9a 100644 --- a/.graphql-let.yml +++ b/.graphql-let.yml @@ -4,4 +4,5 @@ plugins: - typescript - typescript-operations - typescript-react-apollo -respectGitIgnore: true +cacheDir: __generated__ +respectGitIgnore: true \ No newline at end of file diff --git a/components/LinkForm/index.tsx b/components/LinkForm/index.tsx index e0fe774..9090620 100644 --- a/components/LinkForm/index.tsx +++ b/components/LinkForm/index.tsx @@ -4,7 +4,7 @@ import { Formik, Form, Field, FormikHelpers } from 'formik'; const CreateLinkSchema = Yup.object().shape({ alias: Yup.string() - .matches(/^[a-z0-9]+$/i) + .matches(/^[a-z0-9//]+$/i) .max(24, 'Too long for an alias.') .required('An alias is required.'), url: Yup.string() diff --git a/components/LinkTable/index.tsx b/components/LinkTable/index.tsx index 2ba7696..0226d6f 100644 --- a/components/LinkTable/index.tsx +++ b/components/LinkTable/index.tsx @@ -12,22 +12,20 @@ import { LinkMetricUsageGraph } from '../LinkMetricUsageGraph'; interface Props { data: GetAllLinksQuery; - isDeleteEnabled: boolean; isEditEnabled: boolean; - onDelete: (linkId: string) => void | Promise; - onShare: (linkUrl: string) => void | Promise; - onAnalytics: (linkId: string) => void | Promise; + isDeleteEnabled: boolean; onEdit: (linkId: string) => void | Promise; + onShare: (linkUrl: string) => void | Promise; + onDelete: (linkId: string) => void | Promise; } export const LinkTable: React.FC = ({ data, - isDeleteEnabled, isEditEnabled, - onDelete, + isDeleteEnabled, onEdit, onShare, - onAnalytics, + onDelete, }) => { const links = data?.links; @@ -84,12 +82,14 @@ export const LinkTable: React.FC = ({ - onEdit(link.id)}> - Edit - + {isEditEnabled && ( + onEdit(link.id)}> + Edit + + )} { @@ -101,20 +101,17 @@ export const LinkTable: React.FC = ({ }}> Share - onAnalytics(link.id)}> - Analytics - - { - onDelete(link.id); - }}> - Delete - + {isDeleteEnabled && ( + { + onDelete(link.id); + }}> + Delete + + )} }>