Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EdisonPeM committed Apr 5, 2021
0 parents commit 3f09797
Show file tree
Hide file tree
Showing 38 changed files with 415 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
insert_final_newline = false
indent_style = space
indent_size = 2
103 changes: 103 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes

# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto

#
# The above will handle all files NOT found below
#

#
## These files are text and should be normalized (Convert crlf => lf)
#

# source code
*.php text
*.css text
*.sass text
*.scss text
*.less text
*.styl text
*.js text eol=lf
*.coffee text
*.json text
*.htm text
*.html text
*.xml text
*.svg text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
*.sh text
*.bat text

# templates
*.ejs text
*.hbt text
*.jade text
*.haml text
*.hbs text
*.dot text
*.tmpl text
*.phtml text

# git config
.gitattributes text
.gitignore text
.gitconfig text

# code analysis config
.jshintrc text
.jscsrc text
.jshintignore text
.csslintrc text

# misc config
*.yaml text
*.yml text
.editorconfig text

# build config
*.npmignore text
*.bowerrc text

# Heroku
Procfile text
.slugignore text

# Documentation
*.md text
LICENSE text
AUTHORS text


#
## These files are binary and should be left untouched
#

# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.eot binary
*.woff binary
*.pyc binary
*.pdf binary
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Don't check auto-generated stuff into git
coverage
node_modules
stats.json
package-lock.json

# Cruft
.DS_Store
npm-debug.log
.idea
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Strapi plugin import-export-content

A quick description of import-export-content.
29 changes: 29 additions & 0 deletions admin/src/containers/App/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
*
* This component is the skeleton around the actual pages, and should only
* contain code that should be seen on all pages. (e.g. navigation bar)
*
*/

import React from "react";
import { Switch, Route } from "react-router-dom";
import { NotFound } from "strapi-helper-plugin";
// Utils
import pluginId from "../../pluginId";
// Containers
import HomePage from "../HomePage";

const pathTo = (uri = "") => `/plugins/${pluginId}${uri}`;
const App = () => {
return (
<div>
<Switch>
<Route path={pathTo("/")} component={HomePage} exact />
<Route path={pathTo("users")} component={HomePage} />
<Route component={NotFound} />
</Switch>
</div>
);
};

export default App;
20 changes: 20 additions & 0 deletions admin/src/containers/HomePage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
*
* HomePage
*
*/

import React, { memo } from "react";
// import PropTypes from 'prop-types';
import pluginId from "../../pluginId";

const HomePage = () => {
return (
<div>
<h1>{pluginId}&apos;s HomePage</h1>
<p>Happy coding</p>
</div>
);
};

export default memo(HomePage);
26 changes: 26 additions & 0 deletions admin/src/containers/Initializer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
*
* Initializer
*
*/

import { useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import pluginId from '../../pluginId';

const Initializer = ({ updatePlugin }) => {
const ref = useRef();
ref.current = updatePlugin;

useEffect(() => {
ref.current(pluginId, 'isReady', true);
}, []);

return null;
};

Initializer.propTypes = {
updatePlugin: PropTypes.func.isRequired,
};

export default Initializer;
53 changes: 53 additions & 0 deletions admin/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import pluginPkg from "../../package.json";
import pluginId from "./pluginId";
import App from "./containers/App";
import Initializer from "./containers/Initializer";
import lifecycles from "./lifecycles";
import trads from "./translations";

export default (strapi) => {
const pluginDescription =
pluginPkg.strapi.description || pluginPkg.description;
const icon = pluginPkg.strapi.icon;
const name = pluginPkg.strapi.name;

const plugin = {
blockerComponent: null,
blockerComponentProps: {},
description: pluginDescription,
icon,
id: pluginId,
initializer: Initializer,
injectedComponents: [],
isReady: false,
isRequired: pluginPkg.strapi.required || false,
layout: null,
lifecycles,
mainComponent: App,
name,
preventComponentRendering: false,
trads,
menu: {
pluginsSectionLinks: [
{
destination: `/plugins/${pluginId}`,
icon,
label: {
id: `${pluginId}.plugin.name`,
defaultMessage: name,
},
name,
permissions: [
// Uncomment to set the permissions of the plugin here
// {
// action: '', // the action name should be plugins::plugin-name.actionType
// subject: null,
// },
],
},
],
},
};

return strapi.registerPlugin(plugin);
};
3 changes: 3 additions & 0 deletions admin/src/lifecycles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function lifecycles() {}

export default lifecycles;
7 changes: 7 additions & 0 deletions admin/src/pluginId.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const pluginPkg = require('../../package.json');
const pluginId = pluginPkg.name.replace(
/^strapi-plugin-/i,
''
);

module.exports = pluginId;
1 change: 1 addition & 0 deletions admin/src/translations/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions admin/src/translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugin.name": "Import / Export Content"
}
3 changes: 3 additions & 0 deletions admin/src/translations/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugin.name": "Importar / Exportar Contenido"
}
1 change: 1 addition & 0 deletions admin/src/translations/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
49 changes: 49 additions & 0 deletions admin/src/translations/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import ar from './ar.json';
import cs from './cs.json';
import de from './de.json';
import en from './en.json';
import es from './es.json';
import fr from './fr.json';
import id from './id.json';
import it from './it.json';
import ko from './ko.json';
import ms from './ms.json';
import nl from './nl.json';
import pl from './pl.json';
import ptBR from './pt-BR.json';
import pt from './pt.json';
import ru from './ru.json';
import th from './th.json';
import tr from './tr.json';
import uk from './uk.json';
import vi from './vi.json';
import zhHans from './zh-Hans.json';
import zh from './zh.json';
import sk from './sk.json';

const trads = {
ar,
cs,
de,
en,
es,
fr,
id,
it,
ko,
ms,
nl,
pl,
'pt-BR': ptBR,
pt,
ru,
th,
tr,
uk,
vi,
'zh-Hans': zhHans,
zh,
sk,
};

export default trads;
1 change: 1 addition & 0 deletions admin/src/translations/it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/ko.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/ms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/pt-BR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/sk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/th.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/tr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/uk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/vi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/zh-Hans.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions admin/src/translations/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions admin/src/utils/getTrad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pluginId from '../pluginId';

const getTrad = id => `${pluginId}.${id}`;

export default getTrad;
Loading

0 comments on commit 3f09797

Please sign in to comment.