Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Cleaned up broken manipulators
Browse files Browse the repository at this point in the history
  • Loading branch information
ajthinking committed May 28, 2018
1 parent 920716c commit 842f586
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
namespace App\Stimpack\Manipulators;
use App\Stimpack\Manipulator;
use App\Stimpack\Contexts\ContextFactory;
use App\Stimpack\Contexts\File;

class Delete extends Manipulator
class DeleteFile extends Manipulator
{
public function perform() {

$context = ContextFactory::make(
$this->path($this->data->relativePathToDelete)
)->delete();
File::init()->delete($this->path($this->data->relativePathToDelete));

return [
"messages" => [
"Deleted " . $context->path()
"Deleted successful."
]
];
}
Expand Down
16 changes: 16 additions & 0 deletions app/Stimpack/Manipulators/MigrateDatabase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Stimpack\Manipulators;
use App\Stimpack\Manipulator;
use App\Stimpack\Contexts\File;

class MigrateDatabase extends Manipulator
{
public function perform() {
return [
"messages" => [
"MigrateDatabase" . " executed successfully"
]
];
}
}
2 changes: 1 addition & 1 deletion app/Stimpack/Manipulators/SeedDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class SeedDatabase extends Manipulator
public function perform() {
return [
"messages" => [
SeedDatabase . " executed successfully"
"SeedDatabase" . " executed successfully"
]
];
}
Expand Down
198 changes: 130 additions & 68 deletions public/js/app.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions resources/assets/js/storm/AllManipulators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import Load from "./Manipulators/Load";

import CreateDatabase from "./Manipulators/CreateDatabase"
import CreateFile from "./Manipulators/CreateFile"
import Delete from "./Manipulators/Delete"
import DeleteFile from "./Manipulators/DeleteFile"
import MigrateDatabase from "./Manipulators/MigrateDatabase"
import ReplaceInFile from "./Manipulators/ReplaceInFile"
import ScaffoldLaravel from "./Manipulators/ScaffoldLaravel"
import SeedDatabase from "./Manipulators/SeedDatabase"
import SetEnv from "./Manipulators/SetEnv"
import ThrowBackEndError from "./Manipulators/ThrowBackEndError"
import SeedDatabase from "./Manipulators/SeedDatabase"

// Add your import here

const AllManipulators = {
// Starters
Expand All @@ -19,12 +20,13 @@ const AllManipulators = {
// Manipulators
CreateDatabase,
CreateFile,
Delete,
MigrateDatabase,
DeleteFile,
ReplaceInFile,
ScaffoldLaravel,
SeedDatabase,
SetEnv,
ThrowBackEndError,
SeedDatabase,
// Add your manipulator here
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as React from "react";
import {connect} from 'react-redux';
import BaseManipulator from "../BaseManipulator";

class Delete extends BaseManipulator {
class DeleteFile extends BaseManipulator {

static getDefaultManipulatorParameters() {
return {
name: "Delete",
name: "DeleteFile",
relativePathToDelete: ""
}
}
Expand All @@ -23,4 +23,4 @@ class Delete extends BaseManipulator {
export default connect(
BaseManipulator.mapStateToProps,
BaseManipulator.matchDispatchToProps
)(Delete);
)(DeleteFile);
25 changes: 25 additions & 0 deletions resources/assets/js/storm/Manipulators/MigrateDatabase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as React from "react";
import {connect} from 'react-redux';
import BaseManipulator from "../BaseManipulator";

class MigrateDatabase extends BaseManipulator {

static getDefaultManipulatorParameters() {
return {
name: "MigrateDatabase"
}
}

renderSettings() {
return (
<div>
<h3>Beware! This is just a placeholder</h3>
</div>
);
}
}

export default connect(
BaseManipulator.mapStateToProps,
BaseManipulator.matchDispatchToProps
)(MigrateDatabase);
2 changes: 1 addition & 1 deletion resources/assets/js/storm/Manipulators/SeedDatabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SeedDatabase extends BaseManipulator {
renderSettings() {
return (
<div>
<p>Insert your code here</p>
<h3>Beware! This is just a placeholder</h3>
</div>
);
}
Expand Down

0 comments on commit 842f586

Please sign in to comment.