This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| std_sql "database/sql" | |
| "fmt" | |
| "log" | |
| "sync" | |
| "sync/atomic" | |
| "time" |
This file contains hidden or 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
| import React, { useReducer } from "react"; | |
| import { Input, FormFeedback, Alert, Button, FormGroup } from "reactstrap"; | |
| import { createAction, ActionType, getType } from "typesafe-actions"; | |
| import { first, values, fromPairs, keyBy, mapValues } from "lodash"; | |
| /** | |
| * This story shows how the validation and form states should be display. | |
| * It is also a good example for hooks! | |
| */ | |
| const FormsUxStory = () => { |
This file contains hidden or 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
| declare module 'react-jss' { | |
| import * as React from 'react'; | |
| export interface CSSProperties extends React.CSSProperties { | |
| composes?: string | string[] | |
| } | |
| export type StyleSheet<Props = {}> | |
| = Record< |
This file contains hidden or 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
| angular.module("xSources.Security").directive("xsLoginForm", function (AuthenticationApi) { | |
| return { | |
| restrict: "EA", | |
| controller: function ($scope) { | |
| $scope.user = {}; | |
| AuthenticationApi.initialize(); |
This file contains hidden or 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
| angular | |
| .module("xSources.Security") | |
| .service("AuthenticationApi", function ($rootScope, ipCookie, SessionModel, Restangular) { | |
| var my = this; | |
| my.initialize = function () { | |
| SessionModel.get().then(function (session) { | |
| if (session == null || !session.IsValid) { | |
| $rootScope.$broadcast("authentication:required"); |
This file contains hidden or 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
| <div ng-app="xSources.Security"> | |
| <xs:login-form></xs:login-form> | |
| </div> | |
| <div id="main-app" style="display: none;"> | |
| {{session}} | |
| <button type="button" ng-click="logout()"> | |
| logout | |
| </button> |
This file contains hidden or 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
| $stateProvider.state("wf", { | |
| resolve: { | |
| waitForLogin: function(UserModel){ | |
| return UserModel.isLoggedIn(); | |
| } | |
| } | |
| }).state("wf.employee", { | |
| abstract: true, | |
| url: "employees/:id", |
This file contains hidden or 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
| $stateProvider.state("wf.employee", { | |
| abstract: true, | |
| url: "employees/:id", | |
| resolve: { | |
| employee: function(EmployeeModel, $stateParams){ | |
| return EmployeeModel.get($stateParams.id); | |
| } | |
| } | |
| }).state("wf.employee.salary", { | |
| //... |
This file contains hidden or 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
| angular.module("xAmine").factory("GetTestcasesByProject", function(Backend){ | |
| var filterBy = function(projectId){ | |
| return function(testcases){ | |
| return _(testcases).where({ProjectId: projectId}); | |
| }; | |
| }; | |
| return function(projectId){ | |
| return Backend.Get("Testcases").then(filterBy(projectId)); |
This file contains hidden or 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
| angular.module("xAmine").factory("GetTestcasesAvailableToCycle", function(GetTestcasesByProject){ | |
| var filterTestcasesIn = function(cycle){ | |
| return function(testcases){ | |
| var testCasesInCycle = _.chain(cycle.Tests.Items).pluck("Testcase").pluck("Id").value(); | |
| return _(testcases).reject(function(testcase){ | |
| return _(testCasesInCycle).contains(testcase.Id); | |
| }); | |
| }; |
NewerOlder