-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bab709b
commit ed31d35
Showing
7 changed files
with
245 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
client/src/app/process-applications/ProcessApplications.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/** | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. | ||
* | ||
* Camunda licenses this file to you under the MIT; you may not use this file | ||
* except in compliance with the MIT License. | ||
*/ | ||
|
||
/** | ||
* @typedef { { | ||
* name: string, | ||
* files: string[] | ||
* } } ProcessApplicationConfiguration | ||
*/ | ||
|
||
class ProcessApplication { | ||
|
||
/** | ||
* @param {ProcessApplicationConfiguration} processApplicationConfiguration | ||
*/ | ||
constructor(processApplicationConfiguration) { | ||
this._configuration = processApplicationConfiguration; | ||
} | ||
|
||
getConfiguration() { | ||
return this._configuration; | ||
} | ||
|
||
getName() { | ||
return this._configuration.name; | ||
} | ||
|
||
setName(name) { | ||
this._configuration.name = name; | ||
} | ||
|
||
getFiles() { | ||
return this._configuration.files; | ||
} | ||
|
||
/** | ||
* Add file to process application. | ||
* | ||
* @param {File} file | ||
*/ | ||
addFile(file) { | ||
this._configuration.files.push(file); | ||
} | ||
|
||
removeFile(file) { | ||
const index = this._configuration.files.indexOf(file); | ||
|
||
if (index !== -1) { | ||
this._configuration.files.splice(index, 1); | ||
} | ||
} | ||
} | ||
|
||
export default class ProcessApplications { | ||
constructor(setState, getGlobal) { | ||
this._setState = setState; | ||
this._getGlobal = getGlobal; | ||
|
||
/** | ||
* @type {ProcessApplication} | ||
*/ | ||
this._openProcessApplication = null; | ||
} | ||
|
||
createNewProcessApplication() { | ||
return this.openProcessApplication(); | ||
} | ||
|
||
/** | ||
* Open existing process application based on configuration. | ||
* | ||
* @param {ProcessApplicationConfiguration} configuration | ||
*/ | ||
openProcessApplication(configuration) { | ||
const processApplication = new ProcessApplication(configuration); | ||
|
||
this._openProcessApplication = processApplication; | ||
|
||
this._setState((state) => { | ||
return { | ||
...state, | ||
openProcessApplication: processApplication | ||
}; | ||
}); | ||
|
||
return processApplication; | ||
} | ||
|
||
getOpenProcessApplication() { | ||
return this._openProcessApplication; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
client/src/app/process-applications/components/ProcessApplicationsStatusBar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. | ||
* | ||
* Camunda licenses this file to you under the MIT; you may not use this file | ||
* except in compliance with the MIT License. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { Fill } from '../../slot-fill'; | ||
|
||
export default function ProcessApplicationStatusBar(props) { | ||
|
||
// TODO return null if no process application open | ||
|
||
return <Fill slot="status-bar__file" group="0_process-application"> | ||
<button className="btn"> | ||
Process application | ||
</button> | ||
</Fill>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. | ||
* | ||
* Camunda licenses this file to you under the MIT; you may not use this file | ||
* except in compliance with the MIT License. | ||
*/ | ||
|
||
export { default as ProcessApplicationsStatusBar } from './ProcessApplicationsStatusBar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH | ||
* under one or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information regarding copyright | ||
* ownership. | ||
* | ||
* Camunda licenses this file to you under the MIT; you may not use this file | ||
* except in compliance with the MIT License. | ||
*/ | ||
|
||
export { default } from './ProcessApplications'; |