Skip to content

Commit

Permalink
feat: strapi 3.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danestves committed Dec 22, 2020
1 parent a1a3a9c commit 669f535
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 2,021 deletions.
103 changes: 0 additions & 103 deletions .gitattributes

This file was deleted.

130 changes: 123 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,126 @@
# Don't check auto-generated stuff into git
coverage
node_modules
stats.json
package-lock.json
############################
# OS X
############################

# Cruft
.DS_Store
npm-debug.log
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep

############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
node_modules
.node_history
yarn.lock
package-lock.json


############################
# Tests
############################

testApp
coverage

############################
# Strapi
############################

.env
exports
.cache
build


############################
# Strapi PLUGIN DIST
############################
/config
/controllers
/middlewares
/model
/services
/admin
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ src
__tests__
coverage
tsconfig.json
dist
dist
external-types
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PropTypes from "prop-types";
import isEqualFastCompare from "react-fast-compare";
import { Text } from "@buffetjs/core";
import { templateObject, ModalConfirm } from "strapi-helper-plugin";
import { usePreview } from "strapi-plugin-preview-content";
import { getTrad } from "../../../utils";
import { connect, getDraftRelations, select } from "./utils";

Expand All @@ -31,6 +32,7 @@ const Header = ({
onUnpublish,
status,
}) => {
const { previewHeaderActions } = usePreview();
const [showWarningUnpublish, setWarningUnpublish] = useState(false);
const { formatMessage } = useIntl();
const formatMessageRef = useRef(formatMessage);
Expand Down Expand Up @@ -131,7 +133,7 @@ const Header = ({
headerActions.unshift(action);
}

return [...headerActions];
return [...previewHeaderActions, ...headerActions];
}, [
isCreatingEntry,
canCreate,
Expand All @@ -144,6 +146,7 @@ const Header = ({
initialData,
onPublish,
checkIfHasDraftRelations,
previewHeaderActions,
]);

const headerProps = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import React from "react";
import { PreviewProvider } from "strapi-plugin-preview-content";
import useDataManager from "../../../../hooks/useDataManager";

function connect(WrappedComponent, select) {
return function (props) {
// eslint-disable-next-line react/prop-types
const selectors = select();
const { slug, ...data } = useDataManager();
console.log({ selectors, props });
return <WrappedComponent {...props} {...selectors} />;
const { slug } = useDataManager();

return (
<PreviewProvider {...selectors} {...props.allowedActions} slug={slug}>
<WrappedComponent {...props} {...selectors} />
</PreviewProvider>
);
};
}

Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
{
"name": "strapi-plugin-preview-content",
"version": "0.0.2",
"version": "0.0.3",
"description": "Preview your content with custom URL.",
"main": "admin/main/index.js",
"strapi": {
"name": "Preview Content",
"icon": "link",
"description": "Preview your content with custom URL."
},
"files": [
"admin",
"config",
"controllers",
"services"
],
"scripts": {
"build": "tsc",
"prepublishOnly": "yarn build"
"prepublish": "yarn build"
},
"dependencies": {
"strapi-plugin-preview": "^0.4.1"
},
"dependencies": {},
"author": {
"name": "Daniel Esteves",
"email": "[email protected]",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"declaration": true,
"declarationMap": true,
"downlevelIteration": true,
"incremental": true,
"allowJs": true,
"skipLibCheck": true,
"resolveJsonModule": true
Expand Down
Loading

0 comments on commit 669f535

Please sign in to comment.