Procházet zdrojové kódy

Use .endpoint instead of .json file extension

Sergiu Miclea před 6 roky
rodič
revize
074ea5a7be

+ 2 - 2
src/components/organisms/ChooseProvider/ChooseProvider.jsx

@@ -207,13 +207,13 @@ class ChooseProvider extends React.Component<Props, State> {
           <UploadMessage>
             You can
             &nbsp;<UploadMessageButton onClick={() => { this.fileInput.click() }}>upload</UploadMessageButton>&nbsp;
-            or drop an endpoint JSON file.
+            or drop a .endpoint file.
           </UploadMessage>
         </Upload>
         <FakeFileInput
           type="file"
           innerRef={r => { this.fileInput = r }}
-          accept=".json"
+          accept=".endpoint"
           onChange={e => { this.handleFileUpload(e.target.files) }}
         />
         <Button secondary onClick={this.props.onCancelClick} data-test-id="cProvider-cancelButton">Cancel</Button>

+ 1 - 1
src/components/pages/EndpointDetailsPage/EndpointDetailsPage.jsx

@@ -227,7 +227,7 @@ class EndpointDetailsPage extends React.Component<Props, State> {
       label: 'Duplicate',
       action: () => { this.handleDuplicateClick() },
     }, {
-      label: 'Export to JSON',
+      label: 'Download .endpoint file',
       action: () => { this.handleExportToJsonClick() },
     }, {
       label: 'Delete Endpoint',

+ 1 - 1
src/components/pages/EndpointsPage/EndpointsPage.jsx

@@ -246,7 +246,7 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
       action: () => { this.setState({ showDuplicateModal: true, modalIsOpen: true }) },
 
     }, {
-      label: 'Export to JSON',
+      label: 'Download .endpoint files',
       action: () => { this.handleExportToJson() },
     }, {
       label: 'Delete Endpoint',

+ 1 - 1
src/stores/EndpointStore.js

@@ -145,7 +145,7 @@ class EndpointStore {
   @action async exportToJson(endpoint: Endpoint): Promise<void> {
     let connectionInfo = await EndpointSource.getConnectionInfo(endpoint)
     endpoint.connection_info = connectionInfo
-    DomUtils.download(JSON.stringify(endpoint), `${endpoint.name}.json`)
+    DomUtils.download(JSON.stringify(endpoint), `${endpoint.name}.endpoint`)
   }
 
   @action setConnectionInfo(connectionInfo: $PropertyType<Endpoint, 'connection_info'>) {